Code: 0xFF
Must:
- Specify Nucleo adress
- Specify version, subversion
- Specify frequency of heartbeat (in ms)
| Byte | Content | Description |
|---|---|---|
0xFF |
Init code | |
0x00 |
Address | |
0x01 |
Version | |
0x01 |
Sub-version | |
0x01 |
Interval entry | See Interval table |
0x97 |
CRC-8 | |
0xEE |
End of packet | Optional due init fixed dimension |
Must:
- Specify adress
- Specify version
- Specify state
| Byte | Content | Description |
|---|---|---|
0xFF |
Init code | |
0x00 |
Address | In case of multiple Nucleo |
0x01 |
Version | |
0x01 |
Sub-version | |
0x?? |
Positive or negative response | Based on the initialization |
0x?? |
CRC-8 | |
0xEE |
End of packet |
0x00 is the only positive response
0x01Serial not opened0x02Old Version (Raspberry Pi)0x03Old Version (Nucleo)0x04Nucleo does not answer0x05Invalid answer0x06CRC failed0x07Thrusters fail initialization- Others?
Code: 0xAA
| Byte | Content | Description |
|---|---|---|
0xAA |
Code | Communication code |
0x00 |
Address | In case of multiple Nucleo |
0x00 |
Command | See list below |
| Arguments (dynamic) | Arguments, variable based on command | |
| CRC-8 | See CRC-8 calculation rules | |
0xEE |
End of packet |
In particular:
- Command 0 (
motor) has8arguments ofuint16_t(Unidirectional) - Command 1 (
arm) has1argument ofuint16_t(Unidirectional) - Command 2 (
sensor) see sensor polling command
| Byte | Content | Description |
|---|---|---|
0x00 |
Sensor_ID | ID for the sensor Nucleo must query |
0x76 |
I2C address | |
0x00 |
Interval entry | See Interval table |
0x00 |
Type of sensor | See type sensor list |
| Byte | Content | Description |
|---|---|---|
0x00 |
Sensor_ID | ID of queried sensor |
0x00 |
Type of sensor | See type sensor list |
| Sensor data | According to type sensor list |
Code: 0xBB
| Byte | Content | Description |
|---|---|---|
0xBB |
Code | Heartbeat code |
0x00 |
Address | |
0b1 |
Status | 0 -> OK, 1 -> Not Working |
0b0000000 |
Status code | |
0x?? |
Paylod | According to Salvatore |
0xEA |
CRC | |
0xEE |
End of packet |
000: Ready001: Processing PWM- ..
000: Not ready001: Thruster fail- ...
Behind each START_BYTES (0xAA, 0xBB and 0xFF), it is mandatory to prepend 0x7E as ESCAPE CHARACTER.
Behind each 0xEE byte, it is mandatory to prepend 0x7E as ESCAPE CHARACTER.
Behind each 0x7E byte, it is mandatory to prepend 0x7E as ESCAPE CHARACTER.
The CRC calculation must consider all the bytes in the packet, excluding:
- ESCAPE CHARACTER(S)
- END OF PACKET BYTE
Interval table:
| Byte (Hex) | Interval (ms) |
|---|---|
| 0x00 | 10 ms |
| 0x01 | 20 ms |
| 0x02 | 30 ms |
| 0x03 | 40 ms |
| .. | .. |
| 0xFF | 2550 ms |