This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

BLE event generation

Hi,

I use the BLE_APP_UART example for reference and in the code there is the ble_evt_handler with the following states:

        case BLE_GAP_EVT_CONNECTED:
        case BLE_GAP_EVT_DISCONNECTED:
        case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
        case BLE_GATTS_EVT_SYS_ATTR_MISSING:
        case BLE_GATTC_EVT_TIMEOUT:
        case BLE_GATTS_EVT_TIMEOUT:

CONNECTED and DISCONNECTED are easy to trigger. Is there a way to trigger the other states in order to verify the functionality of my code?

I am not sure what the other states do - is there somewhere a description on the causes?

Regards,

Morten

  • Hi Morten,

    The SoftDevice can trigger many different events in different situations (se SoftDevice API documentation for all events). Depending on use case you may never see some of them. Regarding these you mention here:

    • BLE_GAP_EVT_PHY_UPDATE_REQUEST this is triggered when the peer requests to update the PHY. If you are testing with nRF Connect for _Desktop, you can click the cogwheel in the box representing the connection and select "Update phy..." to test this.
    • BLE_GAP_EVT_SEC_PARAMS_REQUEST - Initiate pairing.
    • BLE_GATTS_EVT_SYS_ATTR_MISSING - from the peer (like nRF Connect for desktop), read a CCCD that has not been set.
    • BLE_GATTC_EVT_TIMEOUT - This indicates that a GATTC operation timed out so the GATT server on the peer needs to not respond in time in order to trigger this.
    • BLE_GATTS_EVT_TIMEOUT - same here, the event indicates that the peer (GATT client in this case) did not respond in time. So you would need to make a GATT client that misbehaves/does not respond in order to trigger it.

    Einar

Related