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

how to get peer device address(Android/iOS)?

`Hi Guys, My project requirement is that first time i have to bond and connect my nRF8001 BLE with peer device, once connected i have to find peer device address, after finding peer address i have to store the address, so i have to make sure that only one peer device should connect with nRF8001. One peer device for one nRF8001. No other peer device should connect.

Now i need to know how can i have peer device address? what is the command which tells me my peer device address. If anyone can help me it will be very helpful. My peer device can be Android/iOS phone.

regards, gbiradar `

Parents
  • The peer address is provided in the connection event. However, if you are already bonded with a device using a static address a whitelist will be enabled by default. For devices using a resolvable private address the whitelist is disabled. Resolving the private address so you can choose to disconnect from unknown devices using a random private is possible, but can be complicated. So an option could be to simple start a timer to disconnect the peer in case the bond is not re-esthablished within a given time.

  • hi run_ar, thanks for your reply, actually i'm trying to add a security feature that my nRF8001 board should connect with only one peer device whose address i'm going to store once it is bonded first time and no other peer device should connect. Now i have checked that ConnectedEvent(0x85) in which content peerAddress is available. can i call acil_decode_evt_connected API to read peer device address after connection. one more thing how can i find whether it is static address. As i have gone through in forum random peer address it is mention that latest android phones are using random address.

Reply
  • hi run_ar, thanks for your reply, actually i'm trying to add a security feature that my nRF8001 board should connect with only one peer device whose address i'm going to store once it is bonded first time and no other peer device should connect. Now i have checked that ConnectedEvent(0x85) in which content peerAddress is available. can i call acil_decode_evt_connected API to read peer device address after connection. one more thing how can i find whether it is static address. As i have gone through in forum random peer address it is mention that latest android phones are using random address.

Children
No Data
Related