The SH1 protocol is built to be tested/invoked from a terminal, that's the reason for all the ASCII characters. The package uses a:
Fixed character as preamble to indicate start of package
Destination address byte
Source address byte
Command byte
Size byte
Data payload
Simple checksum byte, the sum of previous bytes
Carriage return character
The package is minimum 7 bytes and maximum 262 bytes in size. DATA is transmitted only if NBYTES is nonzero.
SYNC | ADDRESS | SENDER | COMMAND | NBYTES | DATA | CS | CR |
---|---|---|---|---|---|---|---|
U | E | P | C | 2 | int mA | Calc | ¬ |
0x55 | 0x45 | 0x50 | 0x43 | 0x02 | 0x04B0 | 0xE3 | 0x0D |
Address (ASCII) | Address (hex) | HW Module |
---|---|---|
C | 0x43 | Charger |
D | 0x44 | DB101 Display |
E | 0x45 | Electronic Load |
M | 0x4D | Main Controller |
P | 0x50 | PC |
S | 0x53 | SB20x |