This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

Disconnect IPv6 with Peripheral?

I'm using the nrf51822 with the IoT softdevice and SDK as an IPv6/6LoWPAN peripheral and Linux with a BLE dongle in the central role. Basically, I have everything working such that:

echo "connect 00:AA:BB:XX:YY:ZZ 1" > /sys/kernel/debug/bluetooth/6lowpan_control

does what it is supposed to. What I can't see how to do, however, is, as the peripheral, disconnect the connection with the Linux gateway. The callback is clear if the gateway calls disconnect, but I don't know how to do the inverse.

I see that the function ble_ipsp_disconnect(ble_ipsp_handle_t const * p_handle) exists, but I have no idea where to get an object of type ble_ipsp_handle_t and I don't see anything of that type declared in the code (I'm guessing it's used in the precompiled libraries).

Anyone know how to do this?

Parents
  • Hi Brad,

    ble_ipsp_handle_t is defined in ble_ipsp.h and consists of connection handle and L2CAP channel id. This header is available to you. And you are right the API ble_ipsp_disconnect is designed for disconnection of L2CAP channel with out disconnecting the BLE link.

    However, since 6lowpan module registers the callback with IPSP module you do not have information of what the right value for p_handle should be which are notified when the (L2CAP)connection is established. And this is a short coming in our API today. We hope to improve it future releases. Thank you for bringing this to our notice!

    In the meanwhile, you achieve a disconnection by disconnecting the BLE link instead of just the L2CAP link. this can be done by calling sd_ble_gap_disconnect. This requires connection handle for the BLE link and can be obtained when BLE_GAP_EVT_CONNECTED is notified.

    Hope this helps!

    Regards, Krishna

Reply
  • Hi Brad,

    ble_ipsp_handle_t is defined in ble_ipsp.h and consists of connection handle and L2CAP channel id. This header is available to you. And you are right the API ble_ipsp_disconnect is designed for disconnection of L2CAP channel with out disconnecting the BLE link.

    However, since 6lowpan module registers the callback with IPSP module you do not have information of what the right value for p_handle should be which are notified when the (L2CAP)connection is established. And this is a short coming in our API today. We hope to improve it future releases. Thank you for bringing this to our notice!

    In the meanwhile, you achieve a disconnection by disconnecting the BLE link instead of just the L2CAP link. this can be done by calling sd_ble_gap_disconnect. This requires connection handle for the BLE link and can be obtained when BLE_GAP_EVT_CONNECTED is notified.

    Hope this helps!

    Regards, Krishna

Children
No Data
Related