blecm_startAdv() - advInterval <= 128 not working?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Using Apps/mybeacon, I adjusted the advInterval parameter in blecm_startAdv().

For values of 256, 1024, 2048, I see this relationship when packet sniffing:

interpacket_ms = 0.625 * advInterval

However, for values of 128 or 32, interpacket_ms = 1277.  Looks like there's a minimum advInterval, between 128 and 256.

How can I set lower inter-packet times?

Also, which docs should I be reading?  I only found this function documented in Doc/API/blecm_8h.html, which gives the signature, but no explanation of the units or limits.

0 Likes
1 Solution
Anonymous
Not applicable

Hi Asher,

  Yes you are correct there are no inline comments for the blecm_startAdv() API function in blecm.h.  The only example in SDK2.0.1 where this function is used is in the myBeacon example.  In all the other examples the Adv Intervals are defined in the BLE_PROFILE_CFG structure where typically a HIGH and a LOW Advertising interval is set.  The HIGH advertising interval is what the the Adv Interval starts out at and then after a specified time defined for example by .high_undirected_adv_interval the AdvInterval then transitions to the LOW Advertising interval.  For example in the 'hello_sensor' example you have the following values that get loaded into the BLE_PROFILE_CONFIG structure...

/*.high_undirect_adv_interval=*/ 32,  // slots
/*.low_undirect_adv_interval=*/ 1024, // slots
/*.high_undirect_adv_duration=*/ 30,  // seconds
/*.low_undirect_adv_duration=*/ 300,  // seconds

So the AdvInterval starts out at 32*0.625ms = 20ms intervals for a period of 30ms 

then transitions to the

LOW AdvInterval of 1024*0.625ms = 64ms for a period of 300ms

All that being said we will need to get you some better documentation on this particular API so you can clearly understand what the variables do/are.

Regards,

Frank

View solution in original post

5 Replies
Anonymous
Not applicable

Hello asher,

Let me check on the Advertising Interval minimum for you and how to set the time.

With respect to documentation, we document the units and limits within the header files and comments in-lined in the code.

Please send me list of units that you need values for and I will explain the limits.

Thanks,

JT

0 Likes
Anonymous
Not applicable

Thanks, JT

I did not see any explanatory comment in blecm.h where blecm_startAdv() is defined.

I mentioned advInterval, in this signature.

Also, what are advAdrType and initiatorAdrType?

0 Likes
Anonymous
Not applicable

Hi Asher,

  Yes you are correct there are no inline comments for the blecm_startAdv() API function in blecm.h.  The only example in SDK2.0.1 where this function is used is in the myBeacon example.  In all the other examples the Adv Intervals are defined in the BLE_PROFILE_CFG structure where typically a HIGH and a LOW Advertising interval is set.  The HIGH advertising interval is what the the Adv Interval starts out at and then after a specified time defined for example by .high_undirected_adv_interval the AdvInterval then transitions to the LOW Advertising interval.  For example in the 'hello_sensor' example you have the following values that get loaded into the BLE_PROFILE_CONFIG structure...

/*.high_undirect_adv_interval=*/ 32,  // slots
/*.low_undirect_adv_interval=*/ 1024, // slots
/*.high_undirect_adv_duration=*/ 30,  // seconds
/*.low_undirect_adv_duration=*/ 300,  // seconds

So the AdvInterval starts out at 32*0.625ms = 20ms intervals for a period of 30ms 

then transitions to the

LOW AdvInterval of 1024*0.625ms = 64ms for a period of 300ms

All that being said we will need to get you some better documentation on this particular API so you can clearly understand what the variables do/are.

Regards,

Frank

Some correction.  When application calls

  bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, NULL);

device starts sending advertisement packets with high_undirect_adv_interval interval (in the example it is every 32 slots = 20 msec).  After high_undirect_adv_duration (30 seconds in the example) device slows down and start sending advertisements every low_undirect_adv_interval slots (1024 = 640 msec).  After low_undirect_adv_duration (in the example 300 seconds - 5 minutes).  Function registered in

bleprofile_regAppEvtHandler(BLECM_APP_EVT_ADV_TIMEOUT,
is called.  If application still wants to be discoverable it should start

  bleprofile_Discoverable(LOW_UNDIRECTED_DISCOVERABLE, NULL);

again

Anonymous
Not applicable

Thanks, Frank.  I added a BLE_PROFILE_CFG and removed the call to blecm_startAdv().  The board can now broadcast every 20 ms, which it could not with blecm_startAdv().

0 Likes