You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
703 B

#include "protocolPTZ.h"
static inline uint16_t x25_crc_calculate( uint8_t *pBuffer, size_t length ){
uint16_t crcTmp = 0xffff;
for ( size_t i = 0; i < length; i++){
uint8_t tmp;
tmp = pBuffer[i] ^ (uint8_t)(crcTmp & 0xff);
tmp ^= (tmp<<4);
crcTmp = (crcTmp>>8) ^ (crcTmp<<8) ^ (tmp <<3) ^ (tmp>>4);
};
return crcTmp;
};
protocolMAVLINK::protocolMAVLINK(){
m_oDataTransport = NULL;
};
protocolMAVLINK::protocolMAVLINK( basicTransport *Serial ):protocolParser(){
m_oDataTransport = Serial;
if( m_oDataTransport != NULL ) {
m_oDataTransport->addRecipient( ( protocolParser *) this );
};
};
protocolMAVLINK::~protocolMAVLINK(){
};