Hi...
Sorry if the question is simple.. but Im stuck....
Im using 52840 + SDK 15 + SD 6.0.0
Im starting with Ble_uart_app..
I added some function of when it connected to cellphone the device sends some information to cellphone.. that is ok..
When the Advertising is stop by BLE_ADV_EVT_IDLE: the device go to sleep_mode (NO power off mode)
static void sleep_mode_enter(void)
{
uint32_t 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);
Prepare_NFC_Wake_up();
// 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);
}
When I near NFC card to the device, the device is Turn on Again... it is OK..
void NFCT_IRQHandler(void)
{
if (NRF_NFCT->EVENTS_FIELDDETECTED == 1)
{
Prepare_NFC_Turn_off();
NRF_NFCT->EVENTS_FIELDDETECTED = 0;
NRF_LOG_INFO(" *************** Turn On By NFC ***************\r\n");
NRF_LOG_FLUSH();
Wakeup_by_NFC = true;
}
}
here I am Stuck, in the main loop, I dont know how start the advertising start again..
for (;;)
{
if (Wakeup_by_NFC)
{
Wakeup_by_NFC = false;
printf("NFC detectado\r\n");
NRF_LOG_INFO("Nfc detectado");
NRF_LOG_FLUSH();
// err_code = sd_ble_gap_adv_start(&m_advertising->adv_handle,BLE_ADV_MODE_FAST); // it didnt work I have problem with compiling line
// APP_ERROR_CHECK(err_code);
// NRF_LOG_INFO("Starting advertising");
// NRF_LOG_FLUSH();
}
__SEV();
__WFE();
__WFE();
// idle_state_handle();
}
}
I get an error of compilation when I using sd_ble_gap_adv_start ... I haven't found any example with this function in the main loop ..
If you have a part of code.. I'll appreciate..
Ricardo
