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

◆ sdc_hci_cmd_le_ext_create_conn()

uint8_t sdc_hci_cmd_le_ext_create_conn ( const sdc_hci_cmd_le_ext_create_conn_t * p_params)

#include <softdevice_controller/include/sdc_hci_cmd_le.h>

LE Extended Create Connection [v1].

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

This command is used to create a single ACL connection, with the local device in the Central role, to a connectable advertiser. The command is also used to create a single ACL connection between a periodic advertiser and a synchronized device. If a connection is created with the local device in the Peripheral role while this command is pending, then this command remains pending.

The Advertising_Handle parameter is used to identify the periodic advertising train.

The Subevent parameter is used to identify the subevent where a connection request shall be initiated from a periodic advertising train. The Host may use this subevent whether or not the Controller has requested data for it using the HCI_LE_Periodic_Advertising_Subevent_Data_Request event.

If the Advertising_Handle and Subevent parameters are set to values other than 0xFF, then the Initiator_Filter_Policy, Scan_Interval[i], and Scan_Window[i] parameters shall be ignored.

The Initiator_Filter_Policy parameter is used to determine whether the Filter Accept List is used and whether to process decision PDUs and other advertising PDUs. If the Filter Accept List is used or the policy allows decision PDUs to be processed (or both), then the device to connect to is the first one that sends an advertisement received successfully by the local device and that is on the list or that is accepted by the decision instructions (see Section 7.8.145), as specified by the policy. If the Filter Accept List is not used, then the Peer_Address_Type and the Peer_Address parameters specify the address type and address of the advertising device to connect to for advertisements not using decision PDUs. If Initiator_Filter_Policy is set to 0x03, then devices on the Filter Accept List shall still be processed using the decision instructions.

The Own_Address_Type parameter indicates the type of address being used in the connection request packets.

The Peer_Address_Type parameter indicates the type of address used in the connectable advertisement sent by the peer.

The Peer_Address parameter indicates the Peer’s Public Device Address, Random (static) Device Address, Non-Resolvable Private Address, or Resolvable Private Address depending on the Peer_Address_Type parameter.

The Initiating_PHYs parameter indicates the PHY(s) on which the advertising packets should be received on the primary advertising physical channel and the PHYs for which connection parameters have been specified. The Host may enable one or more initiating PHYs. The array elements of the arrayed parameters are ordered in the same order as the set bits in the Initiating_PHYs parameter, starting from bit 0. The number of array elements is determined by the number of bits set in the Initiating_PHYs parameter. When a connectable advertisement is received and a connection request is sent on one PHY, scanning on any other PHYs is terminated.

The Scan_Interval[i] and Scan_Window[i] parameters are recommendations from the Host on how long (Scan_Window[i]) and how frequently (Scan_Interval[i]) the Controller should scan (see [Vol 6] Part B, Section 4.5.3); however the frequency and length of the scan is implementation specific. If bit 1 is set in Initiating_PHYs, the values for the LE 2M PHY shall be ignored.

The Connection_Interval_Min[i] and Connection_Interval_Max[i] parameters define the minimum and maximum allowed connection interval. The Connection_Interval_Min[i] parameter shall not be greater than the Connection_Interval_Max[i] parameter.

The Max_Latency[i] parameter defines the maximum allowed Peripheral latency (see [Vol 6] Part B, Section 4.5.1).

The Supervision_Timeout[i] parameter defines the link supervision timeout for the connection. The Supervision_Timeout[i] in milliseconds shall be larger than (1 + Max_Latency[i]) × Connection_Interval_Max[i] × 2, where Connection_Interval_Max[i] is given in milliseconds (see [Vol 6] Part B, Section 4.5.2).

The Min_CE_Length[i] and Max_CE_Length[i] parameters provide the Controller with the expected minimum and maximum length of the connection events. The Controller is not required to use these values.

