This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Nature of pseudo-random delay advDelay (0-10 ms) added to the advertising interval

The term advDelay is being used for the 0-10 ms random delay added to the fixed advertising interval. Since it is set by the link layer and can't be controlled by us, I want to understand the behavior of these random values. According to the BLE core specification, 

"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"

As observed through experimentation, the random values taken up by advDelay do not seem to be uniformly distributed. Most common values of advDelay seem to lie in the range 5-7 ms. I wanted to know what exactly is the probability distribution of these values? Or if there's any algorithm used to generate these values? In what sense is this delay "pseudo"-random? I could not find anything in the core specification. Any useful insight would be highly appreciated.

Regards,

Sukriti

Parents
  • Hi Gautam,

    The random number is achieved by the random number pool we maintain dynamically in the link layer which is created from NRF_RNG peripheral. The exact details of it can be implementation dependent as the application or peer does not need to know anything about the delay apart from spec saying that it should be within 10ms. Just out of curiosity, why do you need the implementation details of this delay?

  • Hi Susheel, thanks for the response. We are actually trying to advertise sensor data from multiple nodes with maximum collision avoidance. We were trying to achieve this by changing the time at which each node begins sending out advert packets. But since there already is an inherent random delay added to the advertising interval, we got stuck here because we would have to consider the nature of this delay as well. It would become a lot easier if we could model this delay mathematically. 

    Just for a bit more clarity, our application does not require the nodes to advertise continuously. An end node logs sensor data, advertises the logged data for a few seconds, goes to sleep for the next few minutes, again wakes up and logs the sensor data. The cycle repeats. This is done at each end node.

    I tried to give you an outline of what we're trying to achieve. Hope it's not very vague..

    Regards,

    Sukriti 

  • Hi Sukrit,

    It is not possible to model the adv Delay as the random seed is generated in the hardware based on many conditions that are not possible to model in firmware. Including many states within the MCU/Temperature and other factors which we cannot give details on. 

Reply
  • Hi Sukrit,

    It is not possible to model the adv Delay as the random seed is generated in the hardware based on many conditions that are not possible to model in firmware. Including many states within the MCU/Temperature and other factors which we cannot give details on. 

Children
Related