forked from techniccontroller/wordclock_esp8266
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathudplogger.h
37 lines (31 loc) · 783 Bytes
/
udplogger.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
/**
* @file udplogger.h
* @author techniccontroller (mail[at]techniccontroller.com)
* @brief Class for sending logging Strings as multicast messages
* @version 0.1
* @date 2022-03-21
*
* @copyright Copyright (c) 2022
*
*/
#ifndef udplogger_h
#define udplogger_h
#include <Arduino.h>
#include <WiFiUdp.h>
class UDPLogger{
public:
UDPLogger();
UDPLogger(IPAddress interfaceAddr, IPAddress multicastAddr, int port);
void setName(String name);
void logString(String logmessage);
void logColor24bit(uint32_t color);
private:
String _name;
IPAddress _multicastAddr;
IPAddress _interfaceAddr;
int _port;
WiFiUDP _Udp;
char _packetBuffer[100];
long _lastSend;
};
#endif