Dear Sir,
I am new in nRF51 and used the ble_app_uart example in our application (nRF51), need power saving function but not necessary power off.
The sample code will power off nRF51 as below, and only can wakeup by pressing button.
static void sleep_mode_enter(void)
{
uint32_t err_code;
err_code = bsp_indication_set(BSP_INDICATE_IDLE);
APP_ERROR_CHECK(err_code);
// Prepare wakeup buttons.
err_code = bsp_btn_ble_sleep_mode_prepare();
APP_ERROR_CHECK(err_code);
// Go to system-off mode (this function will not return; wakeup will cause a reset).
err_code = sd_power_system_off();
APP_ERROR_CHECK(err_code);
}
-
How to change code so that the device will enter sleep mode (not necessary power off )when there is no UART /BLE activity after 30 seconds even in the connected state and can wakeup when UART exists activity even in the disconnected state ? (received data from UART port)
-
How to handle the input data of UART that wakeup device ? must skip ? or data will keep in buffer without lost or fragment .
-
How to let host APP to know device been wakeup/enter sleep during connect state ?
-
Or other method which can wakeup device from UART activity ?
Can provide example will much helpful.
Thanks in advance.