nrfxlib API 3.3.99
Loading...
Searching...
No Matches

◆ sdc_hci_cmd_le_set_ext_adv_data()

uint8_t sdc_hci_cmd_le_set_ext_adv_data ( const sdc_hci_cmd_le_set_ext_adv_data_t * p_params)

#include <softdevice_controller/include/sdc_hci_cmd_le.h>

LE Set Extended Advertising Data.

The description below is extracted from Core_v6.3, Vol 4, Part E, Section 7.8.54

This command is used to set the data used in advertising PDUs that have a data field. This command may be issued at any time after an advertising set identified by the Advertising_Handle parameter has been created using the HCI_LE_Set_Extended_Advertising_Parameters command (see Section 7.8.53), regardless of whether advertising in that set is enabled or disabled.

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

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

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

The Host may set the advertising data in one or more operations using the Operation parameter in the command.

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

If the 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 advertising data.

If Operation is 0x04, the behavior is the same as if the current 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).

The Fragment_Preference parameter provides a hint to the Controller as to whether advertising data should be fragmented.

Errors:

See Section 4.5.2 for a list of error types and descriptions.

Type   Condition                                                                     Error code
MC     The combined length of the data exceeds the capacity of the advertising set   Memory
       identified by Advertising_Handle (see Section 7.8.57) or the amount of        Capacity
       memory available. All the data shall be discarded.                            Exceeded
                                                                                     (0x07)
MC     The advertising set uses extended advertising and the combined length of      Packet Too
       the data is greater than the maximum that the Controller can transmit         Long
       within the longest possible auxiliary advertising segment consistent with     (0x45)
       the current parameters of the advertising set (using the current
       advertising interval if advertising is enabled). All the data shall be
       discarded. If advertising on the LE Coded PHY, the S=8 coding shall be
       assumed unless the current advertising 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.
MC     The advertising set has a type that does not support advertising data.        Invalid
                                                                                     HCI
                                                                                     Command
                                                                                     Parameters
                                                                                     (0x12)
MC     The advertising set uses legacy advertising PDUs that support advertising     Invalid
       data and either Operation is not 0x03 or Advertising_Data_Length exceeds 31   HCI
       octets.                                                                       Command
                                                                                     Parameters
                                                                                     (0x12)
MC     Operation is 0x04 and: • advertising is disabled for the advertising set; •   Invalid
       the advertising set contains no data; • the advertising set uses legacy       HCI
       PDUs; or • Advertising_Data_Length is not zero.                               Command
                                                                                     Parameters
                                                                                     (0x12)
MC     Operation is not 0x03 or 0x04 and Advertising_Data_Length is zero.            Invalid
                                                                                     HCI
                                                                                     Command
                                                                                     Parameters
                                                                                     (0x12)
MC     Operation is not 0x03 or 0x04 and the advertising set is enabled.             Command
                                                                                     Disallowed
                                                                                     (0x0C)
MC     Advertising_Handle does not identify an existing advertising set.             Unknown Ad
                                                                                     vertising
                                                                                     Identifier
                                                                                     (0x42)

Event(s) generated (unless masked away):

When the HCI_LE_Set_Extended_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.