Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
radio_cli_app.h File Reference

Radio CLI application. More...

#include <zpal_power_manager.h>
#include <zpal_radio.h>
#include <zpal_radio_private.h>
#include <zpal_init.h>
+ Include dependency graph for radio_cli_app.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   1
 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
}
 

Functions

void ZwaveCliTask (void *unused_prt)
 
void cli_radio_version_print (void)
 
void cli_radio_status_get (const radio_cli_tx_frame_config_t *const tx_frame_config)
 
void cli_radio_setup (zpal_radio_region_t eRegion)
 
bool cli_radio_change_region (zpal_radio_region_t new_region)
 
void cli_radio_region_list (zpal_radio_region_t region)
 
void cli_radio_set_homeid (uint32_t home_id)
 
void cli_radio_set_nodeid (node_id_t node_id)
 
bool cli_radio_transmit_frame (const radio_cli_tx_frame_config_t *const tx_frame_config)
 
bool cli_radio_transmit_beam_frame (const radio_cli_tx_frame_config_t *const tx_frame_config)
 
bool cli_radio_start_receive (bool start_receive)
 
uint16_t cli_radio_get_rx_count (void)
 
bool cli_radio_set_lbt_level (uint8_t channel_id, int8_t level)
 
void cli_radio_set_tx_max_power_20dbm (bool max_tx_power_20dbm)
 
bool cli_radio_get_tx_max_power_20dbm (void)
 
int8_t cli_radio_get_tx_min_power (uint8_t channel_id)
 
int8_t cli_radio_get_tx_max_power (uint8_t channel_id)
 
bool cli_radio_tx_power_index_set (uint8_t channel_id, int8_t txpower, uint8_t power_index)
 
void cli_radio_tx_power_index_list (uint8_t channel_id)
 
void cli_radio_set_fixed_channel (uint8_t enable_fixed_channel, uint8_t channel)
 
uint8_t cli_radio_region_channel_count_get (void)
 
zpal_radio_network_stats_tcli_radio_get_stats (void)
 
void cli_radio_clear_stats (bool clear_tx_timers_stat)
 
bool cli_radio_initialized (void)
 
void cli_radio_script (radio_cli_script_cmd_t script_state_request, int8_t script_number)
 
void cli_radio_script_state_transition_event (void)
 
void cli_radio_wait (uint32_t time_ms)
 
void cli_radio_timestamp_set (bool enable)
 
bool cli_radio_timestamp_get (void)
 
void cli_radio_tx_continues_set (bool enable, radio_cli_tx_frame_config_t *frame)
 
bool cli_radio_tx_option_set (uint8_t option, uint8_t enable)
 
void cli_radio_rf_debug_set (bool rf_state_enable)
 
void cli_radio_calibration_set (uint8_t boardno)
 
void cli_radio_calibration_list (void)
 
void cli_radio_rf_debug_reg_setting_list (bool listallreg)
 
void cli_radio_rssi_get (uint8_t channel_id)
 
void cli_radio_print_statistics (bool print_extended)
 
void cli_radio_set_payload_default (radio_cli_tx_frame_config_t *frame)
 
zpal_radio_lr_channel_config_t internal_region_to_channel_config (zpal_radio_region_t region)
 
zpal_radio_region_t cli_radio_region_current_get (void)
 
char * cli_radio_region_current_description_get (void)
 
uint8_t cli_radio_convert_zpal_channel_to_internal (zpal_radio_zwave_channel_t zwave_channel_id)
 
zpal_reset_reason_t cli_radio_reset_reason_get (void)
 
void cli_radio_reset_reason_set (zpal_reset_reason_t reset_reason)
 
void cli_system_dumpft ()
 
void cli_system_dumpmp ()
 
void cli_calibration_change_xtal (uint16_t xtal_value)
 
void cli_calibration_store_xtal (uint16_t xtal_cal)
 

Detailed Description

Radio CLI application.


SPDX-License-Identifier: LicenseRef-TridentMSLA SPDX-FileCopyrightText: 2024 Trident IoT, LLC https://www.tridentiot.com


