nRF52840 port extends OpenThread Diagnostics Module.
New commands allow for more accurate low level radio testing.
diag listen and diag transmit use radio frame payload specified below.
struct PlatformDiagMessage { const char mMessageDescriptor[11]; uint8_t mChannel; int16_t mID; uint32_t mCnt; };
mMessageDescriptor
is constant string "DiagMessage"
.
mChannel
contains channel number on which packet was transmitted.
mID
contains board ID set with diag id command.
mCnt
is a counter incremented every time board transmits diagnostic radio packet.
If listen mode is enabled and OpenThread was built with DEFAULT_LOGGING
flag, JSON string is printed every time diagnostic radio packet is received.
{"Frame":{ "LocalChannel":"<listening board channel>", "RemoteChannel":"<mChannel>", "CNT":"<mCnt>", "LocalID":"<listening board ID>", "RemoteID":"<mID>", "RSSI":"<packet RSSI>" }}
Get board ID.
Set board ID.
Value range 0 to 32767.
Default: -1
.
Get listen state.
Set listen state.
0
disable listen state.
1
enable listen state.
Default: listen disabled.
Get messages count and interval between them that will be transmitted after diag transmit start
.
Set interval in ms between transmitted messages.
Value range 1 to 4294967295.
Default: 1
.
Set number of messages to be transmitted.
Value range 1 to 2147483647
or
-1
continuous transmission.
Default: 1
Stop ongoing transmission regardless of remaining number of messages to be sent.
Start transmiting messages with specified interval.