Hi all,
I want to ON and OFF advertise manually
My code working steps
1) (APP_ADV_DURATION 3000 ) after this seconds over
2) It hits on_adv_evt() function in this function case :BLE_ADV_EVT_IDLE i use sd_ble_gap_adv_stop(m_advertising.adv_handle);
Till this point it's working properly
3) In uart_event_handle() function
char buff[2];
char str_cmp[2]= "ON";
if ((data_array[index - 1] == '\n') || (data_array[index - 1] == '\r') || (index >= m_ble_nus_max_data_len))
{
memmove(buff,data_array,2);
if(buff == str_cmp)
{
int Val = memcmp(buff,str_cmp,2);
if(Val == 0)
{
NRF_LOG_INFO("ON\n");
ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
// ble_advertising_restart_without_whitelist(&m_advertising);
}
else
{
NRF_LOG_INFO("OFF\n");
}
....
}
4) My Doubt is after 2nd Point hits 3rd Point will work or not
Otherwise suggest me how to advertise manually using uart_event_handle() function or any Idea