Macro Definition Documentation

◆ 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 major version.

◆ CLI_MINOR_VERSION

#define CLI_MINOR_VERSION   7

CLI minor version.

◆ CLI_PATCH_VERSION

#define CLI_PATCH_VERSION   1

CLI patch version.

◆ 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

RadioCLI script version.

Typedef Documentation

◆ 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)

Receive callback.

◆ scriptline_t

typedef struct _scriptline_t_ scriptline_t

Script line definition

◆ tx_callback_t

typedef void(* tx_callback_t) (uint16_t success, uint16_t failed, uint16_t failed_lbt)

Transmit callback.

Enumeration Type Documentation

◆ 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.

Function Documentation

◆ 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
boardno

◆ cli_radio_change_region()

bool cli_radio_change_region ( zpal_radio_region_t new_region)

Change the region. This function works both before and after cli_radio_setup

Parameters
[in]new_regionRegion 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
[in]clear_tx_timers_stat

◆ cli_radio_convert_zpal_channel_to_internal()

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

Parameters
zwave_channel_id
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()

zpal_radio_network_stats_t * cli_radio_get_stats ( void )

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
channel_id
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
channel_id
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
print_extended

◆ 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()

zpal_radio_region_t cli_radio_region_current_get ( void )

Get current selected Z-Wave region

Returns
zpal_radio_region_t

◆ cli_radio_region_list()

void cli_radio_region_list ( zpal_radio_region_t region)

Print out current region and print list of supported regions

Parameters
[in]region

◆ cli_radio_reset_reason_get()

zpal_reset_reason_t cli_radio_reset_reason_get ( void )

Get last System Reset Reason

Returns
zpal_reset_reason

◆ cli_radio_reset_reason_set()

void cli_radio_reset_reason_set ( zpal_reset_reason_t reset_reason)

Set current System Reset Reason

Parameters
reset_reason

◆ 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
listallreg

◆ 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
rf_state_enable

◆ cli_radio_rssi_get()

void cli_radio_rssi_get ( uint8_t channel_id)

Get RSSI measurement on specified channel

Parameters
channel_id

◆ cli_radio_script()

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

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
[in]home_idHome ID

◆ 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
[in]channel_id
[in]level
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
[in]node_idNode ID

◆ cli_radio_set_payload_default()

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

Parameters
frame

◆ 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
[in]max_tx_power_20dbm

◆ cli_radio_setup()

void cli_radio_setup ( zpal_radio_region_t eRegion)

Initialize the radio for the given region

Parameters
[in]eRegion

◆ cli_radio_start_receive()

bool cli_radio_start_receive ( bool start_receive)

Enable or disable the receiver

Parameters
[in]start_receive
Returns
true
false

◆ cli_radio_status_get()

void cli_radio_status_get ( const radio_cli_tx_frame_config_t *const tx_frame_config)

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
enable

◆ cli_radio_transmit_beam_frame()

bool cli_radio_transmit_beam_frame ( const radio_cli_tx_frame_config_t *const tx_frame_config)

Transmit beam frame

Parameters
[in]tx_frame_config
Returns
true
false

◆ cli_radio_transmit_frame()

bool cli_radio_transmit_frame ( const radio_cli_tx_frame_config_t *const tx_frame_config)

Transmit a frame

Parameters
[in]tx_frame_config
Returns
true
false

◆ cli_radio_tx_continues_set()

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

Parameters
enable
frame

◆ cli_radio_tx_option_set()

bool cli_radio_tx_option_set ( uint8_t option,
uint8_t enable )

Set/clear Tx option

Parameters
option
enable
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
channel_id

◆ 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
time_ms

◆ 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()

zpal_radio_lr_channel_config_t internal_region_to_channel_config ( zpal_radio_region_t region)

Get channel configuration for a region

Parameters
region
Returns
Long Range channel configuration

◆ ZwaveCliTask()

void ZwaveCliTask ( void * unused_prt)

Main task of the CLI application

Parameters
[in]unused_prt