Unify Framework Lib 1.6.0
uic_stdin.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * # License
3 * <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
4 ******************************************************************************
5 * The licensor of this software is Silicon Laboratories Inc. Your use of this
6 * software is governed by the terms of Silicon Labs Master Software License
7 * Agreement (MSLA) available at
8 * www.silabs.com/about-us/legal/master-software-license-agreement. This
9 * software is distributed to you in Source Code format and is governed by the
10 * sections of the MSLA applicable to Source Code.
11 *
12 *****************************************************************************/
13
26#ifndef UIC_STDIN_H
27#define UIC_STDIN_H
28
29// C++ stdlib
30#include <map>
31#include <vector>
32#include <string>
33
34// Unify definitions
35#include "sl_status.h"
36
37// Other component includes
38#include "attribute_store.h"
39
43using handle_args_t = std::vector<std::string>;
44
50using handler_func = sl_status_t (*)(const handle_args_t &arg);
51
57 = std::map<std::string, std::pair<std::string, handler_func>>;
58
67void uic_stdin_add_commands(const command_map_t &append_commands);
68
75void uic_stdin_set_prompt_string(const std::string &des_prompt_string);
76
82
88
98 bool print_total_child_count = false,
99 bool print_only_n_node = false);
100
101#endif
102//UIC_STDIN_HPP
datastore_attribute_id_t attribute_store_node_t
Handle to identify attribute store nodes.
Definition: attribute_store.h:101
std::vector< std::string > handle_args_t
Arguments type.
Definition: uic_stdin.hpp:43
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.
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 comma...
sl_status_t(*)(const handle_args_t &arg) handler_func
Handler function callback type.
Definition: uic_stdin.hpp:50
std::map< std::string, std::pair< std::string, handler_func > > command_map_t
Command map object, used to register a set of functions to handle incoming commands.
Definition: uic_stdin.hpp:57
sl_status_t uic_stdin_handle_command(const char *command)
Run a command manually from CLI.
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 fas...
int uic_stdin_get_output_fd()
Get stdout file number.
uint32_t sl_status_t
Definition: sl_status.h:139
SL Status Codes.