Radio Control Layer (RCL)
IEEE 802.15.4 RX and TX Command Handler

Introduction

The IEEE 802.15.4 RX and TX command allows to receive frames (packets) at a specific RF frequency (corresponding to a channel defined in the 15.4 standard), or to transmit frames at the same frequency. The following sections describe how the command can be configured and used, its life cycle, and how it fits into the RCL architecture.

In order to submit an IEEE 802.15.4 RX and TX command, the following steps must have taken place:

  1. RCL has been initialized (See RCL_init) and a handle must exist (See RCL_open).
  2. The RCL_CMD_IEEE_RX_TX_t command has been initialized and configured.
  3. To do RX, the following steps are also needed:

    a. The RCL_CmdIeee_RxAction_t struct has been initialized and configured

    b. A Multibuffer has been initialized and set up.

  4. To do TX, the following steps are also needed:

    a. The RCL_CmdIeee_TxAction_t struct has been initialized and configured

    b. A data entry of the frame to transmit has been initialized and set up.

Once these steps have been completed, RCL_Command_submit and RCL_Command_pend are called to effectively send and then wait for the command to conclude. Once this has happened, the callback and the command status can be used for error checking and the application can proceed according to its specification.

Usage

The IEEE 802.15.4 RX and TX command can be used for all aspects of supporting the IEEE 802.15.4 MAC and PHY. The command can be used to receive frames, transmit frames after clear-channel assessment (CCA), and transmit and receive ACKs. It can also be used for energy scanning.

Note: The initial version only supports either reception in promiscuous mode (no frame filtering) or unconditional transmission.

Receive Action

The command is set up as a receiver by setting the rxAxtion field to a non-NULL pointer to a RCL_CmdIeee_RxAction_t struct. When the command is started, the radio will be set up as a receiver looking for IEEE 802.15.4 frames. If a PHY header is found, the frame is received and the frame checksum (FCF) according to the MAC definition (that is, CRC), is checked at the end of the frame. If frame filtering is enabled (not yet supported), additional checks are done on the MAC header.

If a frame is received and the CRC is correct, it is stored to the first multibuffer in the provided receive queue, following the internal packet format. The CRC is not stored, but a link quality indicator (LQI), received signal strength indicator (RSSI) and timestamp are appended at the end. By modifying the configuration, appended fields can be changed.

After receiving a frame, the command will go back to RX and listen for more frames. The command will run until one of the timeouts (if any) set up in the command expires or the stop API is used.

Transmit Action

The command is set up as a transmitter by setting the txAxtion field to a non-NULL pointer to a RCL_CmdIeee_TxAction_t struct.

The frame to send is provided as an RCL_Buffer_DataEntry_s struct. No list is used, since only one frame is sent. In order to use the command's start time (if provided) as the transmit time of the frame, use the default settings for the timing inside the TX action.

If rxAction is NULL, the command will end after the frame has been transmitted. In the initial version, this is the only allowed mode of operation.

Architecture

The IEEE 802.15.4 RX and TX command handler has a life cycle that for RX runs until stopped and for TX runs until the frame is transmitted. Future versions will have more options. The operation may also end to to an error.

RCL Event (In) Description
setup Setup has been performed
timerStart Timer-based start signalled
rxBufferUpdateRX buffer has been updated
RCL Event (Out) Description
lastCmdDone The RCL is finished with the command
cmdStarted Command handler has accepted and started executing
rxBufferFinished An RX multi-buffer is finished
rxEntryAvail An RX entry has been made available
LRF Event Description
opDone The PBE operation has finished
opError Something went wrong. Cause located in the PBE ENDCAUSE register
rxOk Frame received with CRC OK and not to be ignored by the MCU
rxNok Frame received with CRC error
txDone Frame transmitted