OS  v1.7.5
Documentation
Loading...
Searching...
No Matches
AT Command Line Interface

API for the AT Command Line Interface extension. More...

Collaboration diagram for AT Command Line Interface:

Namespaces

namespace  qOS::cli
 AT command line interfaces.
 

Classes

class  qOS::cli::handler_t
 The command argument with all the regarding information of the incoming AT command. More...
 
class  qOS::cli::command
 An AT-Command object. More...
 
class  qOS::commandLineInterface
 An AT Command Line Interface (CLI) object. More...
 

Typedefs

using qOS::cli::commandCallback_t
 Pointer to function : An AT-Command callback.
 
using qOS::cli::options_t
 A typedef that holds the options for an AT-Command object.
 

Enumerations

enum  qOS::cli::response : int16_t {
  qOS::cli::ERROR , qOS::cli::NOT_ALLOWED , qOS::cli::NO_RESPONSE , qOS::cli::OK ,
  qOS::cli::DEVID , qOS::cli::NOT_FOUND , qOS::cli::OUTPUT_RESPONSE
}
 an enumeration to define the possible values that can be returned from the callback of a command. More...
 
enum  qOS::cli::commandType : uint16_t {
  qOS::cli::UNDEF , qOS::cli::PARA , qOS::cli::TEST , qOS::cli::READ ,
  qOS::cli::ACT
}
 An enum to describe the available AT command types. More...
 

Functions

constexpr response qOS::cli::ERROR_CODE (int16_t code)
 Used to indicate an error code as return value inside a command-callback. This code is defined by the application writer and should be a value between 1 and 32766.
 
bool qOS::core::add (task &Task, commandLineInterface &cli, const priority_t p, void *arg=nullptr) noexcept
 Add a task to the scheduling scheme running an AT Command Line Interface. Task will be scheduled as event-triggered task. The parser address will be stored in the event_t::TaskData storage-Pointer.
 

Detailed Description

API for the AT Command Line Interface extension.

Typedef Documentation

◆ commandCallback_t

Pointer to function : An AT-Command callback.

Example :

cli::response commandCallback_example( cli::handler_t h ) {
switch ( h.getType() ) {
h.output( "Test message" );
retValue = cli::response::OK;
break;
default:
break;
}
return retValue;
}
The command argument with all the regarding information of the incoming AT command.
Definition cli.hpp:93
commandType getType(void) const
Retrieve the he incoming command type.*.
Definition cli.hpp:110
char * output
The CLI output buffer. Can be written by the user.
Definition cli.hpp:205
response
an enumeration to define the possible values that can be returned from the callback of a command.
Definition cli.hpp:30
@ ERROR
Definition cli.hpp:31
@ OK
Definition cli.hpp:34
@ ACT
Definition cli.hpp:62
Parameters
hA reference to the CLI command handler instance
Returns
The command response.

◆ options_t

A typedef that holds the options for an AT-Command object.

Enumeration Type Documentation

◆ commandType

enum qOS::cli::commandType : uint16_t

An enum to describe the available AT command types.

Enumerator
UNDEF 

Was not able to detected a correct input command

PARA 

Command that receives parameters (comma separated arguments after the equal(=) symbol) : "AT+cmd=x,y"

TEST 

Command in test mode (no arguments allowed): "AT+cmd=?"

READ 

Command to query information(data allowed after the ? symbol) : "AT+cmd?"

ACT 

Command to perform an action (no arguments allowed) : AT+cmd

◆ response

enum qOS::cli::response : int16_t

an enumeration to define the possible values that can be returned from the callback of a command.

Enumerator
ERROR 
NOT_ALLOWED 
NO_RESPONSE 
OK 
DEVID 
NOT_FOUND 
OUTPUT_RESPONSE 

Function Documentation

◆ add()

bool qOS::core::add ( task & Task,
commandLineInterface & cli,
const priority_t p,
void * arg = nullptr )
noexcept

Add a task to the scheduling scheme running an AT Command Line Interface. Task will be scheduled as event-triggered task. The parser address will be stored in the event_t::TaskData storage-Pointer.

Precondition
The AT-CLI object should be previously configured with qOS::commandLineInterface::setup().
See also
qOS::commandLineInterface::setup()
Parameters
[in]TaskThe task node.
[in]cliThe Command Line Inteface instance.
[in]pTask priority Value. [0(min) - Q_PRIORITY_LEVELS (max)]
[in]argThe task arguments.
Returns
Returns true on success, otherwise returns false.

◆ ERROR_CODE()

response qOS::cli::ERROR_CODE ( int16_t code)
constexpr

Used to indicate an error code as return value inside a command-callback. This code is defined by the application writer and should be a value between 1 and 32766.

For example, a return value of cli::ERROR_CODE(15), will print out the string ERROR:15.