1.2.8.1 How the Library Works

RF PHY API Serialization

RF Serial library allow accessing to RF215 Driver API through a serial interface. Library manages commands coming from a serial interface through the USI library. These commands include access to RF Transmission primitives and also access to read/write parameters of the PHY Information Base (PIBs). On the other direction, library sends the received RF frames through the serial interface, as well as the resulting status of a requested transmission or PIB access.

A tool is required at the other side of the serial interface, to send and receive commands. For this purpose, Microchip offers one option:

  • Microchip RF Python Libs. A set of Python libraries that allow easily building scripts on top of them to perform sending, receiving and configuring operations.

Commands Accepted by Library

Serial library accepts commands for RF frame trasnmission and PIB access. The following list describes these commands and their behaviour:

  • SRV_RSERIAL_CMD_PHY_SEND_MSG. This command is followed by a serialized stream that contains the frame to be sent to RF and the transmission paramters. Upon reception of this command, Serial library generates a RF transmission object and requests transmission to the RF215 Driver.

  • SRV_RSERIAL_CMD_PHY_GET_CFG. This command is followed by the identifier of the PIB object to be retrieved. Upon reception of this command, the PIB is retrieved from the RF215 driver and a response command (SRV_RSERIAL_CMD_PHY_GET_CFG_RSP) is generated to send back the value and result of the Get operation.

  • SRV_RSERIAL_CMD_PHY_SET_CFG. This command is followed by the identifier of the PIB object to be set. Upon reception of this command, the PIB is written to the RF215 driver and a response command (SRV_RSERIAL_CMD_PHY_SET_CFG_RSP) is generated to send back the result of the Set operation.

Commands Generated by Library

Serial library generates commands, either by itself or as a response to requested commands, to indicate RF frame reception, RF transmission result and PIB access result. The following list describes these commands and the evenst that generate them:

  • SRV_RSERIAL_CMD_PHY_RECEIVE_MSG. This command is generated upon reception of a RF frame from the RF215 Driver. The command is followed by the received frame and reception related parameters.

  • SRV_RSERIAL_CMD_PHY_SEND_MSG_RSP. This command is generated upon confirm of a transmitted (or aborted trasnsmission) RF frame from the RF215 Driver. The command is followed by the transmission result or the error code in case of transmission failure.

  • SRV_RSERIAL_CMD_PHY_GET_CFG_RSP. This command is generated as a response to a PIB Get command (SRV_RSERIAL_CMD_PHY_GET_CFG) and is follwed by the Get operation result and (if successful) the retrieved value of the Get operation.

  • SRV_RSERIAL_CMD_PHY_SET_CFG_RSP. This command is generated as a response to a PIB Set command (SRV_RSERIAL_CMD_PHY_SET_CFG) and is follwed by the Set operation result.