26 static uint8_t c_prev = 0;
27 bool bRxPacketerror =
false, bPacketReceived =
false;
47 else if (c_prev == 0x7D)
59 bRxPacketerror =
true;
70 if (pHostRxPkt->
mIndex > 0)
75 bPacketReceived =
true;
88 bRxPacketerror =
true;
93 if (bRxPacketerror ==
true)
99 return bPacketReceived;
107 if (pBuffer == NULL || pMsg == NULL || size == 0)
113 pMsg[index++] = 0x7E;
114 for (
size_t offset = 0; offset <
size; offset++)
116 switch (pBuffer[offset])
119 pMsg[index++] = 0x7D;
120 pMsg[index++] = 0x5D;
123 pMsg[index++] = 0x7D;
124 pMsg[index++] = 0x5E;
127 pMsg[index++] = pBuffer[offset];
130 pMsg[index++] = 0x7E;
This structure holds information to receive a packet of data to the host.
bool HDLC_Process_Rx_Byte(uint8_t c, host_rx_packet_t *pHostRxPkt)
size_t HDLC_Process_Tx_Msg(const uint8_t *pBuffer, uint8_t *pMsg, size_t size)
The data_format_hdlc.h file contains the Host interface definitions and configuration.