dwm_anchor_list_get
Reads the list of surrounding anchors and works for anchors only. Anchors in the list can be from the same network or neighbor network.
-
void dwm_anchor_list_get(dwm_anchor_list_t *list)
- Parameters
input – (SPI/UART) ‘0’ | ‘1’(page number (only on SPI/UART, the user application reads whole list in 1 call), valid numbers are 0,1)
input – (user application) (none)
output – Status code, cnt, {node_id, position, rssi, seat, neighbor_network}
cnt – ? 1 byte? (element count, 15 is maximum for SPI/UART, 30 is maximum for user application)
node_id – ? 2 bytes ? (anchor ID)
position – ? 12 bytes ?
rssi – ? 1 byte signed? (signal strength indicator)
seat – ? 5 bits ? (seat number occupied by the anchor)
neighbor_network – ? 1 bit ? (status flags that indicates if anchor is from current network or if it is from neighbor network)
C code example
dwm_anchor_list_t list;
int i;
dwm_anchor_list_get(&list);
for (i:0; i < list.cnt; ++i) {
printf("%d. id=0x%04X pos=[%ld,%ld,%ld] rssi=%d seat=%u neighbor=%d\n", i,
list.v[i].node_id,
list.v[i].x,
list.v[i].y,
list.v[i].z,
list.v[i].rssi,
list.v[i].seat,
list.v[i].neighbor_network);
}
SPI/UART example 1
TLV Request |
||
---|---|---|
Type |
Length |
Value |
0x0B |
0x01 |
0x00 |
Type 0x0B means command dwm_an_list_get
TLV Response |
||
---|---|---|
Type |
Length |
Value (see error codes) |
0x40 |
0x01 |
0x00 |
TLV response (residue of the frame from previous table) |
|||||||
---|---|---|---|---|---|---|---|
** type** |
le ngth |
v alue |
|||||
0x56 |
0xE1 |
u int8_t - number of el ements e ncoded in the Value |
uint16 _t - UWB addres s in little endian |
3 x in t32_t: po sition coord inates x,y,z in little endian |
int8_ t - RSS I |
u int8_t - (bits 0-4) seat number (bit 5) neighb or_net work (bits 6-7) re served |
… |
0x0F |
anchor nr. 1 |
nr. 2 … nr. 15 |
SPI/UART example 2
TLV Request |
||
---|---|---|
Type |
Length |
Value |
0x0B |
0x01 |
0x01 |
Type 0x0B means command dwm_an_list_get
TLV Response (anchor list is empty) |
|||||
---|---|---|---|---|---|
Type |
Length |
Value (see error codes) |
Type |
Length |
Value |
0x40 |
0x01 |
0x00 |
0x56 |
0x01 |
uint8_t - number of elements encoded in the Value |
0x00 |