OS  v1.7.5
Documentation
Loading...
Searching...
No Matches
qOS::cli::handler_t Class Referencefinal

The command argument with all the regarding information of the incoming AT command. More...

#include <cli.hpp>

Public Member Functions

commandType getType (void) const
 Retrieve the he incoming command type.*.
 
char * getStringData (void)
 The string data received after the detected command.
 
void * getData (void)
 Retrieve a pointer to the user-defined data - Storage Pointer.
 
size_t getStringLength (void) const
 The length of the stringStrData.
 
size_t getNumArgs (void) const
 Retrieve the number of arguments of the incoming AT command. only available if Type = commandType::PARA.
 
char * getArgPtr (index_t n) const
 Helper method to get the pointer where the desired argument starts.
 
int getArgInt (index_t n) const
 Helper method to get the n argument parsed as integer from the incoming AT command.
 
float32_t getArgFloat (index_t n) const
 Helper method to get the n argument parsed as float from the incoming AT command.
 
uint32_t getArgHex (index_t n) const
 Helper method to get the n HEX argument parsed uint32_t from the incoming AT command.
 
char * getArgString (index_t n, char *pOut)
 Helper method to get the n argument parsed as string from the incoming AT command.
 
void writeOut (const char c) const
 Helper method for printing a character to the CLI output. It displays only one character at a time.
 
void writeOut (const char *s) const
 Writes a string to CLI output without the EOF string appended at the end.
 
commandthisCommand (void) noexcept
 return the instance of command being evaluated
 

Public Attributes

char * output
 The CLI output buffer. Can be written by the user.
 

Detailed Description

The command argument with all the regarding information of the incoming AT command.

From the callback context, can be used to print out extra information as a command response, parse the command parameters, and query properties with crucial information about the detected command, like the type, the number of arguments, and the subsequent string after the command text.

Note
Should be used only in command-callbacks as the only input argument.

Member Function Documentation

◆ getArgFloat()

float32_t qOS::cli::handler_t::getArgFloat ( index_t n) const

Helper method to get the n argument parsed as float from the incoming AT command.

See also
util::stringToFloat()
Parameters
[in]nThe number of the argument
Returns
The argument parsed as Float. Same behavior of util::stringToFloat(). If argument not found returns 0.0f

◆ getArgHex()

uint32_t qOS::cli::handler_t::getArgHex ( index_t n) const

Helper method to get the n HEX argument parsed uint32_t from the incoming AT command.

See also
util::hexStringToUnsigned()
Parameters
[in]nThe number of the argument
Returns
The HEX argument parsed as uint32_t. Same behavior of util::hexStringToUnsigned()(). If argument not found returns 0.

◆ getArgInt()

int qOS::cli::handler_t::getArgInt ( index_t n) const

Helper method to get the n argument parsed as integer from the incoming AT command.

See also
util::stringToInteger()
Parameters
[in]nThe number of the argument
Returns
The argument parsed as integer. Same behavior of util::stringToInteger(). If argument not found returns 0.

◆ getArgPtr()

char * qOS::cli::handler_t::getArgPtr ( index_t n) const

Helper method to get the pointer where the desired argument starts.

Parameters
[in]nThe number of the argument
Returns
A pointer to the desired argument. NULL pointer if the argument is not present.

◆ getArgString()

char * qOS::cli::handler_t::getArgString ( index_t n,
char * pOut )

Helper method to get the n argument parsed as string from the incoming AT command.

Parameters
[in]nThe number of the argument
[out]pOutArray in memory where to store the resulting null-terminated string.
Returns
Same as out on success, otherwise returns nullptr.

◆ getData()

void * qOS::cli::handler_t::getData ( void )
inline

Retrieve a pointer to the user-defined data - Storage Pointer.

Returns
A pointer to the user-defined data.

◆ getNumArgs()

size_t qOS::cli::handler_t::getNumArgs ( void ) const
inline

Retrieve the number of arguments of the incoming AT command. only available if Type = commandType::PARA.

Returns
The number of arguments of the incoming AT command

◆ getStringData()

char * qOS::cli::handler_t::getStringData ( void )
inline

The string data received after the detected command.

Returns
The string data

◆ getStringLength()

size_t qOS::cli::handler_t::getStringLength ( void ) const
inline

The length of the stringStrData.

◆ getType()

commandType qOS::cli::handler_t::getType ( void ) const
inline

Retrieve the he incoming command type.*.

Returns
The command type.

◆ thisCommand()

command & qOS::cli::handler_t::thisCommand ( void )
inlinenoexcept

return the instance of command being evaluated

Returns
The command instance.

◆ writeOut() [1/2]

void qOS::cli::handler_t::writeOut ( const char * s) const

Writes a string to CLI output without the EOF string appended at the end.

Parameters
[in]sThis is the C string to be written.

◆ writeOut() [2/2]

void qOS::cli::handler_t::writeOut ( const char c) const

Helper method for printing a character to the CLI output. It displays only one character at a time.

Parameters
[in]cThe ASCII character.

Member Data Documentation

◆ output

char* qOS::cli::handler_t::output

The CLI output buffer. Can be written by the user.