1

Problem with ble_advertising_restart_without_whitelist

sonja gravatar image

asked 2017-09-12 18:10:19 +0100

I have a problem using ble_advertising_restart_without_whitelist(). According to the documentation (as I understood) it should start advertising without whitelist even if a whitelist exists (hence it skips BLE_ADV_EVT_WHITELIST_REQUEST). In the next call of ble_advertising_start() advertising should use the whitelist again. But in my application it's not the case, BLE_ADV_EVT_WHITELIST_REQUEST is skipped when calling ble_advertising_start() if ble_advertising_restart_without_whitelist() has been called once before.

So the sequence is:

  • load previously bonded peers from flash and add them to the whitelist of the peer manager
  • ble_advertising_start(BLE_ADV_MODE_SLOW) starts BLE_ADV_EVT_SLOW_WHITELIST
  • ble_advertising_restart_without_whitelist() starts BLE_ADV_EVT_SLOW
  • a bonded peer is connected and then disconnected
  • ble_advertising_start(BLE_ADV_MODE_SLOW) is called and triggers BLE_ADV_EVT_SLOW instead of BLE_ADV_EVT_SLOW_WHITELIST

Do I misunderstand the documentation or am I missing something?

My goal is to have an application that is always whitelist advertising (no timeout) for bonded peers and starts "public" advertising only on request (with a certain timeout). How can I switch easily between public and whitelist advertising? Deleting the whitelist on "public" advertising request always returns errors (BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE & BLE_ERROR_GAP_WHITELIST_IN_USE). And what is this device identities list anyway?

Thanks!

edit retag flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
0
Petter gravatar image

answered 2017-09-13 13:06:18 +0100

m_whitelist_temporarily_disabled is set to true when you call ble_advertising_restart_without_whitelist()

and is set to false when on_disconnected() is called.

So calling ble_advertising_start() wouldn't set m_whitelist_temporarily_disabled to false.

Seems the library is missing a ble_advertising_restart_with_whitelist(), maybe you can try to implement that functionality yourself.

edit flag offensive delete publish link more

Comments

1

I didn't call on_disconnected (advertising event handler)...

Thanks!

sonja ( 2017-09-14 10:51:02 +0100 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower

Stats

Asked: 2017-09-12 18:10:19 +0100

Seen: 77 times

Last updated: sep. 13