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.

CC2650: How to stop BLE

Part Number: CC2650

Hello

I use the example simple_peripheral.c and i would like to stop the BLE one moment in my soft.

Is there a function to stop the BLE ?

can you kill the task ?

Or do you have other solutions ?

Thanks

  • Hello,

    If you disable/stop, or not activate, any BLE protocol operations, such as Advertising, Scanning or connections the BLE stack or radio will not be active. These operations are controlled by their respective GAP APIs.

    Best wishes
  • Hello user,
    Do you want the device to boot up and never start to advertise? If so you can simply set initialAdvertEnable to FALSE in SimpleBLEPeripheral_init. The SensorTag example show you how to set up a button to toggle advertisement state on and off. I would not recommend to "kill a task". I would rather use the built in functions and simply stop all application timers and let RTOS handle the power state transitions:
    e2e.ti.com/.../1559822
  • Hello

    No i want to have advertising in the begining then on request cut the advertinsing.
    i use this code

    u8 u8_AdvertState = 0x00;
    GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED,sizeof(uint8_t),&u8_AdvertState);

    But it does not work.

    can you help me ?

    Thanks
  • Hello user,
    When do you want to stop the advertising state?
    Where do you place this code?
  • I want stop BLE (advertinsing + disconnect device) when i push button.
    i realize a function in simple_peripheral.c

    void SimpleBLEPeripheral_StopConnexion(void)
    {
    u8 u8_AdvertState = 0x00;

    GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED,sizeof(uint8_t),&u8_AdvertState);
    //GAPRole_TerminateConnection();
    }

    and i call this function from a another task.

    Thanks
  • You need to register your new task with ICall since you are making protocol stack API calls. See the SW Developer's Guide (SWRU393). In addition, you will need to increase the value of OSAL_MAX_NUM_PROXY_TASKS in the Stack project based on the number of new ICall tasks you register.

    Best wishes