-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMobile.h
More file actions
42 lines (34 loc) · 819 Bytes
/
Mobile.h
File metadata and controls
42 lines (34 loc) · 819 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
/*
* Copyright (c) 2012 Yeelink.net by dapingliu <dapingliu@yeelink.net>
*/
#ifndef _MOBILE_h
#define _MOBILE_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <Ethernet.h>
#include <EthernetUdp.h>
#include "CommonData.h"
#define MOBILE_RX_BUF_SIZE 128
#define MOBILE_TX_BUF_SIZE 128
class Mobile
{
private:
class CommonData* cmdata;
EthernetServer* _mobileIntf;
// unsigned long connHBTime;
unsigned long lastRcvTime;
void _printDeviceList(EthernetClient*);
public:
uint8_t _rxBuf[MOBILE_RX_BUF_SIZE];
uint8_t _rxSize;
~Mobile();
void begin(CommonData*);
void loop();
void processMessage(EthernetClient*, uint8_t* buf, uint8_t buf_size);
void sendMessageToClient(uint8_t *msg, uint8_t len);
void dropMobileClent(byte num);
};
#endif