RAIL_lib API Usage for Mode Switch PPDU#
The following figure provides details about how the RAIL_lib API is used by RAILtest to send/receive a mode switch PPDU followed by a data packet on the new channel. For each RAILtest command taken from the example script in section Script Example, RAILtest behavior and especially the calls to the RAIL_lib API are explained. It also clarifies the most significant actions performed by RAIL_lib for the mode switch.
Notes:
RAIL checks the first bit of the PHR to know if it is Mode Switch PPDU. If Mode Switch is not enabled through
ieee802154Enable()
function, then the Mode Switch PPDU is deleted and not processed.The channel mask defined in Wi-SUN FAN 1.1 is managed at the stack level through the callback used by
RAIL RAILCb_IEEE802154_isModeSwitchNewChannelValid()
as shown above.
RAIL_lib structures used for mode switch:
RAIL_IEEE802154_Config_t: This configuration structure is used to initialize IEEE802.15.4 features, which is required to use mode switch. It is defined in the rail_ieee802154.h file and an example of initialization by RAILtest can be found in railtest/app_ci/154_rx_ci.c file in the
ieee802154Enable()
function.RAIL_IEEE802154_ModeSwitchPhr_t: This structure contains a PHYModeID and the corresponding mode switch PHR. It is defined in the rail_ieee802154.h file.
The rail_config.c file contains a RAIL_IEEE802154_ModeSwitchPhr_t table (wisun_modeSwitchPhrs) which is used to format a mode switch packet by writing the mode switch PHR corresponding to the new channel PHYModeId. An example of mode switch packet formatting can be found in railtest/app_ci/154_rx_ci.c file in the trigModeSwitchTx()
function. The mode switch PHR is described in on Wi-SUN PHY Technical Profile Specification 2V00.
When a Mode switch configuration is saved in radio_settings.radioconf, then the generated rail_config.c should contain a constant table RAIL_IEEE802154_ModeSwitchPhr_t wisun_modeSwitchPhrs
with the selected PhyModeID, as shown in the following example.