This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Different MAC address for different GAP roles

I am using a nrf52832 Development Board with s132 for some BLE applications. I developed a beacon app, set for BLE peripheral, and every reading of the advertising from this app gives me its MAC address.

Now I am developing a gateway app, set for BLE central. This app will read the advertising from beacons and send a package via uart. This package will include also the gateway MAC. I am using the same board for the gateway, and for the beacons I am using some other hardware I have. To include the gateway MAC address in this package I used sd_ble_gap_address_get(), expecting the same MAC as I have when I use the beacon app for this board. However I get another address for the gateway app.

Is it expected to have different MAC addresses for different GAP roles (peripheral and central) for the same board or is sd_ble_gap_address_get() giving me a wrong MAC address for some reason?

Thank you

Parents
  • Hm, wouldn't it be better to initiate local_addr as array like local_addr[6] and maybe set it to zero by memset to be sure it's initialized? Also is sd_ble_gap_address_get function call returning success? Finally I know nothing about your printf function and I hope problem is not there. Maybe setting another local byte array variable to some dummy value like 0x112233445566 and printing it out the same way to have control test all is working as we expect?

Reply
  • Hm, wouldn't it be better to initiate local_addr as array like local_addr[6] and maybe set it to zero by memset to be sure it's initialized? Also is sd_ble_gap_address_get function call returning success? Finally I know nothing about your printf function and I hope problem is not there. Maybe setting another local byte array variable to some dummy value like 0x112233445566 and printing it out the same way to have control test all is working as we expect?

Children
No Data
Related