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

◆ sdc_hci_cmd_le_ext_create_conn_v2()

uint8_t sdc_hci_cmd_le_ext_create_conn_v2 ( const sdc_hci_cmd_le_ext_create_conn_v2_t p_params)

#include <softdevice_controller/include/sdc_hci_cmd_le.h>

LE Extended Create Connection [v2].

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

The HCI_LE_Extended_Create_Connection command is used to create an ACL connection, with the local device in the Central role, to a connectable advertiser. The command is also used to create an 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 Advertising_Handle and Subevent parameters shall be set to 0xFF if these parameters are not used.

If the Advertising_Handle and Subevent parameters are set to valid values, then the Initiator_Filter_Policy, Initiating_PHYs, 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. If the Filter Accept List is not used, the Peer_Address_Type and the Peer_Address parameters specify the address type and address of the advertising device to connect to.

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. If the Host specifies a PHY that is not supported by the Controller, including a bit that is reserved for future use, the latter should return the error code Unsupported Feature or Parameter Value (0x11). 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 the requested scan cannot be supported by the implementation, the Controller shall return the error code Invalid HCI Command Parameters (0x12). 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 Min_CE_Length[i] parameter shall be less than or equal to the Max_CE_Length[i] parameter. 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.

If the Host issues this command when another HCI_LE_Extended_Create_- Connection command is pending in the Controller, the Controller shall return the error code Command Disallowed (0x0C).

If the Own_Address_Type parameter is set to 0x00 and the device does not have a public address, the Controller should return an error code which should be Invalid HCI Command Parameters (0x12).

If the Own_Address_Type parameter is set to 0x01 and the random address for the device has not been initialized using the HCI_LE_Set_Random_Address command, the Controller shall return the error code Invalid HCI Command Parameters (0x12).

If the Own_Address_Type parameter is set to 0x02, the Initiator_Filter_Policy parameter is set to 0x00, the Controller's resolving list did not contain a matching entry, and the device does not have a public address, the Controller should return an error code which should be Invalid HCI Command Parameters (0x12).

If the Own_Address_Type parameter is set to 0x02, the Initiator_Filter_Policy parameter is set to 0x01, and the device does not have a public address, the Controller should return an error code which should be Invalid HCI Command Parameters (0x12). If the Own_Address_Type parameter is set to 0x03, the Initiator_Filter_Policy parameter is set to 0x00, the Controller's resolving list did not contain a matching entry, and the random address for the device has not been initialized using the HCI_LE_Set_Random_Address command, the Controller shall return the error code Invalid HCI Command Parameters (0x12).

If the Own_Address_Type parameter is set to 0x03, the Initiator_Filter_Policy parameter is set to 0x01, and the random address for the device has not been initialized using the HCI_LE_Set_Random_Address command, the Controller shall return the error code Invalid HCI Command Parameters (0x12).

If the Initiating_PHYs parameter does not have at least one bit set for a PHY allowed for scanning on the primary advertising physical channel, the Controller shall return the error code Invalid HCI Command Parameters (0x12).

If the Host issues this command and the Controller has insufficient resources to handle any more connections, the Controller shall return the error code Connection Rejected due to Limited Resources (0x0D).

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 consid- ered pending. If a connection creation is discarded, then the error code Con- nection 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.