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

◆ sdc_hci_cmd_le_set_ext_adv_params()

uint8_t sdc_hci_cmd_le_set_ext_adv_params ( const sdc_hci_cmd_le_set_ext_adv_params_t * p_params,
sdc_hci_cmd_le_set_ext_adv_params_return_t * p_return )

#include <softdevice_controller/include/sdc_hci_cmd_le.h>

LE Set Extended Advertising Parameters [v1].

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

This command is used by the Host to set the advertising parameters.

The Advertising_Handle parameter identifies the advertising set whose parameters are being configured.

The Advertising_Event_Properties parameter describes the type of advertising event that is being configured and its basic properties. The type shall be one supported by the Controller. In particular, the following restrictions apply to this parameter:

• If legacy advertising PDU types are being used, then the parameter value shall be one of those specified in Table 7.3. If the advertising set already contains data, the type shall be one that supports advertising data and the amount of data shall not exceed 31 octets.

Event Type PDU Type Advertising Event Advertising Data Properties Connectable and scannable ADV_IND 0b00000000_00010011 Supported undirected Connectable directed ADV_DIRECT_IND 0b00000000_00010101 Not allowed (low duty cycle) Connectable directed ADV_DIRECT_IND 0b00000000_00011101 Not allowed (high duty cycle) Scannable undirected ADV_SCAN_IND 0b00000000_00010010 Supported Non-connectable and non- ADV_NON- 0b00000000_00010000 Supported scannable undirected CONN_IND Table 7.3: Advertising_Event_Properties values for legacy PDUs

• If extended advertising PDU types are being used (bit 4 = 0), then the advertisement shall not be both connectable and scannable (bits 0 and 1 must not both be set to 1) and high duty cycle directed connectable advertising (≤ 3.75 ms advertising interval) shall not be used (bit 3 = 0).

The parameters beginning with “Secondary” are only valid when extended advertising PDU types are being used (bit 4 = 0).

The Own_Address_Type parameter shall be ignored for undirected anonymous advertising (bit 2 = 0 and bit 5 = 1).

If Directed advertising is selected, the Peer_Address_Type and Peer_Address shall be valid and the Advertising_Filter_Policy parameter shall be ignored.

The Primary_Advertising_Interval_Min parameter shall be less than or equal to the Primary_Advertising_Interval_Max parameter. The Primary_Advertising_Interval_Min and Primary_Advertising_Interval_Max parameters should not be the same value so that the Controller can choose the best advertising interval given other activities.

For high duty cycle connectable directed advertising event type (ADV_DIRECT_IND), the Primary_Advertising_Interval_Min and Primary_Advertising_Interval_Max parameters are not used and shall be ignored.

The Primary_Advertising_Channel_Map is a bit field that indicates the advertising channel indices that shall be used when transmitting advertising packets. At least one channel bit shall be set in the Primary_Advertising_Channel_Map parameter.

The Own_Address_Type parameter specifies the type of address being used in the advertising packets. For random addresses, the address is specified by the HCI_LE_Set_Advertising_Set_Random_Address command.

If Own_Address_Type equals 0x02 or 0x03, the Peer_Address parameter contains the peer’s Identity Address and the Peer_Address_Type parameter contains the peer’s Identity Type (i.e., 0x00 or 0x01). These parameters are used to locate the corresponding local IRK in the resolving list; this IRK is used to generate their own address used in the advertisement.

The Advertising_TX_Power parameter indicates the maximum power level at which the advertising packets are to be transmitted on the advertising physical channels. The Controller shall choose a power level lower than or equal to the one specified by the Host.

The Primary_Advertising_PHY parameter indicates the PHY on which the advertising packets are transmitted on the primary advertising physical channel. If legacy advertising PDUs are being used, the Primary_Advertising_PHY shall indicate the LE 1M PHY. The Secondary_Advertising_PHY parameter indicates the PHY on which the advertising packets are be transmitted on the secondary advertising physical channel.

If the Primary_Advertising_PHY indicates the LE Coded PHY, then the Primary_Advertising_PHY_Options shall indicate the Host's preference or requirement concerning coding scheme. Otherwise, Primary_Advertising_PHY_Options shall be ignored. If the Secondary_Advertising_PHY indicates the LE Coded PHY, then the Secondary_Advertising_PHY_Options shall indicate the Host's preference or requirement concerning coding scheme (including for periodic advertising). Otherwise, Secondary_Advertising_PHY_Options shall be ignored.

