dwm_uwb_scan_result_get (not implemented)
Reads the last scan result of the UWB network. First, the scan must be started by dwm_uwb_scan_start. The end of the started scan is communicated to the user by an event. The event can set a dedicated GPIO pin (CORE_INT) if enabled by dwm_int_set. The status flag is set when the event is generated, and the status can be read by dwm_status_get.
-
void dwm_uwb_scan_result_get(dwm_uwb_scan_result_t *result)
- Parameters
input – (none)
output – err_code, mode, rssi, [mode, rssi]
mode – ? 1 byte, unsigned integer ? (mode 0: channel=5 PRF=64 PREAMBLE_LENGTH=128 PAC_SIZE=8 TXCODE=9 RXCODE=9 STANDARD_FRAME_DELIM=0)
BAUD_RATE – 6800 PHR_EXTENDED SFD_TIMEOUT=129 SMARTPOWER=1
1 (mode) – channel=5 PRF=16 PREAMBLE_LENGTH=128 PAC_SIZE=8 TXCODE=9 RXCODE=9 STANDARD_FRAME_DELIM=0 BAUD_RATE=6800 PHR_EXTENDED SFD_TIMEOUT=129 :param SMARTPOWER=1*)
rssi – ? 1 byte, signed integer ? (UWB signal strength indication in dB)
C code example
dwm_uwb_scan_result_t result;
dwm_uwb_scan_result_get(&result);
printf("[mode,rssi]: ");
for (i: 0; i < result.cnt; ++i) {
printf("[%u, %d]", result.mode[i], result.rssi[i]);
}
printf("\n");
SPI/UART example
TLV request |
|
---|---|
type |
length |
0x24 |
0x00 |
Type 0x24 means command dwm_uwb_scan_result_get
TLV response |
|||||
---|---|---|---|---|---|
type |
Length |
Value (see error codes) |
type |
Length |
Value |
0x40 |
0x01 |
0x00 |
0x5C |
0x04 |
byte 0: mode byte 1: rssi byte 2: mode byte 3: rssi … |
0x00 0xFE 0x01 0xFD |
Type 0x5C means UWB scan result