Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
ca::Command Class Reference

Abstract class for handling command positional arguments, to be implemented by the command classes. More...

#include <posix/app/chilictl/common/Command.hpp>

Inheritance diagram for ca::Command:

Public Member Functions

virtual ca_error Process (int argc, const char *argv[])
 Run the command, processing the arguments passed in argv. More...
 
const char * GetHelpString (void)
 Get the help string for this command. More...
 
const char * GetCommandName (void)
 Get the command name of this command. More...
 

Protected Member Functions

 Command (const char *aCommandName, const char *aHelpString)
 
 ~Command ()
 

Protected Attributes

const char * mCommandName
 
const char * mHelpString
 

Detailed Description

Abstract class for handling command positional arguments, to be implemented by the command classes.

Constructor & Destructor Documentation

◆ Command()

ca::Command::Command ( const char *  aCommandName,
const char *  aHelpString 
)
inlineprotected

◆ ~Command()

ca::Command::~Command ( )
inlineprotected

Member Function Documentation

◆ GetCommandName()

const char* ca::Command::GetCommandName ( void  )
inline

Get the command name of this command.

◆ GetHelpString()

const char* ca::Command::GetHelpString ( void  )
inline

Get the help string for this command.

◆ Process()

virtual ca_error ca::Command::Process ( int  argc,
const char *  argv[] 
)
inlinevirtual

Run the command, processing the arguments passed in argv.

Argv contains the arguments that followed the command name, including the command name as arg0.

Parameters
argcArgument Count
argvArgument Vector (of length argc)
Returns
ca_error value
Return values
CA_ERROR_SUCCESSSuccessful processing
CA_ERROR_INVALID_ARGSInvalid arguments passed to function

Reimplemented in ca::Reboot, ca::Pipe, ca::List, and ca::Flash.

Member Data Documentation

◆ mCommandName

const char* ca::Command::mCommandName
protected

◆ mHelpString

const char* ca::Command::mHelpString
protected

The documentation for this class was generated from the following file: