How nRF Connect SDK gets MAC addresses

Hello, i have question: How nRF Connect SDK gets MAC addresses

Steps:

1. I build android ble peripheral app and starting advertaising. When i did it, MAC address alwalse random generate. (name peripheral = BIBKA, MAC address = 62:1E:6E:6C:48:E9) 


2. When connected, I check for the presence of a bond, if it is not, I start bonding.


    START BOUN SCREEN

3. If bonding not success -> i disconnect cental 

4. for example, i accept all and nRF Connect remember  the random MAC address for my peripheral. All right i can usage BIBKA.

5. I'm stopping advertising and close apk off bluetoorh in my android peripheral

6. When i start apk again and start advertising, `BIBKA` random MAC address has been changed (now = 72:A3:A1:E7:56:25) but in `nRF Connect SDK` BIBKA MAC address still the same and `nRF Connect SDK` can connect to BIBKA using the old MAC address without bonding.



question: How it works? How `nRF Connect SDK` can connect usage old random address?

When i deleted bond information, `nRF Connect SDK` show correct MAC address and now when i connect to BIBKA i need do bonding


DEL BOND SCREEN

I need to know this for BLEcentral development, which will also be able to connect to an old peripheral MAC address. (now my BLEcentral always do bonding when i restart app)



  • Are you using a private resolvable address on your peripheral? if so I assume the central is using the IRK to identify the device. Could also be that it connects to any device that advertises the correct services, but in this case I guess you click what device to connect to? As for bonding that is using EDIV and RAND to fetch the keys from the data base and once connected the address doesn't really have any function.

Related