#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_data | Pointer 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] | length | Length 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_metadata | Pointer to metadata structure. Contains detailed properties of data to transmit. If NULL following metadata are used:
|
- Return values
-
true | The transmission procedure was scheduled. |
false | The driver could not schedule the transmission procedure. |