radio double support (#1540)
* support for doubles in radio * fix typos * more docs * more support * fix build * handle serial * fix length * fixing buffer allocation * use same notation * using decrRC
This commit is contained in:
@ -10,6 +10,45 @@ A packet that was received by the radio.
|
||||
* `serial` - The serial number of the @boardname@ that sent this packet or `0` if the @boardname@ did not include its serial number.
|
||||
* `signal` - How strong the radio signal is. The exact range of values varies, but it goes approximately from `-128` dB (weak) to `-42` dB (strong).
|
||||
|
||||
## Packet layout
|
||||
|
||||
This section documents the data layout of the packet if you need to interpret the data outside of MakeCode.
|
||||
|
||||
Packet byte layout
|
||||
| 0 | 1 ... 4 | 5 ... 8 | 9 ... 28
|
||||
----------------------------------------------------------------
|
||||
| packet type | system time | serial number | payload
|
||||
|
||||
* Serial number defaults to 0 unless enabled by user
|
||||
* system time is milli-seconds since started, it will wrap around after a month or so
|
||||
|
||||
### Packet types
|
||||
|
||||
* PACKET_TYPE_NUMBER 0
|
||||
|
||||
payload: number (9 ... 12)
|
||||
|
||||
|
||||
* PACKET_TYPE_VALUE 1
|
||||
|
||||
payload: number (9 ... 12), name length (13), name (14 ... 26)
|
||||
|
||||
* PACKET_TYPE_STRING 2
|
||||
|
||||
payload: string length (9), string (10 ... 28)
|
||||
|
||||
* PACKET_TYPE_BUFFER 3
|
||||
|
||||
payload: buffer length (9), buffer (10 ... 28)
|
||||
|
||||
* PACKET_TYPE_DOUBLE 4
|
||||
|
||||
payload: number (9 ... 16)
|
||||
|
||||
* PACKET_TYPE_DOUBLE_VALUE 5
|
||||
|
||||
payload: number (9 ... 16), name length (17), name (18 ... 26)
|
||||
|
||||
## See also
|
||||
|
||||
[on data packet received](/reference/radio/on-data-packet-received),
|
||||
|
Reference in New Issue
Block a user