Radio Control Layer (RCL)
|
As previously mentioned, an important part of the RCL command life-cycle is what is known as the command handler. The command handler is a self-contained finite state machine that takes care of the command parameters, the payload, and the interrupt handling needed during the execution of the command (i.e. the interrupts coming from the radio and the SYSTIM). In simple terms, it is the piece of code takes care of protocol specific operations (e.g. BLE advertising), and interacts directly with the LRF.
The following section provides an introduction to their usage and common characteristics. For more protocol specific information, see the following pages:
Command handlers are configured at the application level through the use of command structs. The user will normally first declare a command of a specific type (e.g. RCL_CMD_GENERIC_TX_t or ::RCL_CMD_BLE5_ADV), and then configure the command handler by updating the fields in the command struct.
As expected, the command struct will mostly include protocol specific configuration. Nevertheless, there are some configuration fields which are common to all command handlers (RCL_Command_s).
Part of the configuration fields common to all command handlers is the runtime information (RCL_CommandRuntime_s) and the timing information (RCL_CommandTiming_s).
The runtime information among other things allows to enable callbacks for events that come directly from the LRF or for events generated by the RCL. That is, the callback will be executed only when the appropriate event is set.
The timing information on the other hand allows to configure the start time (unless RCL_Schedule_Now is used), and also stop times (graceful and hard) of the command.
Regardless of the protocol, the interaction between the RCL and the command handler requires four elements.
The following diagram illustrates in a simplified way how the state machine in a command handler might look:
The internal packet format refers to how packets are stored in the LRF FIFOs, and it's particularly important since regardless of the communication protocol used, the structure for both transmitted and received packet entries must be compatible with the format.
The following rules apply to the internal packet format:
As an example, a correct packet entry for a BLE packet for transmission (or reception with no extra bytes) will be: