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

◆ nrf_802154_transmit_raw()

nrf_802154_tx_error_t nrf_802154_transmit_raw ( uint8_t * p_data,
const nrf_802154_transmit_metadata_t * p_metadata )

#include <nrf_802154/common/include/nrf_802154.h>

Changes the radio state to RADIO_STATE_TX.

Note
If the CPU is halted or interrupted while this function is executed, nrf_802154_transmitted_raw or nrf_802154_transmit_failed can be called before this function returns a result.
This function is implemented in zero-copy fashion. It passes the given buffer pointer to the RADIO peripheral.
Setting tx_timestamp_encode to true is only allowed if NRF_802154_TX_TIMESTAMP_PROVIDER_ENABLED is enabled. If this condition is not met, any attempt to transmit a frame will fail unconditionally.

In the transmit state, the radio transmits a given frame. If requested, it waits for an ACK frame. Depending on NRF_802154_ACK_TIMEOUT_ENABLED, the radio driver automatically stops waiting for an ACK frame or waits indefinitely for an ACK frame. If it is configured to wait, the MAC layer is responsible for calling nrf_802154_receive or nrf_802154_sleep after the ACK timeout. The transmission result is reported to the higher layer by calls to nrf_802154_transmitted_raw or nrf_802154_transmit_failed.

* p_data
* v
* +-----+-----------------------------------------------------------+------------+
* | PHR | MAC header and payload                                    | FCS        |
* +-----+-----------------------------------------------------------+------------+
*       |                                                                        |
*       | <---------------------------- PHR -----------------------------------> |
* 
Parameters
[in]p_dataPointer to the array with data to transmit. The first byte must contain frame length (including FCS). The following bytes contain data. The CRC is computed automatically by the radio hardware. Therefore, the FCS field can contain any bytes.
[in]p_metadataPointer to metadata structure. Contains detailed properties of data to transmit. If NULL following metadata are used:
Field Value
frame_props NRF_802154_TRANSMITTED_FRAME_PROPS_DEFAULT_INIT
cca true
tx_timestamp_encode false
Return values
NRF_802154_TX_ERROR_NONEThe TX request was successful. Transmit success or failure will be indicated by the callout.
Returns
Error that prevented the frame from being transmitted. No callout will be called.