namespace.h#

This graph shows which files directly or indirectly include namespace.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "4" [label="examples/all_platforms/advanced/GetCommandFromStream/GetCommandFromStream.ino" tooltip="examples/all_platforms/advanced/GetCommandFromStream/GetCommandFromStream.ino"]
    "5" [label="examples/all_platforms/advanced/MultiFile/CLI/cli_setup.h" tooltip="examples/all_platforms/advanced/MultiFile/CLI/cli_setup.h"]
    "6" [label="examples/all_platforms/advanced/MultiFile/CLI/functions.h" tooltip="examples/all_platforms/advanced/MultiFile/CLI/functions.h"]
    "7" [label="examples/all_platforms/advanced/MultiFile/CLI/parameters.h" tooltip="examples/all_platforms/advanced/MultiFile/CLI/parameters.h"]
    "8" [label="examples/all_platforms/advanced/MultiFile/MultiFile.ino" tooltip="examples/all_platforms/advanced/MultiFile/MultiFile.ino"]
    "9" [label="examples/all_platforms/advanced/NMEAparser/NMEAparser.ino" tooltip="examples/all_platforms/advanced/NMEAparser/NMEAparser.ino"]
    "10" [label="examples/all_platforms/advanced/NMEAparser/parser/NMEAparser.h" tooltip="examples/all_platforms/advanced/NMEAparser/parser/NMEAparser.h"]
    "11" [label="examples/all_platforms/advanced/NMEAparser/parser/NMEAsentencefunc.h" tooltip="examples/all_platforms/advanced/NMEAparser/parser/NMEAsentencefunc.h"]
    "12" [label="examples/all_platforms/advanced/NMEAparser/parser/NMEAsentenceparam.h" tooltip="examples/all_platforms/advanced/NMEAparser/parser/NMEAsentenceparam.h"]
    "13" [label="examples/all_platforms/advanced/NestedCommands/NestedCommands.ino" tooltip="examples/all_platforms/advanced/NestedCommands/NestedCommands.ino"]
    "14" [label="examples/all_platforms/advanced/config_howto/config_howto.ino" tooltip="examples/all_platforms/advanced/config_howto/config_howto.ino"]
    "15" [label="examples/all_platforms/advanced/debugging/debugging.ino" tooltip="examples/all_platforms/advanced/debugging/debugging.ino"]
    "16" [label="examples/all_platforms/basic/BLE_UART/BLE_UART.ino" tooltip="examples/all_platforms/basic/BLE_UART/BLE_UART.ino"]
    "17" [label="examples/all_platforms/basic/GetCommandFromStream/GetCommandFromStream.ino" tooltip="examples/all_platforms/basic/GetCommandFromStream/GetCommandFromStream.ino"]
    "18" [label="examples/all_platforms/basic/LoRa/LoRaReceiver/LoRaReceiver.ino" tooltip="examples/all_platforms/basic/LoRa/LoRaReceiver/LoRaReceiver.ino"]
    "19" [label="examples/all_platforms/basic/RF24/RF24.ino" tooltip="examples/all_platforms/basic/RF24/RF24.ino"]
    "20" [label="examples/all_platforms/basic/ReadCommandFromBufferMQTT/ReadCommandFromBufferMQTT.ino" tooltip="examples/all_platforms/basic/ReadCommandFromBufferMQTT/ReadCommandFromBufferMQTT.ino"]
    "21" [label="examples/all_platforms/basic/WildcardCommands/WildcardCommands.ino" tooltip="examples/all_platforms/basic/WildcardCommands/WildcardCommands.ino"]
    "22" [label="examples/esp/ReadCommandFromBufferWebSerial/ReadCommandFromBufferWebSerial.ino" tooltip="examples/esp/ReadCommandFromBufferWebSerial/ReadCommandFromBufferWebSerial.ino"]
    "23" [label="src/InputHandler.cpp" tooltip="src/InputHandler.cpp"]
    "3" [label="src/InputHandler.h" tooltip="src/InputHandler.h"]
    "2" [label="src/config/noedit.h" tooltip="src/config/noedit.h"]
    "1" [label="src/config/utility/namespace.h" tooltip="src/config/utility/namespace.h" fillcolor="#BFBFBF"]
    "5" -> "6" [dir=back tooltip="include"]
    "5" -> "7" [dir=back tooltip="include"]
    "5" -> "8" [dir=back tooltip="include"]
    "6" -> "5" [dir=back tooltip="include"]
    "7" -> "5" [dir=back tooltip="include"]
    "10" -> "9" [dir=back tooltip="include"]
    "11" -> "12" [dir=back tooltip="include"]
    "12" -> "10" [dir=back tooltip="include"]
    "3" -> "4" [dir=back tooltip="include"]
    "3" -> "5" [dir=back tooltip="include"]
    "3" -> "9" [dir=back tooltip="include"]
    "3" -> "10" [dir=back tooltip="include"]
    "3" -> "11" [dir=back tooltip="include"]
    "3" -> "12" [dir=back tooltip="include"]
    "3" -> "13" [dir=back tooltip="include"]
    "3" -> "14" [dir=back tooltip="include"]
    "3" -> "15" [dir=back tooltip="include"]
    "3" -> "16" [dir=back tooltip="include"]
    "3" -> "17" [dir=back tooltip="include"]
    "3" -> "18" [dir=back tooltip="include"]
    "3" -> "19" [dir=back tooltip="include"]
    "3" -> "20" [dir=back tooltip="include"]
    "3" -> "21" [dir=back tooltip="include"]
    "3" -> "22" [dir=back tooltip="include"]
    "3" -> "23" [dir=back tooltip="include"]
    "2" -> "3" [dir=back tooltip="include"]
    "1" -> "2" [dir=back tooltip="include"]
}