Where the connection is made on a PHY whose bit is not set in the Initiating_PHYs parameter, the Controller shall use the Connection_Interval_Min[i], Connection_Interval_Max[i], Max_Latency[i], Supervision_Timeout[i], Min_CE_Length[i], and Max_CE_Length[i] parameters for an implementation-chosen PHY whose bit is set in the Initiating_PHYs parameter.

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 Advertising_Handle 0xFF Subevent 0xFF

Errors:

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

Type   Condition                                                                Error code
M      Advertising_Handle or Subevent, but not both, is set to 0xFF.            Invalid HCI
                                                                                Command
                                                                                Parameters
                                                                                (0x12)
RC     Initiating_PHYs has a bit set which is not supported by the Controller   Unsupported
       or is RFU.                                                               Feature or
                                                                                Parameter Value
                                                                                (0x11)
M      Advertising_Handle is not 0xFF and Initiating_PHYs does not have the     Invalid HCI
       bit set for the PHY used for the specified periodic advertising train.   Command
                                                                                Parameters
                                                                                (0x12)
MC     The requested scan is not supported.                                     Invalid HCI
                                                                                Command
                                                                                Parameters
                                                                                (0x12)
MC     Another HCI_LE_Extended_Create_Connection command is pending.            Command
                                                                                Disallowed
                                                                                (0x0C)
M      The local device is already connected to the same device address as      Connection
       the advertiser (including two different Resolvable Private Addresses     Already Exists
       that resolve to the same IRK).                                           (0x0B)
R      Own_Address_Type is 0x00 and the device does not have a public           Invalid HCI
       address.                                                                 Command
                                                                                Parameters
                                                                                (0x12)
MC     Own_Address_Type is 0x01 and the random address for the device has not   Invalid HCI
       been initialized using HCI_LE_Set_Random_Address.                        Command
                                                                                Parameters
                                                                                (0x12)
R      Own_Address_Type is 0x02, Initiator_Filter_Policy is 0x00, the           Invalid HCI
       Controller’s resolving list does not contain a matching entry, and the   Command
       device does not have a public address.                                   Parameters
                                                                                (0x12)
R      Own_Address_Type is 0x02, Initiator_Filter_Policy is not 0x00, and the   Invalid HCI
       device does not have a public address.                                   Command
                                                                                Parameters
                                                                                (0x12)
MC     Own_Address_Type is 0x03, Initiator_Filter_Policy is 0x00, the           Invalid HCI
       Controller’s resolving list does not contain a matching entry, and the   Command
       device’s random address has not been initialized using                   Parameters
       HCI_LE_Set_Random_Address.                                               (0x12)
MC     Own_Address_Type is 0x03, Initiator_Filter_Policy is not 0x00, and the   Invalid HCI
       device’s random address has not been initialized using                   Command
       HCI_LE_Set_Random_Address.                                               Parameters
                                                                                (0x12)
MC     Initiating_PHYs does not have at least one bit set for a PHY allowed     Invalid HCI
       for scanning on the primary advertising physical channel.                Command
                                                                                Parameters
                                                                                (0x12)
MC     The Controller has insufficient resources to handle any more             Rejected due to
       connections.                                                             Limited
                                                                                Resources
                                                                                (0x0D)
M      Decision-Based Advertising Filtering is not supported and                Unsupported
       Initiator_Filter_Policy is not 0x00 or 0x01.                             Feature or
                                                                                Parameter Value
                                                                                (0x11)
R      Max_CE_Length is less than Min_CE_Length.                                Invalid HCI
                                                                                Command
                                                                                Parameters
                                                                                (0x12)

Event(s) generated (unless masked away):

When the Controller receives the HCI_LE_Extended_Create_Connection command, the Controller sends the HCI_Command_Status event to the Host. An HCI_LE_Enhanced_Connection_Complete event shall be generated when a connection is created because of this command or the connection creation procedure is cancelled; until the event is generated, the command is considered pending. If a connection creation is discarded, then the error code Connection Failed to be Established / Synchronization Timeout (0x3E) shall be used. If a connection is created, this event shall be immediately followed by an HCI_LE_Channel_Selection_Algorithm event.

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.