Control class for ESP8266 module. Implements TransportLayer methods.
More...
#include <ESP8266.h>
|
| ESP8266 (Module *module) |
| Default constructor. More...
|
|
int16_t | begin (long speed) |
| Initialization method. More...
|
|
int16_t | reset () |
| Resets module using AT command. More...
|
|
int16_t | join (const char *ssid, const char *password) |
| Joins access point. More...
|
|
int16_t | openTransportConnection (const char *host, const char *protocol, uint16_t port, uint16_t tcpKeepAlive=0) override |
| Open transport layer connection. More...
|
|
int16_t | closeTransportConnection () override |
| Close transport layer connection. More...
|
|
int16_t | send (const char *data) override |
| Send string-based data. More...
|
|
int16_t | send (uint8_t *data, size_t len) override |
| Send arbitrary binary data. More...
|
|
size_t | receive (uint8_t *data, size_t len, uint32_t timeout=10000) override |
| Receive data. More...
|
|
size_t | getNumBytes (uint32_t timeout=10000, size_t minBytes=10) override |
| Get number of received bytes. More...
|
|
Control class for ESP8266 module. Implements TransportLayer methods.
◆ ESP8266()
ESP8266::ESP8266 |
( |
Module * |
module | ) |
|
Default constructor.
- Parameters
-
mod | Instance of Module that will be used to communicate with the radio. |
◆ begin()
int16_t ESP8266::begin |
( |
long |
speed | ) |
|
Initialization method.
- Parameters
-
speed | Baud rate to use for UART interface. |
- Returns
- Status Codes
◆ closeTransportConnection()
int16_t ESP8266::closeTransportConnection |
( |
| ) |
|
|
overridevirtual |
◆ getNumBytes()
size_t ESP8266::getNumBytes |
( |
uint32_t |
timeout = 10000 , |
|
|
size_t |
minBytes = 10 |
|
) |
| |
|
overridevirtual |
Get number of received bytes.
- Parameters
-
timeout | Reception timeout in ms. Defaults to 10000. |
minBytes | Minimum required number of bytes that must be received. |
- Returns
- Number of received bytes, or 0 on timeout.
Implements TransportLayer.
◆ join()
int16_t ESP8266::join |
( |
const char * |
ssid, |
|
|
const char * |
password |
|
) |
| |
Joins access point.
- Parameters
-
ssid | Access point SSID. |
password | Access point password. |
◆ openTransportConnection()
int16_t ESP8266::openTransportConnection |
( |
const char * |
host, |
|
|
const char * |
protocol, |
|
|
uint16_t |
port, |
|
|
uint16_t |
tcpKeepAlive = 0 |
|
) |
| |
|
overridevirtual |
Open transport layer connection.
- Parameters
-
host | Host to connect to. |
protocol | Transport protocol to use. Usually "TCP" or "UDP". |
port | to be used for the connection. |
tcpKeepAlive | TCP keep alive interval. Defaults to 0. |
- Returns
- Status Codes
Implements TransportLayer.
◆ receive()
size_t ESP8266::receive |
( |
uint8_t * |
data, |
|
|
size_t |
len, |
|
|
uint32_t |
timeout = 10000 |
|
) |
| |
|
overridevirtual |
Receive data.
- Parameters
-
data | Pointer to array to save the received data. |
len | Number of bytes to read. |
timeout | Reception timeout in ms. Defaults to 10000. |
- Returns
- Status Codes
Implements TransportLayer.
◆ reset()
int16_t ESP8266::reset |
( |
| ) |
|
◆ send() [1/2]
int16_t ESP8266::send |
( |
const char * |
data | ) |
|
|
overridevirtual |
◆ send() [2/2]
int16_t ESP8266::send |
( |
uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
|
overridevirtual |
Send arbitrary binary data.
- Parameters
-
data | Data to be sent. |
len | Number of bytes to send. |
- Returns
- Status Codes
Implements TransportLayer.
The documentation for this class was generated from the following files:
- src/modules/ESP8266/ESP8266.h
- src/modules/ESP8266/ESP8266.cpp