|
ESP8266
|
Public Member Functions | |
| ESP8266WiFiMesh (uint32_t chip_id, std::function< String(String)> handler) | |
| void | begin () |
| void | attemptScan (String message) |
| void | acceptRequest () |
Private Member Functions | |
| void | connectToNode (String target_ssid, String message) |
| bool | exchangeInfo (String message, WiFiClient curr_client) |
| bool | waitForClient (WiFiClient curr_client, int max_wait) |
Private Attributes | |
| String | _ssid |
| String | _ssid_prefix |
| uint32_t | _chip_id |
| std::function< String(String)> | _handler |
| WiFiServer | _server |
| WiFiClient | _client |
| ESP8266WiFiMesh::ESP8266WiFiMesh | ( | uint32_t | chip_id, |
| std::function< String(String)> | handler | ||
| ) |
WiFiMesh Constructor method. Creates a WiFi Mesh Node, ready to be initialised.
A unique identifier number for the node. The callback handler for dealing with received messages. Takes a string as an argument which is the string received from another node and returns the string to send back.
| void ESP8266WiFiMesh::acceptRequest | ( | ) |
If any clients are connected, accept their requests and call the hander function for each one.
| void ESP8266WiFiMesh::attemptScan | ( | String | message | ) |
Scan for other nodes, and exchange the chosen message with any that are found.
The message to send to all other nodes.
| void ESP8266WiFiMesh::begin | ( | ) |
Initialises the node.
|
private |
Connect to the AP at ssid, send them a message then disconnect.
The name of the AP the other node has set up. The string to send to the node.
|
private |
Send the supplied message then read back the other node's response and pass that to the user-supplied handler.
The name of the AP the other node has set up. The string to send to the node.
|
private |
Wait for a WiFiClient to connect
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
1.8.10