Late start of advertisement after an BLE disable and enable

Hi,

I have late start issue on advertisement.

I have two device mode and we switch between when we want to. Device starts with Mode_1 with BLE enable.

When I switch from Mode_2 to Mode_1, sometimes we have late adv start like in 15 seconds, 30 seconds, 1 min or 3 mins. It starts eventually but it is late.

		case MODE_1:
			k_msleep(500);
			dh_adc_disable();
			bt_enable(NULL);
			bt_le_adv_start(&deviceAdvParams, syncAdData, ARRAY_SIZE(syncAdData), NULL, 0);
		break;

		case MODE_2:
			bt_le_adv_stop();
			k_msleep(1000);
			bt_disable();
			k_msleep(1000);
			// I do adc timer init, adc init, ppi init here.
			k_msleep(500);
		break;

I have also tried  bt_enable with parameter like bt_enable(bleOkCb). but the result didn't change.

Void bleOkCb(int param)
{
bt_le_adv_start(&deviceAdvParams, syncAdData, ARRAY_SIZE(syncAdData), NULL, 0);
}

Please can you help me on this?

Thank you

Parents Reply Children
  • Hi,

    I provided a piece of information regarding expected behavior of bt_disable() which you use in mode 2.

    Which NCS version do you use?

    Could you please describe what are you trying to achieve with both modes?

    Could you provide more information about your setup, expected behavior in both modes and when switching between modes?

    EDIT: Do you use SoftDevice Controller or Zephyr Controller?

    Best regards,
    Dejan

Related