The ESP-AT MQTT library project
A simple wrapper to the MQTT functionality found in the ESP-AT interpreter
|
Go to the documentation of this file.
67 ESP_AT_SUB_CMD_LAST_COMMAND
70 #define AT_ERROR(x) (x & 0x00ff0000)
92 AT_Class(HardwareSerial* = &ESP_SERIAL_PORT);
97 const char *asynch = NULL, uint32_t timeout=2000);
108 HardwareSerial* _serial;
@ ESP_AT_SUB_CMD_CONN_SYNCH
MQTT connection was synchronous.
Definition: AT.h:64
AT_Class(HardwareSerial *=&ESP_SERIAL_PORT)
The class constructor is used to set the serial port to be used to communicate with the ESP-AT device...
Definition: AT.cpp:51
@ ESP_AT_SUB_NO_TERMINATOR
The At interpretor did not detect a terminator.
Definition: AT.h:50
at_status_t sendCommand(const char *cmd, const char *param, char **result, const char *asynch=NULL, uint32_t timeout=2000)
This function sends the specified AT command and parameters to the ESP-AT device on the serial line.
Definition: AT.cpp:210
int wx
Write pointer to the input buffer while processing an ESP-AT response.
Definition: AT.h:112
@ ESP_AT_SUB_PARA_PARSE_FAIL
Failed to parse parameter.
Definition: AT.h:56
int available()
Checks to see if there are any data available on the serial port.
Definition: AT.cpp:402
char buff[1024]
Serial input buffer.
Definition: AT.h:109
@ ESP_AT_SUB_PARA_NUM_MISMATCH
Incorrect number of parameters.
Definition: AT.h:54
uint32_t at_status_t
The return value of an AT operation.
Definition: AT.h:77
@ ESP_AT_SUB_NO_AT
Command was not prepended with "AT".
Definition: AT.h:51
@ ESP_AT_SUB_PARA_TYPE_MISMATCH
Wrong parameter type.
Definition: AT.h:53
int line
Keeps track of how many lines have been received during the processing of an ESP-AT reply.
Definition: AT.h:113
at_status_t waitString(const char *str, uint32_t timeout)
Wait for a specific string to arrive on the serial port.
Definition: AT.cpp:285
@ ESP_AT_SUB_COMMON_ERROR
A generic error has occured, no more info is available.
Definition: AT.h:49
at_status_t waitReply(const char *asynch, uint32_t timeout)
Read all lines until the end of the AT command sequence All lines are stored in buff[] separated with...
Definition: AT.cpp:112
status_code_e
Status codes that the AT handler can return.
Definition: AT.h:47
size_t readLine()
Read exactly one line from the serial port.
Definition: AT.cpp:66
char cmdBuff[256]
Command buffer for stuff sent to the ESP-AT device.
Definition: AT.h:110
@ ESP_AT_SUB_CMD_PROCESSING
Error in command processing, this error always occur before a MQTT error happens.
Definition: AT.h:59
@ ESP_AT_SUB_CMD_ERROR
Generic command error.
Definition: AT.h:62
@ ESP_AT_SUB_PARA_INVALID
Invalid parameter value.
Definition: AT.h:55
EspAT MQTT AT_Class definition.
Definition: AT.h:90
@ ESP_AT_SUB_UNSUPPORT_CMD
Found unsupported command.
Definition: AT.h:57
char resBuff[128]
Result buffer for parameter data returned from the ESP-AT device.
Definition: AT.h:111
@ ESP_AT_SUB_CMD_EXEC_FAIL
Command execution failed.
Definition: AT.h:58
@ ESP_AT_SUB_CMD_TIMEOUT
AT_Class timout waiting for a reply from the interpreter.
Definition: AT.h:63
at_status_t sendString(const char *str, size_t len)
Send a generic string on the serial port.
Definition: AT.cpp:323
@ ESP_AT_SUB_CMD_CONN_ASYNCH
MQTT connection was asynchronous, a callback will be issued when the connection is made.
Definition: AT.h:65
char read()
Reads a byte from the serial port.
Definition: AT.cpp:385
char * getBuff()
Returns a pointer to the internal receive buffer.
Definition: AT.cpp:373
at_status_t waitPrompt(uint32_t timeout)
Waits for a prompt of the character '>' to arrive on the serial port.
Definition: AT.cpp:257
@ ESP_AT_SUB_PARA_LENGTH_MISMATCH
Mismatch in the parameter length.
Definition: AT.h:52
@ ESP_AT_SUB_OK
All is good in life and no errors have been detected.
Definition: AT.h:48
@ ESP_AT_SUB_CMD_OP_ERROR
Error while performing and operation.
Definition: AT.h:61