InputHandler specific namespaces.

Author

Douglas Quigg (dstroy0 dquigg123@gmail.com)

Version

1.0

Date

2023-02-13

Copyright

Copyright (c) 2023

namespace ih_auto#

InputHandler “auto” type namespace.

The source of macros in this namespace is src/config.h. config src namespace src

The idea behind this namespace is to let users set config.h items to whatever they want, sizing variables for the least amount of space, automatically. The preprocessor evaluates the if macros in a way that will leave typedefs that size type aliases to the minimum byte-width required automatically. It also warns users about the change. The only hand-holding that happens is for type sizing, it’s up to you to make sure you have the resources for your settings. Convenience namespace.

Typedefs

typedef bool type_match_flags#

Input private member type (future bit array)

typedef uint8_t max_cmds_per_tree#

User influenced typedef.

IH_MAX_COMMANDS_PER_TREE is set by the user.

#if (IH_MAX_COMMANDS_PER_TREE <= UINT8_MAX)
typedef uint8_t max_cmds_per_tree;
#elif (IH_MAX_COMMANDS_PER_TREE > UINT8_MAX && IH_MAX_COMMANDS_PER_TREE <= UINT16_MAX)
typedef uint16_t max_cmds_per_tree;
#elif (IH_MAX_COMMANDS_PER_TREE > UINT16_MAX && IH_MAX_COMMANDS_PER_TREE <= UINT32_MAX)
typedef uint32_t max_cmds_per_tree;
#else
// no typedef; compile failure
#endif
typedef uint8_t cmd_id_grp#

User influenced typedef.

IH_MAX_COMMANDS_PER_TREE is set by the user.

#if (IH_MAX_COMMANDS_PER_TREE <= UINT8_MAX)
typedef uint8_t cmd_id_grp;
#elif (IH_MAX_COMMANDS_PER_TREE > UINT8_MAX && IH_MAX_COMMANDS_PER_TREE <= UINT16_MAX)
typedef uint16_t cmd_id_grp;
#elif (IH_MAX_COMMANDS_PER_TREE > UINT16_MAX && IH_MAX_COMMANDS_PER_TREE <= UINT32_MAX)
typedef uint32_t cmd_id_grp;
#else
// no typedef; compile failure
#endif
typedef uint8_t max_args_per_cmd#

User influenced typedef.

IH_MAX_ARGS_PER_COMMAND is set by the user.

#if (IH_MAX_ARGS_PER_COMMAND <= UINT8_MAX)
typedef uint8_t max_args_per_cmd;
#elif (IH_MAX_ARGS_PER_COMMAND > UINT8_MAX && IH_MAX_ARGS_PER_COMMAND <= UINT16_MAX)
typedef uint16_t max_args_per_cmd;
#elif (IH_MAX_ARGS_PER_COMMAND > UINT16_MAX && IH_MAX_ARGS_PER_COMMAND <= UINT32_MAX)
typedef uint32_t max_args_per_cmd;
#else
// no typedef; compile failure
#endif

typedef uint8_t max_tree_depth_per_cmd#

User influenced typedef.

IH_MAX_TREE_DEPTH_PER_COMMAND is set by the user.

#if (IH_MAX_TREE_DEPTH_PER_COMMAND <= UINT8_MAX)
typedef uint8_t max_tree_depth_per_cmd;
#elif (IH_MAX_TREE_DEPTH_PER_COMMAND > UINT8_MAX && IH_MAX_TREE_DEPTH_PER_COMMAND <= UINT16_MAX)
typedef uint16_t max_tree_depth_per_cmd;
#elif (IH_MAX_TREE_DEPTH_PER_COMMAND > UINT16_MAX && IH_MAX_TREE_DEPTH_PER_COMMAND <= UINT32_MAX)
typedef uint32_t max_tree_depth_per_cmd;
#else
// no typedef; compile failure
#endif
typedef uint8_t max_num_child_cmds#

