54 memset((
void *)o_packet, 0,
sizeof(
CommPacket));
70 for (; (i < buf_length) && (i < kPacketLengthLmit); i++) {
76 if (i < kPacketLengthLmit) {
88 if (preamble->
sof == kGpsProtocolSof) {
99 if (checksum == raw_checksum) {
109 for (
uint32_t i = 1; i < length; i++) {
116 uint8_t h = toupper(TwoChar[0]) - 0x30;
119 uint8_t l = toupper(TwoChar[1]) - 0x30;
uint8_t CalcGpsPacketChecksum(const uint8_t *buf, uint32_t length)
uint32_t GetPacketWrapperLen() override
const uint32_t kPreambleLen
int32_t Pack(uint8_t *o_buf, uint32_t o_buf_size, uint32_t *o_len, const CommPacket &i_packet) override
const uint8_t kGpsProtocolSof
int32_t CheckPreamble(const uint8_t *buf) override
const uint32_t kWrapperLen
uint32_t GetPreambleLen() override
int32_t CheckPacket(const uint8_t *buf) override
uint32_t FindPacketLen(const uint8_t *buf, uint32_t buf_length) override
uint32_t GetPacketLen(const uint8_t *buf) override
int32_t ParsePacket(const uint8_t *i_buf, uint32_t i_len, CommPacket *o_packet) override
const uint32_t kPacketLengthLmit
uint8_t AscciiToHex(const uint8_t *TwoChar)
const uint8_t kGpsProtocolEof