Function nrf_softdevice_s132::sd_ble_gap_phy_update
source · pub unsafe fn sd_ble_gap_phy_update(
conn_handle: u16,
p_gap_phys: *const ble_gap_phys_t
) -> u32
Expand description
@brief Initiate or respond to a PHY Update Procedure
@details This function is used to initiate or respond to a PHY Update Procedure. It will always generate a @ref BLE_GAP_EVT_PHY_UPDATE event if successfully executed. If this function is used to initiate a PHY Update procedure and the only option provided in @ref ble_gap_phys_t::tx_phys and @ref ble_gap_phys_t::rx_phys is the currently active PHYs in the respective directions, the SoftDevice will generate a @ref BLE_GAP_EVT_PHY_UPDATE with the current PHYs set and will not initiate the procedure in the Link Layer.
If @ref ble_gap_phys_t::tx_phys or @ref ble_gap_phys_t::rx_phys is @ref BLE_GAP_PHY_AUTO,
then the stack will select PHYs based on the peer's PHY preferences and the local link
configuration. The PHY Update procedure will for this case result in a PHY combination
that respects the time constraints configured with @ref sd_ble_cfg_set and the current
link layer data length.
When acting as a central, the SoftDevice will select the fastest common PHY in each direction.
If the peer does not support the PHY Update Procedure, then the resulting
@ref BLE_GAP_EVT_PHY_UPDATE event will have a status set to
@ref BLE_HCI_UNSUPPORTED_REMOTE_FEATURE.
If the PHY Update procedure was rejected by the peer due to a procedure collision, the status
will be @ref BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION or
@ref BLE_HCI_DIFFERENT_TRANSACTION_COLLISION.
If the peer responds to the PHY Update procedure with invalid parameters, the status
will be @ref BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS.
If the PHY Update procedure was rejected by the peer for a different reason, the status will
contain the reason as specified by the peer.
@events @event{@ref BLE_GAP_EVT_PHY_UPDATE, Result of the PHY Update Procedure.} @endevents
@mscs @mmsc{@ref BLE_GAP_CENTRAL_PHY_UPDATE} @mmsc{@ref BLE_GAP_PERIPHERAL_PHY_UPDATE} @endmscs
@param[in] conn_handle Connection handle to indicate the connection for which the PHY Update is requested. @param[in] p_gap_phys Pointer to PHY structure.
@retval ::NRF_SUCCESS Successfully requested a PHY Update. @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported PHYs supplied to the call. @retval ::NRF_ERROR_INVALID_STATE No link has been established. @retval ::NRF_ERROR_BUSY Procedure is already in progress or not allowed at this time. Process pending events and wait for the pending procedure to complete and retry.