mirror of
https://github.com/sigmasternchen/iot-relay-arduino
synced 2025-03-15 07:58:54 +00:00
29 lines
576 B
C
29 lines
576 B
C
![]() |
#ifndef _IOT_RELAY_H_
|
||
|
#define _IOT_RELAY_H_
|
||
|
|
||
|
#include <ESP8266WiFi.h>
|
||
|
|
||
|
#define MAX_DATA_VALUES (10)
|
||
|
#define CONNECTION_TIMEOUT (2000)
|
||
|
#define CHECK_TIMEOUT (500)
|
||
|
|
||
|
class IotRelay {
|
||
|
public:
|
||
|
void begin(String addr, int port, String id, String loc);
|
||
|
void connect(String ssid, String password);
|
||
|
void add(String key, String value);
|
||
|
int send();
|
||
|
|
||
|
private:
|
||
|
WiFiClient client;
|
||
|
String addr;
|
||
|
int port;
|
||
|
String id;
|
||
|
String loc;
|
||
|
int size;
|
||
|
String keys[MAX_DATA_VALUES];
|
||
|
String values[MAX_DATA_VALUES];
|
||
|
};
|
||
|
|
||
|
#endif
|