Radio CLI application.
More...
#include <zpal_power_manager.h>
#include <zpal_radio.h>
#include <zpal_radio_private.h>
#include <zpal_init.h>
Go to the source code of this file.
Radio CLI application.
SPDX-License-Identifier: LicenseRef-TridentMSLA SPDX-FileCopyrightText: 2024 Trident IoT, LLC https://www.tridentiot.com
◆ APPLICATION_TASK_PRIORITY_STACK
#define APPLICATION_TASK_PRIORITY_STACK ( TASK_PRIORITY_MAX - 10 ) |
High, due to time critical protocol activity.
◆ APPLICATION_TASK_STACK
#define APPLICATION_TASK_STACK 4*1024 |
Allocated memory for the application task stack.
◆ CLI_MAJOR_VERSION
#define CLI_MAJOR_VERSION 0 |
◆ CLI_MINOR_VERSION
#define CLI_MINOR_VERSION 7 |
◆ CLI_PATCH_VERSION
#define CLI_PATCH_VERSION 1 |
◆ DEFAULT_TX_DELAY_MS
#define DEFAULT_TX_DELAY_MS 100 |
Default transmit delay in milliseconds.
◆ RADIO_CLI_SCRIPT_VERSION
#define RADIO_CLI_SCRIPT_VERSION 1 |
◆ event_handler_script_callback_t
typedef void(* event_handler_script_callback_t) (void) |
Script callback called when scripted functionality is done.
◆ rx_callback_t
typedef void(* rx_callback_t) (uint16_t success, uint16_t failed) |
◆ scriptline_t
◆ tx_callback_t
typedef void(* tx_callback_t) (uint16_t success, uint16_t failed, uint16_t failed_lbt) |
◆ radio_cli_script_cmd_t
Script command definitions
Enumerator |
---|
SCRIPT_LIST | List current defined script.
|
SCRIPT_START | Start entering new script.
|
SCRIPT_STOP | Stop current running script.
|
SCRIPT_RUN | Run current defined script.
|
SCRIPT_AUTORUN_ON | Enable auto run of script on start-up.
|
SCRIPT_AUTORUN_OFF | Disable auto run of script on start-up.
|
SCRIPT_CLEAR | Clear current defined script.
|
◆ cli_calibration_change_xtal()
void cli_calibration_change_xtal |
( |
uint16_t | xtal_value | ) |
|
Change the crystal calibration register
◆ cli_calibration_store_xtal()
void cli_calibration_store_xtal |
( |
uint16_t | xtal_cal | ) |
|
Store the crystal calibration in a token
◆ cli_radio_calibration_list()
void cli_radio_calibration_list |
( |
void | | ) |
|
List current active calibration setting and list all available selectable settings
◆ cli_radio_calibration_set()
void cli_radio_calibration_set |
( |
uint8_t | boardno | ) |
|
Set predefined calibration settings available boardno values are 0 - use default radio settings 72, 74-78 use specific predefined settings
- Parameters
-
◆ cli_radio_change_region()
Change the region. This function works both before and after cli_radio_setup
- Parameters
-
[in] | new_region | Region to set. |
- Returns
- true
-
false
◆ cli_radio_clear_stats()
void cli_radio_clear_stats |
( |
bool | clear_tx_timers_stat | ) |
|
Clear Network statitics if clear_tx_time_stat equals false then clear current network statistics if clear_tx_time_stat equals true then clear tx_time statistics
- Parameters
-
◆ cli_radio_convert_zpal_channel_to_internal()
Convert zpal Z-Wave channel_id to internal phy channel_id
- Parameters
-
- Returns
- internal_channel_id
◆ cli_radio_get_rx_count()
uint16_t cli_radio_get_rx_count |
( |
void | | ) |
|
Get the number of received frames
- Returns
- Number of received frames.
◆ cli_radio_get_stats()
Get radio statistics
- Returns
- Network statistics
◆ cli_radio_get_tx_max_power()
int8_t cli_radio_get_tx_max_power |
( |
uint8_t | channel_id | ) |
|
Get current maximum Tx power in dBm on channel_id
- Parameters
-
- Returns
- Maximum Tx Power
◆ cli_radio_get_tx_max_power_20dbm()
bool cli_radio_get_tx_max_power_20dbm |
( |
void | | ) |
|
Get the current Tx max power, 20dBm = true, 14dBm = false
- Returns
- max_tx_power_20dbm
◆ cli_radio_get_tx_min_power()
int8_t cli_radio_get_tx_min_power |
( |
uint8_t | channel_id | ) |
|
Get current minimum Tx power in dBm on channel_id
- Parameters
-
- Returns
- Minimum Tx Power
◆ cli_radio_initialized()
bool cli_radio_initialized |
( |
void | | ) |
|
Returns whether the radio is initialized.
- Returns
- true
-
false
◆ cli_radio_print_statistics()
void cli_radio_print_statistics |
( |
bool | print_extended | ) |
|
List current radio statistic values through cli_uart if print_extended equals true more statistic values are listed through cli_uart
- Parameters
-
◆ cli_radio_region_channel_count_get()
uint8_t cli_radio_region_channel_count_get |
( |
void | | ) |
|
Get channel count for current Region
- Returns
- Channel count
◆ cli_radio_region_current_description_get()
char * cli_radio_region_current_description_get |
( |
void | | ) |
|
Get zero terminated Z-Wave Region name of current Region
- Returns
- char*
◆ cli_radio_region_current_get()
Get current selected Z-Wave region
- Returns
- zpal_radio_region_t
◆ cli_radio_region_list()
Print out current region and print list of supported regions
- Parameters
-
◆ cli_radio_reset_reason_get()
Get last System Reset Reason
- Returns
- zpal_reset_reason
◆ cli_radio_reset_reason_set()
Set current System Reset Reason
- Parameters
-
◆ cli_radio_rf_debug_reg_setting_list()
void cli_radio_rf_debug_reg_setting_list |
( |
bool | listallreg | ) |
|
List current active calibration radio register settings if listallreg equals true more radio register values are listed
- Parameters
-
◆ cli_radio_rf_debug_set()
void cli_radio_rf_debug_set |
( |
bool | rf_state_enable | ) |
|
Set radio rf state on gpios if rf_state_enable equals true device will make Radio show RF state on gpios gpio 0 = rf cpu state (1: cpu awake, 0: sleep) gpio 21 = rf rx (1: rx on, 0: rx off) gpio 28 = rf tx (1: tx on, 0: tx off) if rf_state_enable equals false device will make Radio stop showing RF state on gpios
- Parameters
-
◆ cli_radio_rssi_get()
void cli_radio_rssi_get |
( |
uint8_t | channel_id | ) |
|
Get RSSI measurement on specified channel
- Parameters
-
◆ cli_radio_script()
Script state request. if script_state_request equals SCRIPT_LIST (0) then script is listed if script_state_request equals SCRIPT_START (1) then script entry mode is started and previous script entries are removed if script_state_request equals SCRIPT_STOP (2) then script entry mode is stopped and the entered script is saved in nvm if script_state_request equals SCRIPT_RUN (3) then current script is run if script_state_request equals SCRIPT_AUTORUN_ON (4) then autorun on start-up is set to on if script_state_request equals SCRIPT_AUTORUN_OFF (5) then autorun on start-up is set to off if script_state_request equals SCRIPT_CLEAR (6) then current script is emptied
- Parameters
-
script_state_request | |
script_number | |
◆ cli_radio_script_state_transition_event()
void cli_radio_script_state_transition_event |
( |
void | | ) |
|
Script signal state transition
◆ cli_radio_set_fixed_channel()
void cli_radio_set_fixed_channel |
( |
uint8_t | enable_fixed_channel, |
|
|
uint8_t | channel ) |
Enable or disable fixed Rx channel
- Parameters
-
[in] | enable_fixed_channel | |
[in] | channel | |
◆ cli_radio_set_homeid()
void cli_radio_set_homeid |
( |
uint32_t | home_id | ) |
|
Set the homeID of the receiver filter
- Parameters
-
◆ cli_radio_set_lbt_level()
bool cli_radio_set_lbt_level |
( |
uint8_t | channel_id, |
|
|
int8_t | level ) |
Set LBT level for a given channel
- Parameters
-
- Returns
- true
-
false
◆ cli_radio_set_nodeid()
void cli_radio_set_nodeid |
( |
node_id_t | node_id | ) |
|
Set the nodeID of the receiver filter
- Parameters
-
◆ cli_radio_set_payload_default()
Set Tx payload to a default valid frame for current selected region and tx channel frame points to structure where default valid frame is to be copied to
- Parameters
-
◆ cli_radio_set_tx_max_power_20dbm()
void cli_radio_set_tx_max_power_20dbm |
( |
bool | max_tx_power_20dbm | ) |
|
Set Tx max power 20dBm = true, 14dBm = false
- Parameters
-
◆ cli_radio_setup()
Initialize the radio for the given region
- Parameters
-
◆ cli_radio_start_receive()
bool cli_radio_start_receive |
( |
bool | start_receive | ) |
|
Enable or disable the receiver
- Parameters
-
- Returns
- true
-
false
◆ cli_radio_status_get()
Print current status on uart
◆ cli_radio_timestamp_get()
bool cli_radio_timestamp_get |
( |
void | | ) |
|
Return if timestamp is enabled or disabled on Rx and Tx dump
- Returns
- true/false
◆ cli_radio_timestamp_set()
void cli_radio_timestamp_set |
( |
bool | enable | ) |
|
Enable or disable timestamp on Rx and TX printout
- Parameters
-
◆ cli_radio_transmit_beam_frame()
Transmit beam frame
- Parameters
-
- Returns
- true
-
false
◆ cli_radio_transmit_frame()
Transmit a frame
- Parameters
-
- Returns
- true
-
false
◆ cli_radio_tx_continues_set()
Enable or disable continues unmodulated signal transmission on selected tx channel if enable equals true device will start transmitting a continues unmodulated signal on selected tx channel if enable equals false device will stop transmitting a continues unmodulated signal on selected tx channel
- Parameters
-
◆ cli_radio_tx_option_set()
bool cli_radio_tx_option_set |
( |
uint8_t | option, |
|
|
uint8_t | enable ) |
Set/clear Tx option
- Parameters
-
- Returns
- Tx option set to enable
◆ cli_radio_tx_power_index_list()
void cli_radio_tx_power_index_list |
( |
uint8_t | channel_id | ) |
|
List current Tx power to radio power_index conversion table for channel_id
- Parameters
-
◆ cli_radio_tx_power_index_set()
bool cli_radio_tx_power_index_set |
( |
uint8_t | channel_id, |
|
|
int8_t | txpower, |
|
|
uint8_t | power_index ) |
Set power_index for specified Tx Power
- Parameters
-
channel_id | |
txpower | |
power_index | |
- Returns
- true, if power_index set. false, if power_index not set
◆ cli_radio_version_print()
void cli_radio_version_print |
( |
void | | ) |
|
Print Radio CLI version information on uart
◆ cli_radio_wait()
void cli_radio_wait |
( |
uint32_t | time_ms | ) |
|
Wait time_ms milliseconds before signaling script state transition
- Parameters
-
◆ cli_system_dumpft()
void cli_system_dumpft |
( |
| ) |
|
Dump the FT sector in secure page 0
◆ cli_system_dumpmp()
void cli_system_dumpmp |
( |
| ) |
|
Dump the MP sector in main flash
◆ internal_region_to_channel_config()
Get channel configuration for a region
- Parameters
-
- Returns
- Long Range channel configuration
◆ ZwaveCliTask()
void ZwaveCliTask |
( |
void * | unused_prt | ) |
|
Main task of the CLI application
- Parameters
-