User influenced typedef.

IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT is set by the user.

#if (IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT <= UINT8_MAX)
typedef uint8_t max_num_child_cmds;
#elif (IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT > UINT8_MAX && IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT <=
UINT16_MAX) typedef uint16_t max_num_child_cmds; #elif
(IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT > UINT16_MAX && IH_MAX_NUM_CHILD_COMMANDS_PER_ROOT <=
UINT32_MAX) typedef uint32_t max_num_child_cmds; #else
// no typedef; compile failure
#endif
typedef uint8_t max_cmd_str_len#

User influenced typedef.

IH_MAX_CMD_STR_LEN is set by the user.

#if (IH_MAX_CMD_STR_LEN <= UINT8_MAX)
typedef uint8_t max_cmd_str_len;
#elif (IH_MAX_CMD_STR_LEN > UINT8_MAX && IH_MAX_CMD_STR_LEN <= UINT16_MAX)
typedef uint16_t max_cmd_str_len;
#elif (IH_MAX_CMD_STR_LEN > UINT16_MAX && IH_MAX_CMD_STR_LEN <= UINT32_MAX)
typedef uint32_t max_cmd_str_len;
#else
// no typedef; compile failure
#endif
typedef uint8_t max_num_delim_seq#

User influenced typedef.

IH_MAX_NUM_PROC_DELIM_SEQ is set by the user.

#if (IH_MAX_NUM_PROC_DELIM_SEQ <= UINT8_MAX)
typedef uint8_t max_num_delim_seq;
#elif (IH_MAX_NUM_PROC_DELIM_SEQ > UINT8_MAX && IH_MAX_NUM_PROC_DELIM_SEQ <= UINT16_MAX)
typedef uint16_t max_num_delim_seq;
#elif (IH_MAX_NUM_PROC_DELIM_SEQ > UINT16_MAX && IH_MAX_NUM_PROC_DELIM_SEQ <= UINT32_MAX)
typedef uint32_t max_num_delim_seq;
#else
// no typedef; compile failure
#endif
typedef uint8_t max_num_start_stop_seq#

User influenced typedef.

IH_MAX_NUM_START_STOP_SEQ is set by the user.

#if (IH_MAX_NUM_START_STOP_SEQ <= UINT8_MAX)
typedef uint8_t max_num_start_stop_seq;
#elif (IH_MAX_NUM_START_STOP_SEQ > UINT8_MAX && IH_MAX_NUM_START_STOP_SEQ <= UINT16_MAX)
typedef uint16_t max_num_start_stop_seq;
#elif (IH_MAX_NUM_START_STOP_SEQ > UINT16_MAX && IH_MAX_NUM_START_STOP_SEQ <= UINT32_MAX)
typedef uint32_t max_num_start_stop_seq;
#else
// no typedef; compile failure
#endif
typedef uint8_t max_proc_input_len#

User influenced typedef.

IH_MAX_PROC_INPUT_LEN is set by the user.

#if (IH_MAX_PROC_INPUT_LEN <= UINT8_MAX)
typedef uint8_t max_proc_input_len;
#elif (IH_MAX_PROC_INPUT_LEN > UINT8_MAX && IH_MAX_PROC_INPUT_LEN <= UINT16_MAX)
typedef uint16_t max_proc_input_len;
#elif (IH_MAX_PROC_INPUT_LEN > UINT16_MAX && IH_MAX_PROC_INPUT_LEN <= UINT32_MAX)
typedef uint32_t max_proc_input_len;
#else
// no typedef; compile failure
#endif
typedef uint8_t max_per_root_memcmp_ranges#

User influenced typedef.

IH_MAX_PER_ROOT_MEMCMP_RANGES is set by the user.

#if (IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT8_MAX)
typedef uint8_t max_per_root_memcmp_ranges;
#elif (IH_MAX_PER_ROOT_MEMCMP_RANGES > UINT8_MAX && IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT16_MAX)
typedef uint16_t max_per_root_memcmp_ranges;
#elif (IH_MAX_PER_ROOT_MEMCMP_RANGES > UINT16_MAX && IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT32_MAX)
typedef uint32_t max_per_root_memcmp_ranges;
#else
// no typedef; compile failure
#endif
typedef uint8_t memcmp_idx_t#

User influenced typedef.

IH_MAX_PER_ROOT_MEMCMP_RANGES is set by the user.

#if (IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT8_MAX)
typedef uint8_t memcmp_idx_t;
#elif (IH_MAX_PER_ROOT_MEMCMP_RANGES > UINT8_MAX && IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT16_MAX)
typedef uint16_t memcmp_idx_t;
#elif (IH_MAX_PER_ROOT_MEMCMP_RANGES > UINT16_MAX && IH_MAX_PER_ROOT_MEMCMP_RANGES <= UINT32_MAX)
typedef uint32_t memcmp_idx_t;
#else
// no typedef; compile failure
#endif
namespace ih

