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
  • Nordic SD API doesn't support setting different MAC addresses for different roles/connection links if they are used in parallel. So all these will have the same MAC address. Don't worry that they would get mixed in the air, there is something called Access Address generated for every connection and that is actually used by Link Layer so that is fine. If you want to pretend to be advertising as multiple GAP Peripherals (= different MAC for each of these different packets) Then you have small problem because this is missing in Nordic SD as of now. If you are only advertising you can use radio_notification API and change Adv. and Scan Resp. data together with MAC (GAP address) before every packet so your device will appear as several advertisers with N-times longer intervals. But once this is mixed with established Peripheral or Connection link it's almost impossible to rotate address correctly so you would need to solve it differently (e.g by going with custom or open source stack).

  • That's the problem, I find your code correct. Can you paste just one example of MAC you read from beacon advertisement and MAC you read from this printf?

Reply Children
No Data
Related