This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF840 - S140 : How to fetch MAC addresses of surrounding mobile devices during nRF52840 scanning using Bluetooth 5.

Hello Nordic Team,

We are using nRF52840 ble chip with S140 nordic stack and SDK 15.2.0 on the  SEGGER IDE installed on  the Windows OS. We want nRF52840 chip  to detect surrounding mobile devices and also nRF52840 can fetch MAC addresses of mobile devices during scanning. We would like to know from your side that whether this is feasible or not ?. If yes, then can you please suggest us how to do it.

We are looking forward to hear from you.

Thanks
Bharat Gopani
Lumium Design
India.

  • If you use whitelist scanning, then this can be handled by the AAR peripheral, but it would filter out any other advertising packets, so this is probably not what you want if I understood your use case correct (track any BLE advertisers in range). Therefor you probably want to use pm_address_resolve(), and iterate over all IRK you have in the list of bonded devices. You can get a list of all bonds using pm_peer_id_list().

  • Thanks for the reply.

    IRK for bonded device is fixed or variable  ??

    Can you please tell us more about working of resolving process using  these  functions pm_address_resolve() and pm_peer_id_list().

    If possible, can you please share the document related to this procedure.

    Regards

    Bharat

  • Hi,

    Bharat said:
    IRK for bonded device is fixed or variable  ??

    The IRK is typically fixed for the lifetime of a device. It is possible to change it, but in that case any already bonded devices will not be able to resolve the address any more (since it is derived from a new IRK that is different from what they got during the bonding procedure).

    Bharat said:

    Can you please tell us more about working of resolving process using  these  functions pm_address_resolve() and pm_peer_id_list().

    If possible, can you please share the document related to this procedure.

    We do not have any documentation that describes it, but it is quite straight-forward:

    1. Get the MAC address you want to resolve (typically from a advertising packet in this case).
    2. Check that the MAC address type is a private resolvable address. If no, then just use the MAC address as is. This is indicated by the most significant bits in the address.
    3. If the MAC address is resolvable, iterate over the IRK's you have by using pm_peer_id_list(). Call pm_address_resolve() with the MAC address you want to resolve and a IRK, and iterate through the list of IRK's until you get a match or the end of the list. If you get a match, stop as you have already resolved it. If you don't get a match you know that this address was derived from an IRK which you don't have, so you cannot resolve it.
  • Thanks for the reply.

    Can we use S132 SoftDevice  for the  nRF52840  as we are planning to use it on the Arduino IDE  since we could not find S140 SoftDevice for the Arduino IDE.

    Regards

    Bharat

  • Hi Bharat,

    Using the S132 on the nRF52840 is not recommended or supported. We do not test it, nor does it support any of the additional features of the nRF52840. Lastly it is not Bluetooth qualified together with the nRF52840.

Related