This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F: Change the behavior of advDelay

Part Number: CC2640R2F


Hello,

We are working with the Launchpad CC2640R2F to experiment with BLE advertisements. At this time we are interested in adjusting the advDelay. However, we have not found how to do it.

According to the Bluetooth specification, a BLE device transmit advertisements every advInterval + advDelay.

Where

advInterval is a configurable parameter

advDelay is a pseudo-random value in the range [0, 10] ms

According to the TI documentation advDelay is generated by the Link Layer for each advertisement. For example, when using the Micro BLE Stack, like in the example "micro_eddystone_beacon_cc2640r2lp_app", one can change the code in the function "ull_advSchedule" (lines 881 and/or 889).

My questions is:

Is it possible to change the random generator when using the "full BLE Stack"? For instance, in the example "ble5_simple_peripheral_cc2640r2lp_app"?

Thanks in advance,

LAMT

  • Hi,

    When using the BLE stack, you cannot modify the advDelay as you want. This is because (as you mentioned) the advDelay is "chosen" by the link-layer and the link layer's code is not public.

    With that said, the advDelay is required to be BLE compliant (BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 6, Part B, §4.4.2.2). Do you want to explain why you are trying to modify the advDelay? Maybe we can find a different way to do this?

    Kind regards,

  • Thanks for your reply.

    We are getting experimental values (collisions) that are different from our simulations. We have noticed that the implementation of random have some impact in our simulations. So we would like to check TI's implementation and possibly modify it to match ours or modify ours to match TI's.

    Is there any place where I can read the code that TI's using to generate the advDelay. How pseudo-random [0, 10] is selected? The implementation in the Link Layer is the same as in the Micro Link Layer?

    Regards,

    LAMT

  • Hi,

    One element that can have its importance: the advDelay delay comes in steps of 625us. Therefore the possible delay times are: 0ms, 0.625ms, 1.25ms, 1.875ms, ..., 9.375ms, or 10ms.

    For the rest, I cannot comment on a public forum about non-public code.

    Kind regards,

  • I understand about the non-public code.

    Then the Micro Link Layer and Link Layer implementation are slightly different.

    The uLL uses the vanilla rand(), meaning that possible values are 0ms, 1ms, ... 10ms. That is, steps of 1ms. Am I right?

    (see "micro_eddystone_beacon_cc2640r2lp_app",  function "ull_advSchedule" (lines 881 and/or 889).

    Thanks for the answer.

    Kind regards,