nrfxlib API 2.8.99
|
uint8_t sdc_hci_cmd_lc_disconnect | ( | const sdc_hci_cmd_lc_disconnect_t * | p_params | ) |
#include <softdevice_controller/include/sdc_hci_cmd_link_control.h>
Disconnect.
The description below is extracted from Core_v6.0, Vol 4, Part E, Section 7.1.6
The HCI_Disconnect command is used to terminate an existing connection. The Connection_Handle parameter indicates which connection is to be disconnected. The Reason parameter indicates the reason for ending the connection and is copied into the error code field of the LMP_DETACH PDU on a BR/EDR connection or the error code field of the LL_TERMINATE_IND or LL_CIS_TERMINATE_IND PDU on an LE connection. All SCO, eSCO, and CIS connections on a physical link should be disconnected before the ACL connection on the same physical connection is disconnected. If it does not, they will be implicitly disconnected as part of the ACL disconnection.
If, on the Central, the Host issues this command before issuing the HCI_LE_Create_CIS command for the same CIS (including if a previous CIS with the same CIS_ID in the same CIG has been terminated or considered lost), then the Controller shall return the error code Command Disallowed (0x0C). If the Host issues this command when there is a pending HCI_LE_Create_CIS command for the same CIS but before the CIS is created, then this command shall be successful and the CIS shall not be created.
Note: The CIS is created when the Central sends an LL_CIS_IND PDU to the Peripheral for that CIS (see [Vol 6] Part B, Section 5.1.15).
Note: If the Controller follows the requirements of version v5.4 of this specification or lower, it may return an error if this command is issued before the CIS is created.
If, on the Peripheral, the Host issues this command before the Controller has generated the HCI_LE_CIS_Established event for that CIS, then the Controller shall return the error code Command Disallowed (0x0C).
Note: As specified in Section 7.7.5, on the Central, the handle for a CIS remains valid even after disconnection and, therefore, the Host can recreate a disconnected CIS at a later point in time using the same connection handle.
Event(s) generated (unless masked away): When the Controller receives the HCI_Disconnect command, it shall send the HCI_Command_Status event to the Host. The HCI_Disconnection_Complete event will occur at each Host when the termination of the connection has completed, and on the local Host also indicates that this command has been completed. The Reason parameter in the event on the local Host shall be set to the value Connection Terminated by Local Host (0x16), while that on the remote Host shall be set to the value of Reason. However, if the termination procedure completes because a timer expires and, therefore, the local Controller cannot determine whether or not Reason was received by the remote Controller, the Reason parameter on the local Host should instead be set to the value LMP Response Timeout / LL Response Timeout (0x22).
If this command is issued for a CIS on the Central and the CIS is successfully terminated before being created, or after being created but before being established, then an HCI_LE_CIS_Established event shall also be sent for this CIS with the Status Operation Cancelled by Host (0x44).
[in] | p_params | Input parameters. |
0 | if success. |