blob: 69ba593e9504e4282967aef521c07fb31fb6911a (
plain)
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
|
#ifndef Server_Drv_h
#define Server_Drv_h
#include <inttypes.h>
#include "wifi_spi.h"
class ServerDrv
{
public:
// Start server TCP on port specified
static void startServer(uint16_t port, uint8_t sock);
static void startClient(uint32_t ipAddress, uint16_t port, uint8_t sock);
static void stopClient(uint8_t sock);
static uint8_t getServerState(uint8_t sock);
static uint8_t getClientState(uint8_t sock);
static bool getData(uint8_t sock, uint8_t *data, uint8_t peek = 0);
static bool getDataBuf(uint8_t sock, uint8_t *data, uint16_t *len);
static bool sendData(uint8_t sock, const uint8_t *data, uint16_t len);
static uint8_t availData(uint8_t sock);
static uint8_t checkDataSent(uint8_t sock);
};
extern ServerDrv serverDrv;
#endif
|