The communication protocol used by BOLOS to exchange APDU is very close to ISO 7816-4 with a few differences:
Lclength is always exactly 1 byte- No
Lefield in APDU command - Maximum size of APDU command is 260 bytes: 5 bytes of header + 255 bytes of data
- Maximum size of APDU response is 260 bytes: 258 bytes of response data + 2 bytes of status word
Status words tend to be similar to common APDU responses in the industry.
| Field name | Length (bytes) | Description |
|---|---|---|
| CLA | 1 | Instruction class - indicates the type of command |
| INS | 1 | Instruction code - indicates the specific command |
| P1 | 1 | Instruction parameter 1 for the command |
| P2 | 1 | Instruction parameter 2 for the command |
| Lc | 1 | The number of bytes of command data to follow (a value from 0 to 255) |
| CData | var | Command data with Lc bytes |
| Field name | Length (bytes) | Description |
|---|---|---|
| RData | var | Response data (can be empty) |
| SW | 2 | Status word containing command processing status (e.g. 0x9000 for success) |