My question may seem silly, I did not so long ago been programming NRF51822 S130. I use examples experimental_ble_app_blinki. I want to get the module ID smartphone when connected. There is such a function?
My question may seem silly, I did not so long ago been programming NRF51822 S130. I use examples experimental_ble_app_blinki. I want to get the module ID smartphone when connected. There is such a function?
What do you mean "Smartphone when connected"
You mean you're going to write an app that scans for devices with a custom Device ID service and then connect to the device and read from that service ?
If all you are doing is reading the device ID, you may as well broadcast it in the manufacturer data.
I need to get the ID by the device itself. It is necessary to create a white list of smartphones in the chip. Promotional package with an ID has been the solution of problem. But it can be vulnerable to security.
So you want the device address or IRK of the smart phone so that you can advertise with whitelist in the nRF51?
I want to get an ID smartphone to build a whitelist in NRF51. When the smartphone is connected to NRF51. Nrf51 should obtain data on the smartphone is not zavismosti what application is used on your smartphone!
It depends on the address type. See this for more information.
If the central device (smart phone) uses public address or random static address you can just take the extract the address when you get the BLE_GAP_EVT_CONNECTED event, and put it into the whitelist.
If the central device (smart phone) uses a Private Resolvable address you need to bond for it to share the IRK that resolves the address.
If the central device (smart phone) uses a private non-resolvable address it doesn't really make sense to put it into a whitelist.