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

◆ sdc_hci_cmd_le_set_phy()

uint8_t sdc_hci_cmd_le_set_phy ( const sdc_hci_cmd_le_set_phy_t * p_params)

#include <softdevice_controller/include/sdc_hci_cmd_le.h>

LE Set PHY.

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

This command is used to set the PHY preferences for the connection identified by the Connection_Handle. The Controller might not be able to make the change (e.g. because the peer does not support the requested PHY) or may decide that the current choice of PHY is preferable (e.g., because it could not schedule other activities if the requested PHY was used or because it requires a PHY that supports Constant Tone Extensions).

The All_PHYs parameter is a bit field that allows the Host to specify, for each direction, whether it has no preference among the PHYs that the Controller supports in a given direction or whether it has specified particular PHYs that it prefers in the TX_PHYs or RX_PHYs parameter.

The TX_PHYs parameter is a bit field that indicates the transmitter PHYs that the Host prefers the Controller to use. If the All_PHYs parameter specifies that the Host has no preference, the TX_PHYs parameter shall be ignored; otherwise at least one bit shall be set to 1.

The RX_PHYs parameter is a bit field that indicates the receiver PHYs that the Host prefers the Controller to use. If the All_PHYs parameter specifies that the Host has no preference, the RX_PHYs parameter shall be ignored; otherwise at least one bit shall be set to 1.

The Controller shall request a change unless it determines that this is unnecessary or that the current PHY in both directions is preferable, in which case it may, but need not, request a change.

The PHY preferences provided by the HCI_LE_Set_PHY command override those provided via the HCI_LE_Set_Default_PHY command (Section 7.8.48) or any preferences previously set using the HCI_LE_Set_PHY command on the same connection. The PHY_Options parameter is a bit field that allows the Host to specify options for PHYs. The default value for a new connection shall be all zero bits. The Controller may override any preferred coding for transmitting on the LE Coded PHY.

The Host may specify a preferred coding even if it prefers not to use the LE Coded transmitter PHY since the Controller may override the PHY preference.

Errors:

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

Type   Condition                                                           Error code
MC     TX_PHYs or RX_PHYs contains a bit for a PHY that the Controller     Unsupported Feature
       does not support or is reserved for future use.                     or Parameter Value
                                                                           (0x11)
MC     The Controller does not support asymmetric connections (see [Vol    Unsupported Feature
       6] Part B, Section 4.6.9.1), All_PHYs is 0x00, and TX_PHYs is not   or Parameter Value
       the same as RX_PHYs.                                                (0x11)

Event(s) generated (unless masked away):

When the Controller receives the HCI_LE_Set_PHY command, the Controller shall send the HCI_Command_Status event to the Host. The HCI_LE_PHY_Update_Complete event shall be generated either when one or both PHY changes or when the Controller determines that neither PHY will change immediately.

Note: If the peer negotiation resulted in no change to either PHY, this is not an error and the HCI_LE_PHY_Update_Complete event will contain a status indicating success.

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.