// // 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; struct { osThreadId_t id; uint32_t stack[512]; 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