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

Advertising restart after a disconnect event

Hi!

Using SDK 14, I am advertising and see my device on the phone with nRFConnect. The indication LED flashes (indication) properly and in fixed intervals. When I connect with my phone the LED lights up without flashing as expected. After I disconnect the device wont advertise anymore and the LED doesn't flash anymore. I can also not find the device with my phone.

I tried to put a advertising_start(false); in the disconnected event:

case BLE_GAP_EVT_DISCONNECTED:
            NRF_LOG_INFO("Disconnected, reason %d\r\n",
                          p_ble_evt->evt.gap_evt.params.disconnected.reason);
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
            advertising_start(false);
            break; // BLE_GAP_EVT_DISCONNECTED

This makes the LED flash again as if it was advertising but I can't find the device with my phone. Very sad. The boolean false just states that no bonds should be erased (I took this one from the examples)

So two questions:

  • How do I make this work (that I can connect and advertise over and over again)?
  • Sometimes after just some seconds the LED will light up as if it's in connected state. I cannot figure why ...

I would be very glad if someone could give me some advice ...

Best Noah

Parents Reply Children
No Data
Related