Zigbee Protocol Controller 1.6.0
Unify Stdin

Unify Stdin interface for other applications. More...

Modules

 Unfiy Attribute Store Commands
 Set of Attribute Store commands available by default with the stdin console.
 
 Unfiy Attribute Resolver Commands
 Set of Attribute Resolver commands available by default with the stdin console.
 
 Unfiy Attribute Store Commands
 Set of Attribute Store commands available by default with the stdin console.
 

Typedefs

using handle_args_t = std::vector< std::string >
 Arguments type. More...
 
using handler_func = sl_status_t(*)(const handle_args_t &arg)
 Handler function callback type. More...
 
using command_map_t = std::map< std::string, std::pair< std::string, handler_func > >
 Command map object, used to register a set of functions to handle incoming commands. More...
 

Functions

void uic_stdin_add_commands (const command_map_t &append_commands)
 Add commands to command line interface This function is used at compile time to add commands to command line interface. More...
 
void uic_stdin_set_prompt_string (const std::string &des_prompt_string)
 Set prompt string for command line interface This function sets the prompt string for the CLI. More...
 
int uic_stdin_get_output_fd ()
 Get stdout file number. More...
 
sl_status_t uic_stdin_handle_command (const char *command)
 Run a command manually from CLI. More...
 
sl_status_t unify_stdin_attribute_store_log_node (attribute_store_node_t node, bool print_total_child_count=false, bool print_only_n_node=false)
 Pretty-print a tree of nodes in attribute store. Show nodes' ID, data type and value in a similar fashion to tree command. More...
 
sl_status_t uic_stdin_setup ()
 Unify interface to Contiki STDIN feature. More...
 
int uic_stdin_teardown ()
 Tear down the CLI. More...
 

Detailed Description

Unify Stdin interface for other applications.

Functions enabling adding commands to the CLI and integrating applications speific command prompt.

Typedef Documentation

◆ command_map_t

using command_map_t = std::map<std::string, std::pair<std::string, handler_func> >

Command map object, used to register a set of functions to handle incoming commands.

◆ handle_args_t

using handle_args_t = std::vector<std::string>

Arguments type.

◆ handler_func

using handler_func = sl_status_t (*)(const handle_args_t &arg)

Handler function callback type.

Parameters
argArguments of a command

Function Documentation

◆ uic_stdin_add_commands()

void uic_stdin_add_commands ( const command_map_t append_commands)

Add commands to command line interface This function is used at compile time to add commands to command line interface.

Parameters
append_commandsDictionary with a command name, command usage and a function pointer to command functionality

◆ uic_stdin_get_output_fd()

int uic_stdin_get_output_fd ( )

Get stdout file number.

◆ uic_stdin_handle_command()

sl_status_t uic_stdin_handle_command ( const char *  command)

Run a command manually from CLI.

◆ uic_stdin_set_prompt_string()

void uic_stdin_set_prompt_string ( const std::string &  des_prompt_string)

Set prompt string for command line interface This function sets the prompt string for the CLI.

Parameters
des_prompt_stringThe desired prompt string

◆ uic_stdin_setup()

sl_status_t uic_stdin_setup ( )

Unify interface to Contiki STDIN feature.

Contains setup logic for Unify and some code that would normally be part of the Contiki main loop.

Unify STDIN makes it possible to integrate CLI commands to an existing CLI system running in the Unify part. When integrating Unify in an application the Unify will start a CLI by default.

The Contiki code has been modified to remove the usual STDIN setup logic.

Start and setup CLI process in Unify other.

Starts the CLI process and enables other applications to interface the same CLI.

◆ uic_stdin_teardown()

int uic_stdin_teardown ( )

Tear down the CLI.

Tear down CLI and restore the normal terminal.

◆ unify_stdin_attribute_store_log_node()

sl_status_t unify_stdin_attribute_store_log_node ( attribute_store_node_t  node,
bool  print_total_child_count = false,
bool  print_only_n_node = false 
)

Pretty-print a tree of nodes in attribute store. Show nodes' ID, data type and value in a similar fashion to tree command.

Parameters
nodeA root node to print its attributes and children.
print_total_child_countPrint the number of children for each node.
print_only_n_nodeLimit the number of nodes printed.