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

◆ sdc_hci_cmd_le_set_periodic_adv_data()

uint8_t sdc_hci_cmd_le_set_periodic_adv_data ( const sdc_hci_cmd_le_set_periodic_adv_data_t p_params)

#include <softdevice_controller/include/sdc_hci_cmd_le.h>

LE Set Periodic Advertising Data.

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

The HCI_LE_Set_Periodic_Advertising_Data command is used to set the data used in periodic advertising PDUs. This command may be issued at any time after the advertising set identified by the Advertising_Handle parameter has been configured for periodic advertising using the HCI_LE_Set_Periodic_- Advertising_Parameters command (see Section 7.8.61), regardless of whether periodic advertising in that set is enabled or disabled. If the advertising set has not been configured for periodic advertising, then the Controller shall return the error code Command Disallowed (0x0C).

If periodic advertising is currently enabled for the specified advertising set, the Controller shall use the new data in subsequent periodic advertising events for this advertising set. If a periodic advertising event is in progress when this command is issued, the Controller may use the old or new data for that event.

If periodic advertising is currently disabled for the specified advertising set, the data shall be kept by the Controller and used once periodic advertising is enabled for that set. The data shall be discarded when the advertising set is removed.

Only the significant part of the periodic advertising data should be transmitted in the advertising packets as defined in [Vol 3] Part C, Section 11.

The Host may set the periodic advertising data in one or more operations using the Operation parameter in the command. If the combined length of the data exceeds the capacity of the advertising set identified by the Advertising_- Handle parameter (see Section 7.8.57 LE Read Maximum Advertising Data Length command) or the amount of memory currently available, all the data shall be discarded and the Controller shall return the error code Memory Capacity Exceeded (0x07).

If the combined length of the data is greater than the maximum that the Con- troller can transmit within the current periodic advertising interval (if periodic advertising is currently enabled) or the Periodic_Advertising_Interval_Max for the advertising set (if currently disabled), all the data shall be discarded and the Controller shall return the error code Packet Too Long (0x45). If advertising on the LE Coded PHY, the S=8 coding shall be assumed unless the current adver- tising parameters require the use of S=2 for an advertising physical channel, in which case the S=2 coding shall be assumed for that advertising physical channel.

If Operation indicates the start of new data (values 0x01 or 0x03), then any existing partial or complete data shall be discarded.

If Operation is 0x04, then the behavior is the same as if the current periodic advertising data had been sent again; this can be used to cause the Advertising DID value to be updated (see [Vol 6] Part B, Section 4.4.2.11).

If Operation is 0x04 and: • periodic advertising is currently disabled for the advertising set; • the periodic advertising set contains no data; or • Advertising_Data_Length is not zero;

then the Controller shall return the error code Invalid HCI Command Parameters (0x12).

If Operation is not 0x03 or 0x04 and Advertising_Data_Length is zero, then the Controller shall return the error code Invalid HCI Command Parameters (0x12).

If the periodic advertising data is discarded by the command or the combined length of the data after the command completes is zero, the advertising set will have no periodic advertising data.

If periodic advertising is currently enabled for the specified advertising set and Operation does not have the value 0x03 or 0x04, then the Controller shall return the error code Command Disallowed (0x0C).

If the advertising set corresponding to the Advertising_Handle parameter does not exist, then the Controller shall return the error code Unknown Advertising Identifier (0x42).

Event(s) generated (unless masked away): When the HCI_LE_Set_Periodic_Advertising_Data command has completed, an HCI_Command_Complete event shall be generated.

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.