This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to let nRF51822 ble_app_uart never sleep?

As title, im using nRF51822 as a ble uart.(ble_app_uart)

But it will sleep when No connect for some time.

how can i turn off the sleep mode?

I want it be a "always on BLE UART" and wait for connect.

i did this

for (;;)
{
    //power_manage();
}

or this

case BSP_EVENT_SLEEP:
            //sleep_mode_enter();
            break;

but it doesnt work at all.

Parents
  • This is not a issue of sleeping. The device will sleep between advertisements etc, but wake up whenever there is work to do.

    I suspect that the problem here is that the advertising timeout is set to 180 seconds. After that it will stop advertising, and not start advertising again until you press button 2 (generating an BSP_EVENT_WHITELIST_OFF event). Note that the first 180 seconds the device will do fast advertising (using the whitelist), and other devices cannot connect until the button is clicked and ble_advertising_restart_without_whitelist() is called. You can modify the type and duration of advertisements in the code to fit your need.

Reply
  • This is not a issue of sleeping. The device will sleep between advertisements etc, but wake up whenever there is work to do.

    I suspect that the problem here is that the advertising timeout is set to 180 seconds. After that it will stop advertising, and not start advertising again until you press button 2 (generating an BSP_EVENT_WHITELIST_OFF event). Note that the first 180 seconds the device will do fast advertising (using the whitelist), and other devices cannot connect until the button is clicked and ble_advertising_restart_without_whitelist() is called. You can modify the type and duration of advertisements in the code to fit your need.

Children
Related