-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathNetworkInterface.h
37 lines (26 loc) · 1.03 KB
/
NetworkInterface.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
#ifndef NetworkInterface_h
#define NetworkInterface_h
#include <Arduino.h>
#include "Transport.h"
typedef enum {
TCP,
UDP
} protocolType;
typedef enum {
WIFI, // using an AT (Version >= V1.7) command enabled ESP8266 not to be used in conjunction with the WifiInterface though! not tested for conflicts
ETHERNET // using the EthernetShield
} transportType;
class NetworkInterface
{
private:
static Transport* transport;
public:
static void setup(transportType t, protocolType p, uint16_t port); // specific port nummber
static void setup(transportType t, protocolType p); // uses default port number
static void setup(transportType t); // defaults for protocol/port
static void setup(); // defaults for all as above plus CABLE (i.e. using EthernetShield ) as default
static void loop();
NetworkInterface();
~NetworkInterface();
};
#endif