But doesn't this violate the BLE standard? Shouldn't it be 10ms instead of 5ms?
Here is the relevant part of the spec:
126.96.36.199 Advertising Interval
The advDelay is a pseudo-random value with a range of 0 ms to 10 ms generated by the Link Layer for each advertising event.
Can someone please clarify if the chip does meet the standard or not?
If i understand truly, i have changed adv interval 0-10 ms using this code below:
HCIULP_ADV_NONCONNECTABLE_EVENT, // non-connectable undirected advertisement
16000, // adv interval 10000 msec(adv time adjusting)
HCIULP_ADV_CHANNEL_MAP_MASK, // all channels
HCIULP_PUBLIC_ADDRESS, // int advAdrType,
HCIULP_ADV_FILTER_POLICY_WHITE_LIST_NOT_USED, // int advFilterPolicy,
HCIULP_PUBLIC_ADDRESS, // int initiatorAdrType,
NULL); // UINT8* initiatorAdr
You can change adv interval using this code( 16000, // adv interval 10000 msec(adv time adjusting)).
unfortunately your example only changes the interval itself but not its randomness.
As Jacob Torres right pointed out, it is not possible to change the range of the ADVdelay. We are not violating the spec. By generating a random number in the range 0-5, we are still in the range of 0-10. The spec does not say anything about the randomness being greater than 5ms.
Also it is to be noted that the concept of ADVdelay was introduced to prevent one device from being shadowed by another device, both having the same advertising interval and started advertising at the exact same instant. So, this should not critically affect your application.