DWM1001 Listener C Code

Hi all!

I have written some C code in User Application thread that configures our DWM1001 Dev device as an anchor in passive mode (Listener). When I enter the ‘les’ command over UART shell mode, the location engine data from my tag device is outputted just fine.

What I want is to not have to send the ‘les’ command to start receiving the location of my tag device, but rather I would like to write some C code in the User Application that starts outputting that data as soon as it is available from a tag device on the same PAN network.

I have tried to use ‘dwm_loc_get()’ from my listener device, but the x, y, z, qf values just remain 0, 0, 0, 0.
Is this the correct method to achieve location data from my Listener device?

Many thanks in advance!

Maybe this one helps

dwm_loc_get description: “Get last distances to the anchors (tag is currently ranging to) and the associated position. The
interrupt is triggered when all TWR measurements have completed and the LE has finished. If the LE
is disabled, the distances will just be returned. This API works the same way in both Responsive and
Low-Power tag modes.” Page 53 of the DWM 1001 Firmware API Guide.

les description, page 99 (same document as before): “Show distances to ranging anchors and the position if location engine is enabled. Sending this
command multiple times will turn on/off this functionality.”

I have read both of those descriptions from DWM1001 Firmware API Guide and they haven’t made anything clearer.

The ‘les’ command isn’t really useful to me on the Listener device, as I don’t want to enter UART shell mode. I just want the listener to start reporting the tag location as soon as the tag is turned on.

From that desciption you mentioned, ‘the interrupt is triggered when all TWR measurements have completed and the LE has finished…’ I am unsure what interrupt event is being called when this happens on a Listener device - but that is exactly what I need.
Any idea on which event handler is responsible for dmw_loc_get?

Thanks for the reply :slight_smile:

Hi Ryan,

the Listener mode in PANS is a kind of demo feature which became in the end too famous that people try all kind of tricks to use it.

It does not provide the captured position of the Tags via API except via the ‘les’ command and via BLE API (so the Tags can be seen using DRTLS Android Manager). The reason of creation of this feature was because most of Android devices cannot handle reliably more than 4 concurrent BLE connections.

So what you try to do is not possible. One potential solution is to use the API of the device in Bridge mode but as far as I know its API is not documented. Some people have reported however successful reverse engineering of those undocumented APIs so you can give a try. Don’t ask me how though :slight_smile:

Cheers,
TDK

1 Like

Thanks for the message TDK!

Yes, I am slowly understanding the many limitations of the PANS firmware. :frowning:

Thank-you for a definitive answer on the Listener API problem! I have been searching many forum posts for information on this topic and you are the first person to say that ‘les’ command does not have an API counterpart.

The listener device is just needed for demonstration and testing purposes - so we don’t have to remain tethered to our tag device. I guess I can do one of the following :thinking::

  1. Send ‘les’ command to the listener from my PC application, via UART.

  2. Reverese engineer the bridge mode API as you said :smiley:

One last question:
If I wanted to create custom firmware for the DWM1001 Dev board, which example code would I start with?

Thank-you very much!
Ryan.