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

How do I eliminate advDelay inserted in advertising events of S132

We need to accurately control the time when the Bluetooth advertising package is sent out,
so that the two slavers can simultaneously send the beacon data to produce the signal overlap area, so that we can clearly know which slaver the label is near.

In S132, is there an advDelay inserted before sending the first advertising package?Is there any way to send the broadcast packet immediately without delay?

[1]Only the 37 channel are used in the ble_advertising_start():

 // Initialize advertising parameters with default values.
    memset(&p_advertising->adv_params, 0, sizeof(p_advertising->adv_params));
	p_advertising->adv_params.channel_mask[4]=0xC0;//37

[2]By toggle IO pin every second triggers an interrupt to call in_pin_handler(). The advertising_start()

is called once per second.

bool First_Advertising_End_Flag=0;
void in_pin_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)//中断回调函数
{
	if(nrf_gpio_pin_read(KEY_1)== 0)
	{
		if(nrf_gpio_pin_read(KEY_1)== 0)
		{
			if(First_Advertising_End_Flag==0)
			{
				First_Advertising_End_Flag=1;
			}
			else if(First_Advertising_End_Flag==1)
			{
				sd_ble_gap_adv_stop(m_advertising.adv_handle);
			}
			advertising_start();
		}
		
	}
}

Related