-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathuSSDP.h
49 lines (36 loc) · 839 Bytes
/
uSSDP.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
38
39
40
41
42
43
44
45
46
47
48
49
/*
uSSDP.h - Library that implement SSDP protocol.
Created by Filippo Sallemi, July 23, 2014.
Released into the public domain.
*/
#ifndef uSSDP_H
#define uSSDP_H
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <uDevice.h>
#define DEBUG 0
#define SSDP_INTERVAL 1200
#define SSDP_PORT 1900
// Sizes
#define METHOD_SIZE 10
#define URI_SIZE 2
#define BUFFER_SIZE 48
class uSSDP{
typedef enum {NONE, SEARCH, NOTIFY} method_t;
public:
uSSDP();
~uSSDP();
void begin(uDevice *device);
uint8_t process();
void send(method_t method);
void schema(WiFiClient *client);
private:
WiFiUDP _server;
uDevice *_device;
bool _pending;
unsigned short _delay;
unsigned long _process_time;
unsigned long _notify_time;
};
#endif