CAS300 packet format¶
All packets in the CAS100 protocol are introduced by a single byte, which defines the basic purpose of the packet, and defines the kind of payload that follows it.
See the following sections for more information.
0x01
– Command packet¶
This packet has the following payload:
Offset |
Size |
Field name |
Description |
Values |
---|---|---|---|---|
0 (0x00) |
2 B |
Packet identifier (ID) |
Identifier of the packet the other party acknowledges. |
2-char ASCII-HEX value. |
2 (0x02) |
4 B |
Payload size (PZ) |
Size of the payload. |
4-char ASCII-HEX value. |
6 (0x06) |
PZ B |
Payload (P) |
Payload of the command. |
0x5C padded content. |
6 + PZ |
2 B |
Checksum (CS) |
2-char ASCII-HEX value. |
The checksum can be obtained or verified by summing all bytes going from PZ to P, and adding 1 to its bitwise complement.
See CAS300 commands for more information about commands.
0x02
– Data packet¶
This packet has the following payload:
Offset |
Size |
Field name |
Description |
Values |
---|---|---|---|---|
0 (0x00) |
2 B |
Packet identifier (ID) |
Identifier of the packet the other party acknowledges. |
2-char ASCII-HEX value. |
2 (0x02) |
4 B |
Payload size (PZ) |
Size of the payload. |
4-char ASCII-HEX value. |
6 (0x06) |
PZ B |
Payload (P) |
Payload of the command. |
0x5C padded content. |
6 + PZ |
2 B |
Checksum (CS) |
2-char ASCII-HEX value. |
The checksum can be obtained or verified by summing all bytes going from PZ to P, and adding 1 to its bitwise complement.
0x06
– Acknowledge packet¶
This packet has the following payload:
Offset |
Size |
Field name |
Description |
Values |
---|---|---|---|---|
0 (0x00) |
2 B |
Packet identifier (ID) |
Identifier of the packet the other party acknowledges. |
2-char ASCII-HEX value. |
0x18
– Terminate packet¶
This packet has the following payload: