forked from anakod/ESP8266pro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathESP8266proServer.h
executable file
·37 lines (28 loc) · 958 Bytes
/
ESP8266proServer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// ESP8266pro
// This software distributed under the terms of the MIT license
// (c) Skurydin Alexey, 2014
#ifndef _ESP8266proServer_H_
#define _ESP8266proServer_H_
#include "ESP8266pro.h"
#include "ESP8266proConnectionBase.h"
class ESP8266pro;
class ESP8266proServer;
class ESP8266proServer : public IESP8266proBaseReceiver
{
public:
ESP8266proServer(ESP8266pro& esp, ConnectionDataCallback callback);
bool start(long port); // Only one working Server instance per time
void stop();
bool processRequests(); // Non blocking operation, if no data received
void closeAllConnections();
// Internal method
virtual void onDataReceive(uint8_t connectionId, char* buffer, int length, DataReceiveAction action);
private:
ESP8266pro &parent;
unsigned long lastCheck;
int serverPort;
ConnectionDataCallback dataCallback;
ESP8266proServerConection* virtualConnection[ESP_MAX_CONNECTIONS];
bool receiveProcessing[ESP_MAX_CONNECTIONS];
};
#endif