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

why event case BLE_GAP_EVT_DISCONNECTED: is nott trigering?

hi on android side of my project i try to disconnect from gatt by this code

 mbluetoothGatt.disconnect();

but in nrf51422 this event not trigering

static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    uint32_t err_code;

    switch (p_ble_evt->header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            nrf_gpio_pin_set(CONNECTED_LED_PIN_NO);
            nrf_gpio_pin_clear(ADVERTISING_LED_PIN_NO);

            m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
            break;
//this event not trigering at all
        case BLE_GAP_EVT_DISCONNECTED:
            nrf_gpio_pin_clear(CONNECTED_LED_PIN_NO);


            advertising_start();
            break;

        case BLE_GAP_EVT_TIMEOUT:
            if (p_ble_evt->evt.gap_evt.params.timeout.src == BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT)
            {
                nrf_gpio_pin_clear(ADVERTISING_LED_PIN_NO);

                // Go to system-off mode (this function will not return; wakeup will cause a reset).
                err_code = sd_power_system_off();
                APP_ERROR_CHECK(err_code);
            }
            break;

        default:
            // No implementation needed.
            break;
    }
}

when i disconnect by nrf master control panel it triger this event in nrf51422. in nrf master control panel how u disconnect from gap?

Parents
  • @navid: After you called mbluetoothGatt.disconnect(); how long did it take for the device to actually get disconnected ? Or it just keeping the connection ?

    Do you have other app that is connecting the the application ? (if it's the case Android won't disconnect) or if the application is a HID application.

    If you test with our example in the SDK (hrs for example) do you have the same issue ?

Reply
  • @navid: After you called mbluetoothGatt.disconnect(); how long did it take for the device to actually get disconnected ? Or it just keeping the connection ?

    Do you have other app that is connecting the the application ? (if it's the case Android won't disconnect) or if the application is a HID application.

    If you test with our example in the SDK (hrs for example) do you have the same issue ?

Children
No Data
Related