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

◆ nrf_802154_transmit()

bool nrf_802154_transmit ( const uint8_t *  p_data,
uint8_t  length,
const nrf_802154_transmit_metadata_t p_metadata 
)

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

Changes the radio state to transmit.

Note
If the CPU is halted or interrupted while this function is executed, nrf_802154_transmitted or nrf_802154_transmit_failed must be called before this function returns a result.
This function copies the given buffer. It maintains an internal buffer, which is used to make a frame copy. To prevent unnecessary memory consumption and to perform zero-copy transmission, use nrf_802154_transmit_raw instead.
This function is available if NRF_802154_USE_RAW_API is disabled.

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 or nrf_802154_transmit_failed.

*       p_data
*       v
* +-----+-----------------------------------------------------------+------------+
* | PHR | MAC header and payload                                    | FCS        |
* +-----+-----------------------------------------------------------+------------+
*       |                                                           |
*       | <------------------ length -----------------------------> |
* 
Parameters
[in]p_dataPointer to the array with the payload of data to transmit. The array should exclude PHR or FCS fields of the 802.15.4 frame.
[in]lengthLength of the given frame. This value must exclude PHR and FCS fields from the given frame (exact size of buffer pointed to by p_data).
[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
Return values
trueThe transmission procedure was scheduled.
falseThe driver could not schedule the transmission procedure.