${proto.name} ICD
- Generated with PolyPacket on ${proto.genTime}
- CRC: ${proto.hash}
- Transport Encoding: (COBS) Consistent Overhead ByteStuffing
Description:
${proto.desc}
Index
- Packet Header %if len(proto.packets) > 0:
- Packets:
-
%for packet in proto.packets:
- ${"[%0.2X]" % packet.packetId} ${packet.name} %endfor
-
%for struct in proto.structs:
- ${"[%0.2X]" % struct.packetId} ${struct.name} %endfor
%endif
Packet Header
Every Packet has a standard 8 byte header
Byte | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|---|
field | typeId | reserved | Data Len | Token | Checksum | |||
Type | uint8 | uint8 | uint16 | uint16 | uint16 |
Fields:
Field | Type | Description |
---|---|---|
TypeId | uint8_t | ID for packet type |
Sequence | uint8_t | Sequence number, can be used to ensure packets are not being dropped |
Data Length | uint16_t | Total length of packet payload |
Token | uint16_t |
New Packets generate a 15 bit token. Responding packets copy the token and set the Ack Flag high. This is used for timeout/retries and packet response handlers |
Checksum | uint16_t | 16bit checksum of payload for error checking |
For more detailed information on how field data is serialized and encoded see the documentation for the PolyPacket backend library
Packets
Ping
- Packet ID: [00]
- Requests: Ack
Ping to request an Ack. Used for testing and ICD verification
Fields:
Field | Type | Description |
---|---|---|
icd | uint32_t | 32bit Hash of protocol description. This is used to verify endpoints are using the same protocol |
${packet.name}
- Packet ID: [${"%0.2X" % packet.packetId}] %if packet.hasResponse:
- Requests: ${packet.response.name} %endif %if len(packet.respondsTo) > 0:
- Responds To: \ %for idx,request in enumerate(packet.respondsTo): %if idx == 0: ${request}\ %else: , ${request}\ %endif %endfor %endif
${packet.desc}
%if len(packet.fields) > 0:
Fields:
Field | Type | Description | |
---|---|---|---|
${field.name} | %else:${field.name} | %endif${field.cType}\ %if field.isArray: [${field.arrayLen}]\ %endif | ${field.desc}\
%if field.isEnum:
|
%endif
Structs
%for packet in proto.structs: %if not packet.standard:
${packet.name}
- Packet ID: [${"%0.2X" % packet.packetId}] %if packet.hasResponse:
- Requests: ${packet.response.name} %endif %if len(packet.respondsTo) > 0:
- Responds To: \ %for idx,request in enumerate(packet.respondsTo): %if idx == 0: ${request}\ %else: , ${request}\ %endif %endfor %endif
${packet.desc}
%if len(packet.fields) > 0:
Fields:
Field | Type | Description | |
---|---|---|---|
${field.name} | %else:${field.name} | %endif${field.cType}\ %if field.isArray: [${field.arrayLen}]\ %endif | ${field.desc}\
%if field.isEnum:
|
%endif