Skip to main content
Associate II
September 22, 2025
Question

How to periodically turn on and off the BLE advertising on the STM32WBA5CG?

  • September 22, 2025
  • 0 replies
  • 262 views

Hello, I'm very new to BLE. I'm following STM example code.

I want to be able to run on battery and turn on the BLE to advertise for 5 minutes then stop. After an interrupt, I want to be able to turn on advertising again.

In the STM32WBA Bluetooth® LE – Serial communication - stm32mcu Example, i found in main while loop, there is  MX_APPE_Process(); which initiates BLE. 

I want to implement something like:

switch (...) {

    case 0: // walking

            MX_APPE_Process();
    case 1: // stationary
            // Turn off advertising
}
How should I do. Please support me.