This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Frequency hoping sequence - is it really random?

In my application many nodes (acting as centrals) will start simultaneously, as they have common power supply. I am using s132 SoftDevice (4.0). Is the frequency hoping sequence initalized with true random value (how? when?), or is it fixed to some predetermined value (what?). I would like to avoid situation, where all my central devices have the same frequency hoping pattern. Do I have to use some specific API function to set frequency hoping start frequency? Do I have any control over the frequency hoping seqnence?

  • Hi,

    The current Channel Selection Algorithm, called Channel Selection Algorithm #1, is defined as:

    unmappedChannel = (lastUnmappedChannel + hopIncrement) mod 37
    

    and if unmappedChannel lands within a unused channel (limited with channel map), it shall remap like this:

    remappingIndex = unmappedChannel mod numUsedChannels
    

    and it then selects a channel from the available channels only. lastUnmappedChannel is then updated to whatever was the chosen channel.

    hopIncrement is set by the master when it connects. The current S132 4.0 will choose a random value for the hop when acting as a master. If, for whatever reason, a random value is not available at the time, it will be set to something static. But that should not generally be a common occurrence.

    Side-note: There is also a Channel Selection Algorithm #2 defined in Bluetooth 5, which is based on access addresses instead. That one is a bit more effective when used with channel maps. If you have any questions or requests about future SoftDevices, don't hesitate to contact your regional sales representative. PM me with your location if you do not know who this is.

Related