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.

CC2340R5: Change the advertisement period.

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I’m using basic_ble and by default the CC2340 advertise every 100ms.
the advertisement period is too low, and I want to increase it to 30 seconds.
I searched in sysconfig file and I was able to find an option to change the advertisement time and changed it to 30 seconds.

  1. i want to know what happen between each advertisement (30 seconds) ? is the CC2340 goes to sleep ? because my board is powered by a battery and I’m concerned about the power consumption.

  2. I want to modify the advertisement period inside the code during the runtime. For example, I set the initial advertisement to 30 seconds and then later the CC2340 can decide to change the advertisement period to 1 minutes or 2 minutes depend on different parameters. Don’t know what’s the best way to do it ? because for now the only way I can do it is through sysconfig.

    if I was working without FreeRtos, I would set a timer to trigger every 30 seconds and inside the timer interruption I force the IC to advertise for a second and then go to sleep until the next timer interruption (and so on). And If I want to change the period during the runtime, all I do is to change the timer timeout to 1 minutes or 2 minutes...
    What is the best approach to have a similar behavior using FreeRTOS (thread/task)?

  3. How can I change the advertisement data ? I need to add extra data on the advertisement packet. Can you point me please where in the code I can do it ?

Thanks,

  • Hi,

    i want to know what happen between each advertisement (30 seconds) ? is the CC2340 goes to sleep ? because my board is powered by a battery and I’m concerned about the power consumption.

    If the device is not in a connection and from a BLE perspective, the device is only advertising, then the device should go to the lowest power mode possible. If no other driver is keep the device active or idle, then the device should go to standby.

    I want to modify the advertisement period inside the code during the runtime. For example, I set the initial advertisement to 30 seconds and then later the CC2340 can decide to change the advertisement period to 1 minutes or 2 minutes depend on different parameters. Don’t know what’s the best way to do it ? because for now the only way I can do it is through sysconfig.

    if I was working without FreeRtos, I would set a timer to trigger every 30 seconds and inside the timer interruption I force the IC to advertise for a second and then go to sleep until the next timer interruption (and so on). And If I want to change the period during the runtime, all I do is to change the timer timeout to 1 minutes or 2 minutes...
    What is the best approach to have a similar behavior using FreeRTOS (thread/task)?

    This can be done during runtime by using GapAdv_setParam() function. The Scanning and Advertising Basic SimpleLink Academy lab walks you through this process and provides valuable information on how to change any parameter during runtime.

    How can I change the advertisement data ? I need to add extra data on the advertisement packet. Can you point me please where in the code I can do it ?

    The lab linked above also provides information for how to do this. The data may be changed in Sysconfig and during runtime.

    Best Regards,

    Jan