Initial
This commit is contained in:
37
include/udp_logger.h
Normal file
37
include/udp_logger.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @file udp_logger.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 UDP_LOGGER_H
|
||||
#define UDP_LOGGER_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <WiFiUdp.h>
|
||||
|
||||
class UDPLogger
|
||||
{
|
||||
public:
|
||||
UDPLogger();
|
||||
UDPLogger(IPAddress interface_addr, IPAddress multicast_addr, int port, String name);
|
||||
void set_name(String name);
|
||||
void log_string(String message);
|
||||
void log_color_24bit(uint32_t color);
|
||||
|
||||
private:
|
||||
char _packetBuffer[100] = {0};
|
||||
int _port;
|
||||
IPAddress _interfaceAddr;
|
||||
IPAddress _multicastAddr;
|
||||
String _name = "Logger";
|
||||
unsigned long _lastSend = 0;
|
||||
WiFiUDP _udp;
|
||||
};
|
||||
|
||||
#endif /* UDP_LOGGER_H */
|
||||
Reference in New Issue
Block a user