The Secondary_Advertising_Max_Skip parameter is the maximum number of advertising events that can be skipped before the AUX_ADV_IND can be sent.

The Advertising_SID parameter specifies the value to be transmitted in the Advertising SID subfield of the ADI field of the Extended Header of those advertising physical channel PDUs that have an ADI field. If the advertising set only uses PDUs that do not contain an ADI field, Advertising_SID shall be ignored.

The Scan_Request_Notification_Enable parameter indicates whether the Controller shall send notifications upon the receipt of a scan request PDU that is in response to an advertisement from the specified advertising set that contains its device address and is from a scanner that is allowed by the advertising filter policy.

The Controller shall set the Selected_TX_Power parameter to the transmit power that it will use for transmitting the advertising packets for the specified advertising set. The Controller shall only change this value if requested by the Host. If the radiated power level will vary between packets (e.g., because of frequency-dependent properties of the transmitter) then the value should be the best estimate of the maximum power used.

Missing parameters:

When a version of this command is issued that does not include all the parameters, the following values shall be used for any missing parameters:

Parameter Value Primary_Advertising_PHY_Options 0x00 Secondary_Advertising_PHY_Options 0x00

Errors:

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

Type   Condition                                                                     Error code
MC     Advertising_Event_Properties does not describe an event type supported by     Invalid
       the Controller or contains an invalid bit combination.                        HCI
                                                                                     Command
                                                                                     Parameters
                                                                                     (0x12)
MC     Advertising_Event_Properties specifies an event type that does not support    Invalid
       advertising data and the advertising set already contains data.               HCI
                                                                                     Command
                                                                                     Parameters
                                                                                     (0x12)
MC     The primary advertising interval range defined by                             Unsupporte
       Primary_Advertising_Interval_Min and Primary_Advertising_Interval_Max does    d Feature
       not overlap the advertising interval range supported by the Controller.       or
                                                                                     Parameter
                                                                                     Value
                                                                                     (0x11)
RC     Primary_Advertising_PHY specifies a PHY that the Controller does not          Unsupporte
       support or is reserved for future use.                                        d Feature
                                                                                     or
                                                                                     Parameter
                                                                                     Value
                                                                                     (0x11)
MC     The advertising set enables Constant Tone Extensions but                      Command
       Secondary_Advertising_PHY specifies a PHY that does not allow Constant Tone   Disallowed
       Extensions.                                                                   (0x0C)
MC     Primary_Advertising_PHY_Options or Secondary_Advertising_PHY_Options is set   Command
       to 0x03 or 0x04 and the controller supports the Advertising Coding            Disallowed
       Selection feature but is unable to provide all the required settings.         (0x0C)
MC     Advertising is enabled for the specified advertising set.                     Command
                                                                                     Disallowed
                                                                                     (0x0C)
MC     Periodic advertising is enabled for an advertising set that is connectable,   Invalid
       scannable, legacy, or anonymous advertising.                                  HCI
                                                                                     Command
                                                                                     Parameters
                                                                                     (0x12)
MC     Periodic advertising is enabled for the advertising set and                   Command
       Secondary_Advertising_PHY does not specify the PHY being used for that        Disallowed
       periodic advertising.                                                         (0x0C)
MC     Advertising_Handle is not an existing advertising set and the controller is   Memory
       not able to support a new advertising set.                                    Capacity
                                                                                     Exceeded
                                                                                     (0x07)
MC     The advertising set already contains advertising data or scan response        Packet Too
       data, extended advertising is being used, and the length of the data is       Long
       greater than the maximum that the Controller can transmit within the          (0x45)
       longest possible auxiliary advertising segment consistent with the
       parameters. 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 Controller does not support the Advertising Coding Selection feature      Unsupporte
       and Primary_Advertising_PHY_Options or Secondary_Advertising_PHY_Options      d Feature
       are not zero.                                                                 or
                                                                                     Parameter
                                                                                     Value
                                                                                     (0x11)

Event(s) generated (unless masked away):

When the HCI_LE_Set_Extended_Advertising_Parameters command has completed, an HCI_Command_Complete event shall be generated.

Parameters
[in]p_paramsInput parameters.
[out]p_returnExtra return 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.