通信中数据的打包和拆包
Header | Handle(DataType) | Length | payload | Sum |
---|---|---|---|---|
0xAA |
App_uart_Send(enum UartHandle handle, uint8_t* data, uint16_t length);
App_uart_Receive(const uint8_t* packet, uint16_t length);
void LinkLayer_Send(packet, length)
{
...
}
void App_uart_Receive(const uint8_t* packet, uint16_t length)
enum UartHandle{
...
MaxHandle
}