Radio Control Layer (RCL)
|
A PTX device normally acts as the main transmitter in an NESB network. Depending on user configuration, the handler acts similarly to the Generic Tx Command handler, or it can add automatic retransmission of unacknowledged packets.
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 a PTX command, the following steps must have taken place:
Once these steps have been completed, RCL_Command_submit and RCL_Command_pend are called to effectively send a packet and then wait for the command to conclude.
As with any command handler, the application must built packets so that they are compatible with the internal packet format used in the LRF. Having said this, NESB packets also have a specific packet format that needs to be considered at the application level.
This can be accomplished by using a struct to define the various fields that need to be considered when building or checking the content of the packet.
Taking this into consideration, packet generation needs to consider how the 11-bit header is placed in the LRF FIFO. the following function shows one way to accomplish this:
Command configuration and submitting is similar to generic command handlers.
The NESB Ptx command handler has a life cycle that depends on several things. If configuration is such that an acknowledgement is expected, the device will automatically switch from Tx mode to Rx mode to listen for an acknowledge coming from an associated PRX device in the network. Furthermore, if retransmission of unacknowledged packets is enabled, the PTX command handler will automatically switch back and forth between Tx mode and Rx mode in order to retransmit the packet. This will go on for a user-defined number of times and with a user-defined retransmission delay. If a valid acknowledgement is received, or if a packet is transmitted and no acknowledgement is expected, the command will conclude not before incrementing a sequence number that is used by the PRX device to differentiate between new packets and retransmitted packets.
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.
RCL Event (In) | Description |
---|---|
setup | Setup has been performed |
timerStart | Timer-based start signalled |
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 | Packet received with CRC OK and not to be ignored by the MCU |
rxNok | Packet received with CRC error |