2 Replies Latest reply on Nov 20, 2018 11:04 PM by PY_21

    Cy_BLE_GAP_Disconnect only works with some disconnect reasons

    user_1669321

      Hi,

       

      I'm trying to do a routine to clear the bonded device list after disconnecting from a peer device if there is an active connection. I haven't tried all error codes from section 2D of the Bluetooth Spec 4.2 for the disconnect reason, but among the codes I've tried, only 0x14 (Remote Device Terminated Connection due to Low Resources) and 0x15 (Remote Device Terminated Connection due to Power Off) work.

       

      The error code I'd like to use is 0x16 (Connection Terminated By Local Host). The function returns CY_BLE_SUCCESS, so I'm assuming it accepts any error code, but my connection in CySmart doesn't get disconnected unless I use the codes 0x14 or 0x15. Is there a check for the error code in the function?

       

      Thank you,

       

      Fred

        • 1. Re: Cy_BLE_GAP_Disconnect only works with some disconnect reasons
          PY_21

          Hello Fred,

           

          I'm also replicating the problem, in the API Cy_Ble_Gap_Disconnect() if I give the disconnect reason 0x16(connection terminated by local host) connection in CySmart doesn't get disconnected. We have forwarded your query to our product development team, who will evaluate your query. 

          Thank you for your interest in Cypress products

           

           

          Thanks,

          P Yugandhar.

          • 2. Re: Cy_BLE_GAP_Disconnect only works with some disconnect reasons
            PY_21

            Hello Fred,

             

            Please refer to Bluetooth Specification Core_v5.0, Volume 2, Part E, Section 7.1.6 for the acceptable reason codes which can be sent along with the HCI_disconnect command. For these reason codes only disconnection is processed in the stack.
            The CY_BLE_EVT_GAP_DEVICE_DISCONNECTED event indicates the device has disconnected from the remote device and the parameter of type struct cy_stc_ble_gap_disconnect_param_t will give the reason of disconnection.

            Please let me know if you have any questions.

             

            Thanks,

            P Yugandhar.