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

Peripheral device: Keep advertising during connection

Hi ,

The device required to keep advertising during the connection established.

It is human interface device which mean it is peripheral device as well.

I would like to know whether there is any sample I could take as reference for the structure.

Or it is possible to keep the keyboard_sample for development? If yes, which API or function I should integrate?

In further, I would like to know is it possible to proceed connectable advertisement.

Currently, I just understand that is possible to do non-connectable advertisement.

Thanks.

  • erase_bonds = false

    This could cause issues if you are keeping the bond on the central/phone. If you are keeping the bond on the central/phone, then in your on_connected() and on_disconnected() functions, try to change advertising_start(true); to advertising_start(false); instead. You might also need to remove delete_bonds() from the BLE_GAP_EVT_DISCONNECTED handling. This blog post might be helpful.

    It show as below, 0x13 mean BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION

    BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION means that the central/phone has disconnected the link. If you take a look at the log on the phone side (swipe from left to right in nRFConnect) perhaps you could fine some more information there about why the phone disconnected.

Related