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.
Data Structures | |
struct | radio_cli_tx_frame_config_t |
Frame configuration. More... | |
struct | _scriptline_t_ |
Macros | |
#define | CLI_MAJOR_VERSION 0 |
CLI major version. | |
#define | CLI_MINOR_VERSION 7 |
CLI minor version. | |
#define | CLI_PATCH_VERSION 4 |
CLI patch version. | |
#define | RADIO_CLI_SCRIPT_VERSION 1 |
RadioCLI script version. | |
#define | APPLICATION_TASK_STACK 4*1024 |
Allocated memory for the application task stack. | |
#define | APPLICATION_TASK_PRIORITY_STACK ( TASK_PRIORITY_MAX - 10 ) |
High, due to time critical protocol activity. | |
#define | DEFAULT_TX_DELAY_MS 100 |
Default transmit delay in milliseconds. | |
Typedefs | |
typedef void(* | tx_callback_t) (uint16_t success, uint16_t failed, uint16_t failed_lbt) |
Transmit callback. | |
typedef void(* | rx_callback_t) (uint16_t success, uint16_t failed) |
Receive callback. | |
typedef void(* | event_handler_script_callback_t) (void) |
typedef struct _scriptline_t_ | scriptline_t |
Enumerations | |
enum | radio_cli_script_cmd_t { SCRIPT_LIST = 0 , SCRIPT_START , SCRIPT_STOP , SCRIPT_RUN , SCRIPT_AUTORUN_ON , SCRIPT_AUTORUN_OFF , SCRIPT_CLEAR } |
Radio CLI application.
SPDX-License-Identifier: LicenseRef-TridentMSLA SPDX-FileCopyrightText: 2024 Trident IoT, LLC https://www.tridentiot.com
#define APPLICATION_TASK_PRIORITY_STACK ( TASK_PRIORITY_MAX - 10 ) |
High, due to time critical protocol activity.
#define APPLICATION_TASK_STACK 4*1024 |
Allocated memory for the application task stack.
#define CLI_MAJOR_VERSION 0 |
CLI major version.
#define CLI_MINOR_VERSION 7 |
CLI minor version.
#define CLI_PATCH_VERSION 4 |
CLI patch version.
#define DEFAULT_TX_DELAY_MS 100 |
Default transmit delay in milliseconds.
#define RADIO_CLI_SCRIPT_VERSION 1 |
RadioCLI script version.
typedef void(* event_handler_script_callback_t) (void) |
Script callback called when scripted functionality is done.
typedef void(* rx_callback_t) (uint16_t success, uint16_t failed) |
Receive callback.
typedef struct _scriptline_t_ scriptline_t |
Script line definition
typedef void(* tx_callback_t) (uint16_t success, uint16_t failed, uint16_t failed_lbt) |
Transmit callback.
Script command definitions
void cli_calibration_change_xtal | ( | uint16_t | xtal_value | ) |
Change the crystal calibration register
void cli_calibration_read_xtal | ( | uint16_t * | xtal_cal | ) |
Read the crystal calibration from a token
void cli_calibration_read_xtal_sec_reg | ( | uint16_t * | xtal_cal | ) |
Read the crystal calibration from the FLASH security registers
void cli_calibration_store_xtal | ( | uint16_t | xtal_cal | ) |
Store the crystal calibration in a token
void cli_calibration_store_xtal_sec_reg | ( | uint16_t | xtal_cal | ) |
Store the crystal calibration in a FLASH security registers
void cli_radio_calibration_list | ( | void | ) |
List current active calibration setting and list all available selectable settings
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
boardno |
bool cli_radio_change_region | ( | zpal_radio_region_t | new_region | ) |
Change the region. This function works both before and after cli_radio_setup
[in] | new_region | Region to set. |
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
[in] | clear_tx_timers_stat |
uint8_t cli_radio_convert_zpal_channel_to_internal | ( | zpal_radio_zwave_channel_t | zwave_channel_id | ) |
Convert zpal Z-Wave channel_id to internal phy channel_id
zwave_channel_id |
uint16_t cli_radio_get_rx_count | ( | void | ) |
Get the number of received frames
zpal_radio_network_stats_t * cli_radio_get_stats | ( | void | ) |
Get radio statistics
int8_t cli_radio_get_tx_max_power | ( | uint8_t | channel_id | ) |
Get current maximum Tx power in dBm on channel_id
channel_id |
bool cli_radio_get_tx_max_power_20dbm | ( | void | ) |
Get the current Tx max power, 20dBm = true, 14dBm = false
int8_t cli_radio_get_tx_min_power | ( | uint8_t | channel_id | ) |
Get current minimum Tx power in dBm on channel_id
channel_id |
bool cli_radio_initialized | ( | void | ) |
Returns whether the radio is initialized.
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
print_extended |
uint8_t cli_radio_region_channel_count_get | ( | void | ) |
Get channel count for current Region
char * cli_radio_region_current_description_get | ( | void | ) |
Get zero terminated Z-Wave Region name of current Region
zpal_radio_region_t cli_radio_region_current_get | ( | void | ) |
Get current selected Z-Wave region
void cli_radio_region_list | ( | zpal_radio_region_t | region | ) |
Print out current region and print list of supported regions
[in] | region |
void cli_radio_reset | ( | void | ) |
System reset Uses watchdog to reset system Resetcounter is set to 1
zpal_reset_reason_t cli_radio_reset_reason_get | ( | void | ) |
Get last System Reset Reason
void cli_radio_reset_reason_set | ( | zpal_reset_reason_t | reset_reason | ) |
Set current System Reset Reason
reset_reason |
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
listallreg |
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
rf_state_enable |
void cli_radio_rssi_config_get | ( | uint16_t * | rssi_sample_frequency, |
uint8_t * | rssi_sample_count_average ) |
Get RSSI measurement configuration *rssi_sample_frequency will be updated with current RSSI sample frequency *rssi_sample_count_average will be updated with current RSSI sample count average
rssi_sample_frequency | |
rssi_sample_count_average |
void cli_radio_rssi_config_set | ( | uint16_t | rssi_sample_frequency, |
uint8_t | rssi_sample_count_average ) |
Congigure RSSI measurement configure radio to do RSSI sample every rssi_sample_frequency channel scan cycles configure radio to use rssi_sample_count_average RSSI samples for generating resulting RSSI average rssi_sample_frequency and rssi_sample_count_average are only used when doing Rx channel scanning
rssi_sample_frequency | |
rssi_sample_count_average |
void cli_radio_rssi_get | ( | uint8_t | channel_id, |
uint32_t | repeats, | ||
uint32_t | delay ) |
Get RSSI measurement on specified channel if repeats equals 0 or 1 then only one RSSI value is read if repeats is greater than 1 then RSSI value is read repeats times with delay ms in between
channel_id | |
repeats | |
delay |
void cli_radio_rssi_get_all | ( | uint32_t | repeats, |
uint32_t | delay ) |
Get RSSI measurement on all channels in current region if repeats equals 0 or 1 then only one RSSI value is read if repeats is greater than 1 then RSSI value is read repeats times with delay ms in between
repeats | |
delay |
void cli_radio_script | ( | radio_cli_script_cmd_t | script_state_request, |
int8_t | script_number ) |
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
script_state_request | |
script_number |
void cli_radio_script_state_transition_event | ( | void | ) |
Script signal state transition
void cli_radio_set_fixed_channel | ( | uint8_t | enable_fixed_channel, |
uint8_t | channel_id ) |
Enable or disable fixed Rx channel
[in] | enable_fixed_channel | |
[in] | channel_id |
void cli_radio_set_homeid | ( | uint32_t | home_id | ) |
Set the homeID of the receiver filter
[in] | home_id | Home ID |
bool cli_radio_set_lbt_level | ( | uint8_t | channel_id, |
int8_t | level ) |
Set LBT level for a given channel
[in] | channel_id | |
[in] | level |
void cli_radio_set_nodeid | ( | node_id_t | node_id | ) |
Set the nodeID of the receiver filter
[in] | node_id | Node ID |
void cli_radio_set_payload_default | ( | radio_cli_tx_frame_config_t * | frame | ) |
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
frame |
void cli_radio_set_tx_max_power_20dbm | ( | bool | max_tx_power_20dbm | ) |
Set Tx max power 20dBm = true, 14dBm = false
[in] | max_tx_power_20dbm |
void cli_radio_setup | ( | zpal_radio_region_t | eRegion | ) |
Initialize the radio for the given region
[in] | eRegion |
bool cli_radio_start_receive | ( | bool | start_receive | ) |
Enable or disable the receiver
[in] | start_receive |
void cli_radio_status_get | ( | const radio_cli_tx_frame_config_t *const | tx_frame_config | ) |
Print current status on uart
bool cli_radio_timestamp_get | ( | void | ) |
Return if timestamp is enabled or disabled on Rx and Tx dump
void cli_radio_timestamp_set | ( | bool | enable | ) |
Enable or disable timestamp on Rx and TX printout
enable |
bool cli_radio_transmit_beam_frame | ( | const radio_cli_tx_frame_config_t *const | tx_frame_config | ) |
Transmit beam frame
[in] | tx_frame_config |
bool cli_radio_transmit_frame | ( | const radio_cli_tx_frame_config_t *const | tx_frame_config | ) |
Transmit a frame
[in] | tx_frame_config |
void cli_radio_tx_continues_set | ( | bool | enable, |
radio_cli_tx_frame_config_t * | frame ) |
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
enable | |
frame |
bool cli_radio_tx_option_set | ( | uint8_t | option, |
uint8_t | enable ) |
Set/clear Tx option
option | |
enable |
void cli_radio_tx_power_index_list | ( | uint8_t | channel_id | ) |
List current Tx power to radio power_index conversion table for channel_id
channel_id |
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
channel_id | |
txpower | |
power_index |
void cli_radio_version_print | ( | void | ) |
Print Radio CLI version information on uart
void cli_radio_wait | ( | uint32_t | time_ms | ) |
Wait time_ms milliseconds before signaling script state transition
time_ms |
void cli_system_dumpft | ( | void | ) |
Dump the FT sector in secure page 0
void cli_system_dumpmp | ( | void | ) |
Dump the MP sector in main flash
void cli_system_dumpuft | ( | ) |
Dump the user FT sector in secure page 1
zpal_radio_lr_channel_config_t internal_region_to_channel_config | ( | zpal_radio_region_t | region | ) |
Get channel configuration for a region
region |
void ZwaveCliTask | ( | void * | unused_prt | ) |
Main task of the CLI application
[in] | unused_prt |