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

Radio Notification events issue

i am using Nrf52840 with SDK 132 and version 13.

here is the initialization

 ble_radio_notification_init(APP_IRQ_PRIORITY_LOW, NRF_RADIO_NOTIFICATION_DISTANCE_5500US, Radio_Event);

this is Event Handler

void Radio_Event(bool radio_active) 
{
	if (radio_active)
	{
        	NRF_LOG_INFO("BLE STOP!\r\n");
 		    sd_ble_gap_adv_stop();
	}
	else
	{
	        NRF_LOG_INFO(" Radio is inActive \r\n");
	}
}

the problem is Active Radio and inActive Radio events Loop. First time, i got radio active event, inside active radio i used sd_ble_gap_adv_stop(); to stop the Advertising. then he should not give me any kind of event. but i got loop of active and inactive events. but in real there is no advertising after calling the sd_ble_gap_adv_stop();

Thank you

Parents
  • Hi,

    You should not be stopping advertisement inside radio_notification handler. That is only called shortly before actual Tx packet(s) are issued and you have chance to change certain parameters (like device name, adv. and scan response data, Tx Power) but you should not interact with GAP/GATT state machine inside the stack. At least this is my conclusion after attempting the same with S13x v2 and 3. Why would you be stopping advertisement on this event? If there is any external event/input which you use for decision then do it straight away there. If you don't want to advertise at all then don't start it;)

    Cheers Jan

  • i like to ctach the event when the packet is advertised.then i want to stop the advertising means in simple word i like to stop advertising after the one packet is advertised. if i received one packet from the other device then i will manipulate the information, after that may be i need to give him response. thats why i like to advertise only for one packet.

Reply Children
No Data
Related