No, sorry. The link doesn't help very much.
I implemented the callback of ADV stopped.
But if I increase the duration for the ADVs to 40.000 seconds, that callback will be called every second, instead of every 40.000 seconds.
But with a duration of 30.000 seconds, that callback won't be called every second. I have not tested when he will be called, but it seems there is a maximum I the duration can be.
But I can't find that maximum for the durations.
I think what you need to do is register a callback for the advertising timeout app event and then when it is called, restart the advertising.
Here is what I do..
In connUp I stop the advertising.
In connDown, I restart the advertising
in advStopped, I restart the advertising (or set a timer to restart later).
// register connection up and connection down handler.
Based on your observations I'm going to make a wild guess that the variable in question is a signed sixteen bit integer.
In that case the maximum values would be 65535 / 2 or 32767.
A value of 40,000 would look like a negative number which might have unpredictable effects depending on what the system does with it... either takes the absolute value or assumes some default maybe.
I checked the types in the BLE_PROFILE_CFG, but the duration is defined as UINT16.
I don't know if the work other where in the software with INT16. But then the type in the BLE_PROFILE_CFG should be updated.
So I don't know if your guess with the signed sixteen bit integer is correct.
To update this thread:
userc_7511 I can confirm that your guess was correct. A few layers down the stack, these numbers are cast as signed 16 bit integers--making anything more than 32768 a negative number and an invalid input.