nrfxlib API 2.7.99
Loading...
Searching...
No Matches

◆ sdc_hci_cmd_le_enable_encryption()

uint8_t sdc_hci_cmd_le_enable_encryption ( const sdc_hci_cmd_le_enable_encryption_t p_params)

#include <softdevice_controller/include/sdc_hci_cmd_le.h>

LE Enable Encryption.

The description below is extracted from Core_v5.4, Vol 4, Part E, Section 7.8.24

The HCI_LE_Enable_Encryption command is used to authenticate the given encryption key associated with the remote device specified by the Connection_Handle, and once authenticated will encrypt the connection. The parameters are as defined in [Vol 3] Part H, Section 2.4.4.

If the connection is already encrypted then the Controller shall pause connection encryption before attempting to authenticate the given encryption key, and then re-encrypt the connection. While encryption is paused no user data shall be transmitted.

If the Connection_Handle parameter identifies an ACL with an associated CIS that has been created, the Controller shall return the error code Command Disallowed (0x0C).

On an authentication failure, the connection shall be automatically disconnected by the Link Layer. If this command succeeds, then the connection shall be encrypted. This command shall only be used when the local device’s role is Central.

Event(s) generated (unless masked away): When the Controller receives the HCI_LE_Enable_Encryption command it shall send the HCI_Command_Status event to the Host. If the connection is not encrypted when this command is issued, an HCI_Encryption_Change event shall occur when encryption has been started for the connection. If the connec- tion is encrypted when this command is issued, an HCI_Encryption_Key_- Refresh_Complete event shall occur when encryption has been resumed.

Parameters
[in]p_paramsInput parameters.
Return values
0if success.
Returns
Returns value between 0x01-0xFF in case of error. See Vol 2, Part D, Error for a list of error codes and descriptions.