![]() |
nrfxlib API 3.3.99
|
| uint8_t sdc_hci_cmd_le_set_adv_enable | ( | const sdc_hci_cmd_le_set_adv_enable_t * | p_params | ) |
#include <softdevice_controller/include/sdc_hci_cmd_le.h>
LE Set Advertising Enable.
The description below is extracted from Core_v6.3, Vol 4, Part E, Section 7.8.9
This command is used to request the Controller to start or stop advertising. The Controller manages the timing of advertisements as per the advertising parameters given in the HCI_LE_Set_Advertising_Parameters command.
The Controller shall continue advertising until the Host issues an HCI_LE_Set_Advertising_Enable command with Advertising_Enable set to 0x00 (Advertising is disabled), a connection is created using the advertising, or the Advertising is timed out due to high duty cycle Directed Advertising. In these cases, advertising is then disabled.
Enabling advertising when it is already enabled can cause the random address to change. Disabling advertising when it is already disabled has no effect.
Errors:
See Section 4.5.2 for a list of error types and descriptions.
Type Condition Error code
R Advertising_Enable is set to 0x01, the advertising parameters' Invalid
Own_Address_Type parameter is set to 0x00, and the device does not have a HCI
public address. Command
Parameters
(0x12)
MC Advertising_Enable is set to 0x01, the advertising parameters' Invalid
Own_Address_Type parameter is set to 0x01, and the random address for the HCI
device has not been initialized using the HCI_LE_Set_Random_Address Command
command. Parameters
(0x12)
R Advertising_Enable is set to 0x01, the advertising parameters' Invalid
Own_Address_Type parameter is set to 0x02, the Controller's resolving list HCI
does not contain a matching entry, and the device does not have a public Command
address. Parameters
(0x12)
MC Advertising_Enable is set to 0x01, the advertising parameters' Invalid
Own_Address_Type parameter is set to 0x03, the Controller's resolving list HCI
does not contain a matching entry, and the random address for the device Command
has not been initialized using the HCI_LE_Set_Random_Address command. Parameters
(0x12)
Event(s) generated (unless masked away):
When the HCI_LE_Set_Advertising_Enable command has completed, an HCI_Command_Complete event shall be generated.
If the Advertising_Type parameter is 0x01 (ADV_DIRECT_IND, high duty cycle) and the directed advertising fails to create a connection, an HCI_LE_Connection_Complete or HCI_LE_Enhanced_Connection_Complete event shall be generated with the Status code set to Advertising Timeout (0x3C).
If the Advertising_Type parameter is 0x00 (ADV_IND), 0x01 (ADV_DIRECT_IND, high duty cycle), or 0x04 (ADV_DIRECT_IND, low duty cycle) and a connection is created, an HCI_LE_Connection_Complete or HCI_LE_Enhanced_Connection_Complete event shall be generated.
Note: There is a possible race condition if the Advertising_Enable parameter is set to 0x00 (Disable) and the Advertising_Type parameter is 0x00, 0x01, or 0x04. The advertisements might not be stopped before a connection is created, and therefore both the HCI_Command_Complete event and either an HCI_LE_Connection_Complete event or an HCI_LE_Enhanced_Connection_Complete event could be generated. This can also occur when high duty cycle directed advertising is timed out and this command disables advertising.
| [in] | p_params | Input parameters. |
| 0 | if success. |