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.

  • i have called these API, acil_decode_evt_connected(readBuff, &(p_aci_evt.params.connected)); once i have connected with my peer device but when i read peer address p_aci_evt_params_connected.dev_addr[0] i'm getting 0 value, when read total readbuff i'm getting 70 value. can you just tell me which API can give me peer address and when should i call to read peer address.

Reply
  • i have called these API, acil_decode_evt_connected(readBuff, &(p_aci_evt.params.connected)); once i have connected with my peer device but when i read peer address p_aci_evt_params_connected.dev_addr[0] i'm getting 0 value, when read total readbuff i'm getting 70 value. can you just tell me which API can give me peer address and when should i call to read peer address.

Children
No Data
Related