Hello,
I am developing a product based on the CC1352R using the 4.40.04.04 SDK. This design needs to send two legacy advertisement beacons simultaneously, one of which may be updated each measurement interval.
I have encountered strange behavior where one of the beacons may not be transmitted, depending on how the advertisement interval aligns with the moment at which the scan response data is updated.
Design:
- Beacon #1
- 1 second interval
- scannable and connectable
- Beacon #2
- 1 second interval
- Task #1
- Based on remote_display.c
- Creates and starts both beacons
- Task #2
- Updates scan response data for Beacon #1 at a 1-second interval using GapAdv_prepareLoadByBuffer and GapAdv_loadByBuffer as described here: https://software-dl.ti.com/simplelink/esd/simplelink_cc13xx_cc26xx_sdk/5.30.00.56/exports/docs/ble5stack/ble_user_guide/html/ble-stack-5.x/gap-cc13xx_cc26xx.html#update-advertising-scan-response-data-that-is-used-for-multiple-advertising-handles
With the above configuration, Beacon #1 is not transmitted (but Beacon #2 is). I can "fix" the problem and get Beacon #1 to transmit in a couple ways:
- Reduce the interval for Beacon #1 to 950ms
- Remove calls to GapAdv_prepareLoadByBuffer and GapAdv_loadByBuffer (update the scan response data blindly)
This leads me to believe that updating the scan response data in sync with the advertisement interval is causing problems. Hypothesis:
- Task #2 calls GapAdv_prepareLoadByBuffer just prior to the advertisement interval for Beacon #1, which prevents Beacon #1 from being sent in that interval.
- Task #2 calls GapAdv_loadByBuffer and an advertisement is scheduled for the next interval (1 second later)
- Task #2 sleeps for 1 second
- Repeat
Please tell me: How can I update the scan response data periodically without preventing beacons from being transmitted?
----
I have managed to reproduce this issue using the latest Simple Broadcaster example from the CC13xx 6.20.0.29 SDK. I made minor changes to main.c, simple_broadcaster.c, and simple_broadcaster.syscfg:
simple-broadcaster-modified-files.zip
If you copy the modified files into your project, you should find that your device sends only one beacon.
If you disable updates to the scan response data by commenting out Task_create(mainTaskFxn, &mainTaskParams, NULL); in main.c, both beacons will be transmitted.
What am I doing wrong?