nrfxlib API 0.1.0
|
bool nrf_802154_transmit_raw_at | ( | uint8_t * | p_data, |
uint64_t | tx_time, | ||
const nrf_802154_transmit_at_metadata_t * | p_metadata | ||
) |
#include <nrf_802154/common/include/nrf_802154.h>
Requests transmission at the specified time.
This function works as a delayed version of nrf_802154_transmit_raw. It is asynchronous. It queues the delayed transmission using the Radio Scheduler module and performs it at the specified time.
If the delayed transmission is successfully performed, nrf_802154_transmitted_raw is called. If the delayed transmission cannot be performed ( nrf_802154_transmit_raw would return false
) or the requested transmission timeslot is denied, nrf_802154_transmit_failed with the NRF_802154_TX_ERROR_TIMESLOT_DENIED argument is called.
Additional CCA attempts can be requested by the caller through p_metadata
. In that case CCA procedure is repeated back-to-back either until it returns idle channel and the transmission starts, or until 1 + p_metadata->extra_cca_attempts
CCA attempts are performed. The maximum allowed number of additional CCA attempts is 254 so that the total number of CCA attempts doesn't exceed 255.
This function is designed to transmit the first symbol of SHR at tx_time
provided that the number of CCA attempts that will be performed is deterministic, which is only the case when no attempts are performed or when a single attempt is performed. Otherwise, the function assumes that tx_time
points to a moment where the transmission would start if the first CCA attempt detected idle channel. If the first CCA detects busy channel and additional CCA attempts follow, the moment of transmission (first symbol of SHR) is delayed by the time taken by additional CCA attempts, which is a multiple of the duration of a single CCA attempt.
The below diagram shows an example sequence where two additional CCA attempts are performed. TT denotes turnaround time necessary to switch from CCA to Tx. tx_time
points to a moment in time that occurs TT after the first CCA finishes.
* tx_time frame start * | | * | | * v v * +---------+---------+---------+--+----------+-----+-------------------------+ * | CCA | CCA | CCA |TT| SHR | PHR | MAC Header and payload | * +---------+---------+---------+--+----------+-----+-------------------------+ * | | | * v v v * BUSY BUSY IDLE *
If the requested transmission time is in the past, the function returns false
and does not schedule transmission.
A successfully scheduled transmission can be cancelled by a call to nrf_802154_transmit_at_cancel.
[in] | p_data | Pointer to the array with data to transmit. The first byte must contain the 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] | tx_time | Absolute time used by the SL Timer, in microseconds (us). | ||||||||||||
[in] | p_metadata | Pointer to metadata structure. Contains detailed properties of data to transmit. If NULL following metadata are used:
|
true | The transmission procedure was scheduled. |
false | The driver could not schedule the transmission procedure. |