User facing namespace.

struct CommandRuntimeCalc#
#include <namespace.h>

Contains arrays and indices determined at runtime.

These structs are associated with wildcard commands; CommandParameters which contains wildcards will have a CommandRuntimeCalc.

Public Members

ih_auto::memcmp_idx_t num_prm_with_wc#

the number of CommandParameters structs in this command that contain char(ih::WildcardChar[0]); the WildCard Character

ih_auto::memcmp_idx_t *idx_of_prm_with_wc#

indices of CommandParameters struct that contain wcc

ih_auto::max_per_root_memcmp_ranges *num_memcmp_ranges_this_row#

the number of memcmp ranges for this Parameters command string, array members always an even number

ih_auto::max_per_root_memcmp_ranges **memcmp_ranges_arr#

2d array[row][col], each [row] is for one Parameters command string which contains wcc

struct DelimiterSequences#
#include <namespace.h>

Holds user defined input data delimiters.

A delimiter sequence is a predefined number or set of numbers that is used to separate input arguments, subcommands or data. The input process needs to know three things about the delimiter sequences you want to use. The number of delimiter sequences there are (up to IH_MAX_NUM_PROC_DELIM_SEQ), the 8-bit byte (char) length of each delimiter sequence, and finally each delimiter sequence which can be up to IH_DELIM_SEQ_PGM_LEN in length.

Public Members

size_t num_seq#

the number of token delimiters in delimiter_sequences

ih_auto::max_num_delim_seq delimiter_lens[IH_MAX_NUM_PROC_DELIM_SEQ]#

delimiter sequence lens delimiter_lens [IH_MAX_NUM_PROC_DELIM_SEQ]

char delimiter_sequences[IH_MAX_NUM_PROC_DELIM_SEQ][IH_DELIM_SEQ_PGM_LEN]#

string-literal “” delimiter sequence array delimiter_sequences [IH_MAX_NUM_PROC_DELIM_SEQ] [IH_DELIM_SEQ_PGM_LEN]

struct InputParameters#
#include <namespace.h>

Collaboration diagram for ih::InputParameters:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="ih::DelimiterSequences" tooltip="ih::DelimiterSequences"]
    "1" [label="ih::InputParameters" tooltip="ih::InputParameters" fillcolor="#BFBFBF"]
    "3" [label="ih::StartStopSequences" tooltip="ih::StartStopSequences"]
    "1" -> "2" [dir=forward tooltip="usage"]
    "1" -> "3" [dir=forward tooltip="usage"]
}

Input process parameters and constructor parameters.

This struct is an array of pointers to other structs/arrays contained in PROGMEM. It’s required by the input process constructor, all together they define the input process behavior.

Public Members

const ProcessName *process_name#

this process’ name, can be NULL; MAX len == IH_PROCESS_NAME_PGM_LEN

const EndOfLineChar *eol_char#

end of line term; MAX len == IH_EOL_SEQ_PGM_LEN

const ControlCharSeq *input_control_char_sequence#

two char len sequence to input a control char

const WildcardChar *wildcard_char#

single char wildcard char

const DelimiterSequences *delimiter_sequences#

reference to ih::DelimiterSequences struct

const StartStopSequences *start_stop_sequences#

reference to ih::StartStopSequences struct

struct StartStopSequences#
#include <namespace.h>

Holds regex-like start-stop match sequence pairs.

A start-stop sequence is a pair of numbers or a pair of a set of numbers which do not have to be identical to one another. The “start” sequence demarcs the beginning of a chunk of data, the “stop” sequence demarcs the end of the chunk of data. The input process needs to know three things about the start-stop sequences you want to use. The number of start-stop sequences there are (up to IH_MAX_NUM_START_STOP_SEQ), the 8-bit byte (char) length of each start-stop sequence, and finally each start-stop sequence which can be up to IH_START_STOP_SEQ_PGM_LEN in length.

Public Members

size_t num_seq#

num start/stop sequences

ih_auto::max_num_start_stop_seq start_stop_sequence_lens[IH_MAX_NUM_START_STOP_SEQ]#

start stop sequence lens start_stop_sequence_lens [IH_MAX_NUM_START_STOP_SEQ]

char start_stop_sequence_pairs[IH_MAX_NUM_START_STOP_SEQ][IH_START_STOP_SEQ_PGM_LEN]#

start/stop sequences. Match start, match end, copy what is between markers start_stop_sequence_pairs [IH_MAX_NUM_START_STOP_SEQ] [IH_START_STOP_SEQ_PGM_LEN]

namespace ihc#

library constants located in PROGMEM.

This namespace’s purpose is to avoid name collision and to consolidate the library’s PROGMEM variables.