HDLC. . , , , , .
HDLC . . 802.11
U8 cmd;
U8 len;
u8 payload[len];
len +2
#define TRIGGER_SENSOR 0x01
#define SENSOR_RESPONSE 0x02
, , undefined, .
, , .
// total packet length minus flags len+4
U8 sflag; //0x7e start of packet end of packet flag from HDLC
U8 cmd; //tells the other side what to do.
U8 len; // payload length
U8 payload[len]; // could be zero len
U16 crc;
U8 eflag; //end of frame flag
0x7e, , , , pklen >= 4 pklen = len + 4, crc . . crc , , . crc reset crc . , . reset crc .
cmd len, . , , , .
So, for example, the touch device may have a timer or respond to a command to read. Then he formatted the packet and sent it to the PC, and the PC will reply that he received the packet. If not, the touch device can resend the wait time.
Also, when you are performing a network transfer, you must create it as a network stack, such as the OSI modle . HDLC is the data link layer , while RPC and command processing are the application layer .
source
share