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.

LAUNCHXL-CC1352R1: BLE advertisement

Part Number: LAUNCHXL-CC1352R1

Hello,

I am using 15.4_DMM_Sensor_oad code (SDK 4.20). I want to start the BLE advertisement on button press. But when I use the GapAdv_enable API in ssf.c it doesn't seem to respond.

I also tried a couple of other things and managed to do it using flags. But, is there any graceful way to do that?

Also, I want to advertise only for a certain amount of time and after that disable the advertisement. I tried to use the already provided Util_constructClock function but the code gets stuck and the node is orphaned after a few seconds. What could be the reason for that and any help on how I can achieve it?

Any help is appreciated.

Thanks and Regards,
Yash

  • HI Yash,

    Whenever you want to issue BLE related APIs, this need to be done for an ICall registered thread/task. Unless you have explicitly done this yourself, the TI15.4 task is not ICall registered. If you do not do this then you will likely get the device stuck in an error state at some point.

    I would suggest you use the "event" approach where you from the ssf.c post an event for the BLE main thread to handle, leaving the enable/disable up to the BLE application.

  • Hello MW,

    Thank you for your response.

    I actually did it the same way as you suggested (took the reference from "RemoteDisplay_updateSensorData" used in sensor.c).

    I call a function on button press which in turn calls RemoteDisplay_enqueueMsg(Event, NULL); and this strikes the registered case statement. But the problem occurs when I use the API - GapAdv_enable(advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_DURATION, 1000); in the registered case statement.

    The sensor falls out of the network and rejoins the Collector. Sometimes it just gets stuck and Sensor doesn't respond hence showing "!Responding" on the Collector terminal.

    Any ideas on the observed behavior?

    Thanks and Regards,

    Yash.

  • Hi Yash,

    Could you provide some code snippets showing what you do exactly? That would really help me give feedback to what might be happening/going on. Even better if you could share the full project with some instructions on how to reproduce the issue and I could have a closer look at it.