Hey guys,
I’m trying to send a single non-connectable beacon every few minutes in the lowest power way possible. nRF51822, SD S110 8.0, SDK 9-2. Different scenario from previous post.
I’ve done this by setting the interval to 1sec, and timeout to 1sec. Then on the event BLE_GAP_EVT_TIMEOUT with source of BLE_GAP_TIMEOUT_SRC_ADVERTISING, I do a hard shutdown of the nRF51822 into OFF mode.
I know three advertisements will be sent during this one second period (one on each channel), but is there a way to know exactly when the advertisement TX completes such that I can enter OFF mode sooner than 1sec?
Thanks! Brian
#define APP_CFG_NON_CONN_ADV_TIMEOUT 1
#define NON_CONNECTABLE_ADV_INTERVAL MSEC_TO_UNITS(1000, UNIT_0_625_MS)
err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
static void ble_evt_dispatch(ble_evt_t * p_ble_evt) {
if((p_ble_evt->header.evt_id == BLE_GAP_EVT_TIMEOUT) &&
(p_ble_evt->evt.gap_evt.params.timeout.src == BLE_GAP_TIMEOUT_SRC_ADVERTISING))
{
while(1) sd_power_system_off();