2022-09-14 06:58 AM
Hello,
When I try to set advertisement delay more than 10000ms, the function aci_gap_set_advertising_configuration return an error 0x82 (BLE_STATUS_INVALID_PARAMS).
According to the function declaration, it must be ok:
/*
....
* @param Primary_Advertising_Interval_Min Minimum advertising interval for
* undirected and low duty cycle directed advertising. Time = N * 0.625
* msec.
* Values:
* - 0x00000020 (20.000 ms) ... 0x00FFFFFF (10485759.375 ms)
* @param Primary_Advertising_Interval_Max Maximum advertising interval for
* undirected and low duty cycle directed advertising. Time = N * 0.625
* msec.
* Values:
* - 0x00000020 (20.000 ms) ... 0x00FFFFFF (10485759.375 ms)
...
*/
Here is my function:
BLE_ConfigureDeviceAdvertising(uint32_t adv_interval)
{
ret = aci_gap_set_advertising_configuration(0, GAP_MODE_GENERAL_DISCOVERABLE,
ADV_PROP_CONNECTABLE|ADV_PROP_SCANNABLE|ADV_PROP_LEGACY,
(adv_interval*1000)/625,(adv_interval*1000)/625,
ADV_CH_ALL,
PUBLIC_ADDR,NULL,
ADV_NO_WHITE_LIST_USE,
0, /* 0 dBm */
LE_1M_PHY, /* Primary advertising PHY */
0, /* 0 skips */
LE_1M_PHY, /* Secondary advertising PHY. Not used with legacy advertising. */
0, /* SID */
0 /* No scan request notifications */);
...
}
Do you have some idea?
Thank you
Solved! Go to Solution.
2022-09-15 01:07 AM
Hi @jbie ,
Agree maximum is not exactly 10sec (this is a common language we used).
Maximum allowed according to BT core spec is 10.24sec for the legacy advertising you are using.
See : BT core spec 5.2 - §7.8.5 : LE Set Advertising Parameters command
The 10,485 value you are mentioning refer to the "extended advertising".
Coming back to your point, this maximum of 10.24sec is indeed supported by BlueNRG-LP stack in accordance with BT core spec.
You can test ADV_interval = 16384 (10.24sec = 16384*0.625)
You can check our "Beacon example" from SDK for more details.
Regards,
Sebastien.
2022-09-14 09:40 AM
Hi @jbie ,
This is expected behavior considering 10sec is the maximum advertising interval allowed by Bluetooth spec.
Regards,
Sebastien.
2022-09-14 11:09 PM
Edit: Response not correct
I understand.
But is there any way to bypass this limitation ? I want to make a very low power device.
The BLE link will not be with a smartphone but another proprietary device.
Regards,
Jean
2022-09-15 12:06 AM
Hi @jbie ,
As BlueNRG-LP is a certified Stack => by default you can not extend advertising interval outside BLE spec (between 20msec and 10sec)
Using timer (or VTimer), you may stop/start advertising. That could be valid alternative.
Regards,
Sebastien.
2022-09-15 12:09 AM
Hello Sebastien,
There is an interpretation error from ST. The Core spec 5.2 says 10485 seconds and not 10 seconds.
Regards,
Jean
2022-09-15 01:07 AM
Hi @jbie ,
Agree maximum is not exactly 10sec (this is a common language we used).
Maximum allowed according to BT core spec is 10.24sec for the legacy advertising you are using.
See : BT core spec 5.2 - §7.8.5 : LE Set Advertising Parameters command
The 10,485 value you are mentioning refer to the "extended advertising".
Coming back to your point, this maximum of 10.24sec is indeed supported by BlueNRG-LP stack in accordance with BT core spec.
You can test ADV_interval = 16384 (10.24sec = 16384*0.625)
You can check our "Beacon example" from SDK for more details.
Regards,
Sebastien.
2022-09-15 01:18 AM
Hello Sebastien,
Thank you for the precision.
Regards,
Jean
2024-12-11 12:15 AM
Hello @Sebastien DENOUAL ,
I have another question related to this topic.
Do you have a maximum duration of advertisement ?
I want to do a very low power device, so I have an advertisement every 10 seconds for an infinity amount of time.
After around 2.5 hours (900 advertisements), the Bluetooth stops advertising. Do you have any idea ?
Regards,
Jean