| | |
| | | |
| | | /* TLV packet Minimum size is fixed bytes + 1 byte data */ |
| | | #define TLV_MIN_SIZE (TLV_FIXED_SIZE+1) |
| | | #define TLV_MAX_SIZE 32 /* all TLV packet length are no more than 32 bytes */ |
| | | |
| | | |
| | | /* Tag definition */ |
| | |
| | | int size; /* buffer size */ |
| | | } tlv_buf_t; |
| | | |
| | | |
| | | typedef struct tlv_pack_s |
| | | { |
| | | unsigned char header; |
| | | unsigned char tag; |
| | | char len; |
| | | char data[0]; |
| | | /* followed: $len bytes payload data */ |
| | | /* followed: 2 bytes CRC checksum */ |
| | | } tlv_pack_t; |
| | | |
| | | |
| | | |
| | | /* Packet TLV message for server reply ACK message: ACK(ack=1)/NAK(ack=0) */ |
| | | #define ACK 1 |
| | | #define NAK 0 |