-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemote.h
More file actions
47 lines (39 loc) · 917 Bytes
/
Remote.h
File metadata and controls
47 lines (39 loc) · 917 Bytes
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
38
39
40
41
42
43
44
45
46
/*
* Copyright (c) 2012 Yeelink.net by dapingliu <dapingliu@yeelink.net>
*/
#ifndef _REMOTE_h
#define _REMOTE_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <Ethernet.h>
#include <EthernetUdp.h>
#include "CommonData.h"
#include "dns.h"
#define REMOTE_RX_BUF_SIZE 64
#define YEE_SERVER_RECONNECT_TIME 20000
#define YEE_SERVER_HB_TIME 30000
// Identify remote connection status
#define REMOTE_CONN_NOT_REQUEST 1
#define REMOTE_CONN_DISCONN 2
#define REMOTE_CONN_CONNECTED 3
#define REMOTE_CONN_NOT_RESOLVED 4
class Remote
{
private:
class CommonData *_cmdata;
IPAddress remoteIP;
unsigned long connDownTime;
unsigned long connHBTime;
public:
EthernetClient _client;
byte connected;
void begin(CommonData *cmdata);
void loop();
void getAndSendMacFromEeprom();
void connect();
void sendMsgToServer(uint8_t* msg, uint8_t len);
};
#endif