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.

  • Hi Einar,

    Thank you very much for your inputs.

    Can we get IRK key from smart phone directly without bonding with nRF52840  ??

    In our application, nRF52840 is connected to Raspeberry pi controller using UART. We are using nRF52840  for authentication purpose only.

    Now, We are able to resolve address using peer manager  but we are having concern that how Raspeberry pi controller can decide who is authenticated mobile or not. For that we can put authenticated IRK list in the software so that when rasprberry pi controller receives IRK from nRF52840, it can compare with the predefined list and take the decision.

    Is this possible or not ?  if not can you please suggest any other alternatives for the same ?

    Regards

    Bharat

  • Hi Bharat,

    Bharat said:
    Can we get IRK key from smart phone directly without bonding with nRF52840  ??

    I am not aware of any way of obtaining the RK from smart phones (iOS or Android) without bonding.

    Bharat said:
    Is this possible or not ?  if not can you please suggest any other alternatives for the same ?

    This is application specific and I do not have a full overview of your application. It is possible to transfer the list of IRK's and MAC address when scanning to the RPi. From my perspective it does not matter much if you resolve the IRK on the nRF and report back to the RPi if it is known or not, or if you send both the IRK and MAC to the RPi. The advantage of doing it on the nRF is perhaps that you have it working already using the Peer manager, so it might save you some time. On the other hand, it might give you more flexibility to do it on the RPi, but I cannot say which is more sensible.

  • Hello Einar,

    Our application needs that when address is not resolved at that time nRF52840 must be  able to disconnect with smart phone.

    we are using function sd_ble_gap_disconnect in the ble_evt_handler with the case BLE_GAP_EVT_CONNECTED  , however when  this function executes, it disconnects with smart phone and it gives following error.

    Error 8 [NRF_ERROR_INVALID_STATE]

    Fatal error and System Reset.

    Can you please suggest us possible reason behind this ?

    Regards

    Bharat

  • Hi Bharat,

    The sd_ble_gap_disconnect() function will return NRF_ERROR_INVALID_STATE if there is no active connection. See sd_ble_gap_disconnect()  API doc for details. If you know that you have an active connection, then the reason could be that the conn_handle you have provided is not for the connection you indented.

    The fact that the system is reset is just due to the error handling in your application. The SDK error handler in the SDK examples reset by default on any error, unless you have built the application with DEBUG defined (for instance by selecting the Debug build configuration if you are using SES). This is because resetting is often a sensible way to recover from an error that should not have occurred.

  • Hi Einar,

    Thanks for the support.

    Can we differentiate between process trying to connect with nRF52840 is from nRF Connect application or from bluetooth pairing on the smart phone at time of  event ble_gap_evt_connected().

    Our application requires  decision  whether user is trying to connect from nRF Connect App or bluetooth settings(pairing or bonding)  in the phone.

    Regards

    Bharat

Related