Advertising Failure After Multiple Pairing Requests and Cancels

Hello everyone,

I'm using the Bluetooth Peripheral sample UART and have noticed an issue.

When I perform a lot of sequential pairing requests followed by cancels from my phone to my device, after around 3 or 4 requests/cancels, it stops advertising.

Is this normal behavior?

How can I handle it? Is there any function to get the current status of advertising? Otherwise, is it okay to call this function one more time in the disconnection callback?

This function is called only once in the main.

err = bt_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));

but even with re-calling this function in Disconnected callback, it gives no error :( but the device is not showing in my phone

I would really appreciate your help in this matter!

Thanks in advance.

Iheb

Parents
  • Hi, 

    I'm using the Bluetooth Peripheral sample UART and have noticed an issue.

    I think it's Bluetooth: Peripheral UART

    How can I handle it? Is there any function to get the current status of advertising? Otherwise, is it okay to call this function one more time in the disconnection callback?

    This function is called only once in the main.

    I cannot reproduce this. One possible situation is you press "pair" on the phone unaware, and then the device is waiting for your confirmation by the button. During that period, the device will not advertise until the confirmation timeout. Then, it will disconnect and restart to advertise. You can check the RTT log. 

    Regards,
    Amanda H.

  • Actually, what exactly happens is this:

    When I open Bluetooth on my Android and search for the device to pair, I find it.

    I click on it and then hit "pair," then I cancel the ongoing request through the Android device.

    I keep doing this quickly in a row without stopping (like spamming the device with quick pair requests and cancellations).

    After a certain amount of time, I don't find my device publishing its advertising frames anymore.

  • Yes, I know about the timeout, but when hitting "cancel" from Android, normally it doesn't need the timeout anymore..Or do you mean by doing that spam the device accumulates the timeout ?

Reply Children
No Data
Related