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

Is it possible to atomically change GAP Address and Advertising?

Hi,

is it possible to atomically change both the GAP address and the advertising message in one step? I want to broadcast two different advertising messages with each of them broadcasting a different GAP address. If this is possible I could maybe accept different Clients while knowing the reason each of them connected, directly as the connection is established.

or do you have any other ideas to find the connection reason without doing some kind of custom handshake?

Marius

  • I was running multiplexed broadcasts by switching the adv. data and I was also switching GAP address, it works well. GAP Central devices around were seeing the device as virtually two broadcasters and also connection requests were coming correctly. There are indeed limitations in adv. intervals of these two (or more) virtual broadcasters because they use only single GAP Broadcasting role in Nordic SD (so they need to use the same adv. type and also they will be effectively broadcasting with half frequency = double the interval of the "base" adv. interval provisioned in SD). You also need to remember that as soon as one connection is established you would need to restart another Peripheral role if you want to keep second virtual broadcaster in the air. And there I don't know if playing with GAP address during connection doesn't harm the link (I believe that it shouldn't because only Access address is used in LL PDUs) but that should be easy to test.

  • Sounds interesting, I am wondering weather the Softdevice might send an advertisement with a wrong address which might happen when I set the gap address and the Softdevice takes away the control via an interrupt before I am able to exchange the advertising data.

  • Theoretically yes but setting address is simple RAM register setting so it will take few clock cycles. In addition if you run advertising only then you can use radio_notification handler which will notify you before and after each radio session so you are basically 100% sure that you don't miss the event and both adv. data and address are applied together.

  • I implemented this myself now and was starting to get really fond of my implementation when I accidentially stumbled upon a devzone entry that changing the GAP address is no longer possible in SoftDevices with v3 and up. I guess that sucks.

  • Hi Marius,

    I don't know why you say it's no longer to change GAP address? The sd_ble_gap_addr_set() is still there. The only limitation is that you need to stop advertising, change the address and then start advertise again. When you have a CONNECTED event, you can call sd_ble_gap_addr_get() to know which address you are advertising with.

Related