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

Advertising forever

I want my client to advertise forever so I added the following code:

static void ble_evt_dispatch(ble_evt_t * p_ble_evt)
{
    ble_conn_params_on_ble_evt(p_ble_evt);
    ble_nus_on_ble_evt(&m_nus, p_ble_evt);
	  // Advertise forever
	  if (p_ble_evt->header.evt_id == BLE_GAP_EVT_TIMEOUT) {
          APP_ERROR_CHECK(ble_advertising_start(BLE_ADV_MODE_FAST));
      }
      else {
			on_ble_evt(p_ble_evt);
      }
    ble_advertising_on_ble_evt(p_ble_evt);
    // bsp_btn_ble_on_ble_evt(p_ble_evt);
    
}

When the initial fast-mode advertising finishes, this code calls ble_advertising_start but then hangs. Is there another method to do this?

Parents Reply Children
No Data
Related