Class that facilitates the communication with an AT device. More...

#include <AtClient.h>

Collaboration diagram for AtClient:
[legend]

Public Member Functions

 AtClient (HardwareSerial *stream)
 
virtual ~AtClient ()
 
void send (const String &text, const String &altResponse=nullptr, uint32_t timeoutMs=AT_TIMEOUT, unsigned retries=0)
 Sends AT command. More...
 
void send (const String &text, AtReceiveCallback onReceive, uint32_t timeoutMs=AT_TIMEOUT, unsigned retries=0)
 Sends AT command. More...
 
void send (const String &text, AtCompleteCallback onComplete, uint32_t timeoutMs=AT_TIMEOUT, unsigned retries=0)
 Sends AT command. More...
 
void send (AtCommand command)
 Adds a command to the queue. If you need all the flexibility then use that command and manually set your AtCommand arguments. More...
 
void sendDirect (AtCommand command)
 Executes directly (does not queue it) a command. More...
 
AtState getState ()
 Returns the current state. More...
 
void resend ()
 
void next ()
 

Public Attributes

AtCommand currentCommand
 The current command. More...
 

Protected Member Functions

virtual void processor (Stream &source, char arrivedChar, uint16_t availableCharsCount)
 Processes response data. More...
 

Detailed Description

Class that facilitates the communication with an AT device.

Constructor & Destructor Documentation

◆ AtClient()

AtClient::AtClient ( HardwareSerial stream)

◆ ~AtClient()

virtual AtClient::~AtClient ( )
inlinevirtual

Member Function Documentation

◆ getState()

AtState AtClient::getState ( )
inline

Returns the current state.

Return values
AtState

◆ next()

void AtClient::next ( )

◆ processor()

virtual void AtClient::processor ( Stream source,
char  arrivedChar,
uint16_t  availableCharsCount 
)
protectedvirtual

Processes response data.

◆ resend()

void AtClient::resend ( )

◆ send() [1/4]

void AtClient::send ( const String text,
const String altResponse = nullptr,
uint32_t  timeoutMs = AT_TIMEOUT,
unsigned  retries = 0 
)

Sends AT command.

Parameters
textThe actual AT command text. For example AT+CAMSTOP
altResponseExpected response on success in addition to the default one which is OK
timeoutMsTime in milliseconds to wait for response
retriesRetries on error

◆ send() [2/4]

void AtClient::send ( const String text,
AtReceiveCallback  onReceive,
uint32_t  timeoutMs = AT_TIMEOUT,
unsigned  retries = 0 
)

Sends AT command.

Parameters
textThe actual AT command text. For example AT+CAMSTOP
onReceive
timeoutMsTime in milliseconds to wait for response
retriesRetries on error

◆ send() [3/4]

void AtClient::send ( const String text,
AtCompleteCallback  onComplete,
uint32_t  timeoutMs = AT_TIMEOUT,
unsigned  retries = 0 
)

Sends AT command.

Parameters
textString The actual AT command text. For example AT+CAMSTOP
onComplete
timeoutMsTime in milliseconds to wait for response
retriesRetries on error

◆ send() [4/4]

void AtClient::send ( AtCommand  command)

Adds a command to the queue. If you need all the flexibility then use that command and manually set your AtCommand arguments.

Parameters
command

◆ sendDirect()

void AtClient::sendDirect ( AtCommand  command)

Executes directly (does not queue it) a command.

Parameters
command

Member Data Documentation

◆ currentCommand

AtCommand AtClient::currentCommand

The current command.


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