mirror of
https://github.com/anklimov/lighthub
synced 2025-12-07 20:29:50 +03:00
MCP23017 inputs
STATUSLED Compilation for all platforms WIFI_ENABLE option to allow wired connection for ESP Modbus, Syslog for ESP
This commit is contained in:
@@ -1,28 +1,32 @@
|
||||
#include <Print.h>
|
||||
#include <UARTClass.h>
|
||||
#include <Syslog.h>
|
||||
#include <HardwareSerial.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#define LOG_DEBUG 7
|
||||
#define LOG_INFO 6
|
||||
#define LOG_ERROR 3
|
||||
|
||||
#ifndef LOGBUFFER_SIZE
|
||||
#define LOGBUFFER_SIZE 80
|
||||
#endif
|
||||
|
||||
static uint8_t serialDebugLevel = 7;
|
||||
static uint8_t udpDebugLevel =7;
|
||||
|
||||
#ifdef SYSLOG_ENABLE
|
||||
#include <Syslog.h>
|
||||
static char logBuffer[LOGBUFFER_SIZE];
|
||||
static int logBufferPos=0;
|
||||
#endif
|
||||
|
||||
#define LOG_DEBUG 7
|
||||
#define LOG_INFO 6
|
||||
#define LOG_ERROR 3
|
||||
|
||||
static uint8_t serialDebugLevel = 7;
|
||||
static uint8_t udpDebugLevel =7;
|
||||
|
||||
class Streamlog : public Print
|
||||
{
|
||||
public:
|
||||
Streamlog (UARTClass * _serialPort, int _severity = LOG_DEBUG, Syslog * _syslog = NULL);
|
||||
#ifdef SYSLOG_ENABLE
|
||||
Streamlog (HardwareSerial * _serialPort, int _severity = LOG_DEBUG, Syslog * _syslog = NULL);
|
||||
#else
|
||||
Streamlog (HardwareSerial * _serialPort, int _severity = LOG_DEBUG);
|
||||
#endif
|
||||
// {serialPort=_serialPort;severity=_severity; syslog=_syslog; }
|
||||
void begin(unsigned long speed);
|
||||
void end() ;
|
||||
@@ -36,6 +40,8 @@ class Streamlog : public Print
|
||||
operator bool() {return true;};
|
||||
private:
|
||||
uint16_t severity;
|
||||
UARTClass *serialPort;
|
||||
HardwareSerial *serialPort;
|
||||
#ifdef SYSLOG_ENABLE
|
||||
Syslog * syslog;
|
||||
#endif
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user