Serial
- Payload encoding: UTF-8
- Request body inside serial payload is form-encoded key/value pairs
Serial frame format
+------+-------------------+---------------------+------+
| STX | Payload (N bytes) | CRC32 (4 bytes, BE) | ETX |
| 0x02 | UTF-8 text | over payload only | 0x03 |
+------+-------------------+---------------------+------+
Rules:
- CRC algorithm:
CRC32. - CRC byte order in frame: big-endian.
- CRC input: payload bytes only.
- After CRC is calculated, any CRC byte equal to
0x03is replaced with0x20. - Invalid frame or CRC mismatch must be treated as invalid request/response frame.
Serial payload format
Form-encoded fields:
command(required): route, for example/saleorsaledata(required): Base64 of UTF-8 JSON business payloadsign(required): signature string
Example payload string:
command=/check_status&data=eyJkb2N1bWVudEV4dElEIjoiT1JERVItMTAwMSJ9&sign=<SIGN>