// // Created by CFIF on 13.11.22. // #ifndef UVEOS_ON_NATION_LOGGERTOSERIALPORT_H #define UVEOS_ON_NATION_LOGGERTOSERIALPORT_H #include "SerialPort.h" #include "LoggerInterface.h" #include "RtcIO.h" #include typedef struct { tSerialPortIO *serialPortIo_VIRT; tSerialPortIO *serialPortIo_PHYSIC; tRtcIO *rtc; uint32_t timeout; uint32_t timeoutTransmittedLog; uint8_t authorLimit; bool open; tLoggerInterface logger; uint16_t flags; int32_t greenwichOffset; uint8_t buf_LOG[256]; uint8_t bufPrintfLogger[MAX_COUNT_BUF_LOG][MAX_LEN_BUF_LOG]; uint8_t bufPrintfNames[MAX_COUNT_BUF_LOG][MAX_LEN_BUF_NAME_LOG]; uint8_t countBufPrintfNames; uint8_t bufLogger[MAX_COUNT_BUF_LOG][MAX_LEN_BUF_LOG]; uint8_t bufLoggerNames[MAX_COUNT_BUF_LOG][MAX_LEN_BUF_NAME_LOG]; uint8_t countBufLoggerNames; struct { osThreadId_t id; uint32_t stack[384]; StaticTask_t controlBlock; osThreadAttr_t attr; } thread; } tLoggerToSerialPort; #define SERIAL_LOGGER_SHOW_AUTHOR 0b1 << 0 #define SERIAL_LOGGER_SHOW_LOG_LEVEL 0b1 << 1 #define SERIAL_LOGGER_SHOW_TIME 0b1 << 2 #define SERIAL_LOGGER_SHOW_DATE 0b1 << 3 void LoggerToSerialPort_Init( tLoggerToSerialPort *env, int32_t greenwichOffset, tSerialPortIO *serialPortIo_VIRT, tSerialPortIO *serialPortIo_PHYSIC, tRtcIO *rtc, uint16_t flags, uint32_t timeoutTransmittedLog // bool showDate, // bool showTime, // bool showLoglevel, // bool showAuthor ); void LogTransmitter_StartThread(tLoggerToSerialPort *env); #endif //UVEOS_ON_NATION_LOGGERTOSERIALPORT_H