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.
0x00
– Serial status packet¶
This packet is found over serial links. It has the following payload:
Offset |
Size |
Field name |
Description |
Values |
||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 (0x00) |
1 B |
Serial status (SS) |
Current serial status. |
1-byte value, among the following:
|
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. |
0x13
– Established packet¶
This packet is single-byte, and is used by the receiver to acknowledge link initialization. This is common to all CASIOLINK variants.
Warning
On serial links, instead of sending 0x13
, the ClassPad 300 / 330 (+)
may send two 0x00
bytes. This nuance is CAS300-specific.
0x15
– Out-of-order packet¶
This packet is used by either party to signal that the identifier of the packet sent by the other party is out-of-order. It has the following payload:
Offset |
Size |
Field name |
Description |
Values |
---|---|---|---|---|
0 (0x00) |
2 B |
Expected packet identifier (EID) |
Expected packet identifier. |
2-char ASCII-HEX value. |
0x18
– Terminate packet¶
This packet has the following payload: