10 #ifndef logger_types_telem_rhusb_hpp
11 #define logger_types_telem_rhusb_hpp
13 #include "generated/telem_rhusb_generated.h"
54 return VerifyTelem_rhusb_fbBuffer(verifier);
62 static_cast<void>(len);
64 auto fbs = GetTelem_rhusb_fb(msgBuffer);
66 std::string
msg =
"[rhusb] ";
71 msg += std::to_string(fbs->temp()) +
"C ";
74 msg += std::to_string(fbs->rh()) +
"%";
81 static float temp(
void * msgBuffer)
83 auto fbs = GetTelem_rhusb_fb(msgBuffer);
87 static float rh(
void * msgBuffer)
89 auto fbs = GetTelem_rhusb_fb(msgBuffer);
100 if(member ==
"temp")
return reinterpret_cast<void*
>(&
temp);
101 else if(member ==
"rh")
return reinterpret_cast<void*
>(&
rh);
104 std::cerr <<
"No string member " << member <<
" in telem_rhusb\n";
The MagAO-X logger flatbuffer log base type.
uint16_t eventCodeT
The type of an event code (16-bit unsigned int).
msgLen2T msgLenT
The type used to refer to the message length, regardless of length.
int8_t logPrioT
The type of the log priority code.
static void * messageBuffer(bufferPtrT &logBuffer)
Get the message buffer address.
std::shared_ptr< char > bufferPtrT
The log entry buffer smart pointer.
constexpr static logPrioT LOG_TELEM
A telemetry recording.
Message type for resolving log messages with a f.b. builder.
flatbuffers::FlatBufferBuilder builder
Base class for logs consisting of a flatbuffer message.
The type of the input message.
messageT(const float &temp, const float &rh)
Construct from components.
Log entry recording the build-time git state.
static float rh(void *msgBuffer)
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
static timespec lastRecord
The time of the last time this log was recorded. Used by the telemetry system.
static void * getAccessor(const std::string &member)
Get pointer to the accessor for a member by name.
static float temp(void *msgBuffer)
static const flatlogs::logPrioT defaultLevel
The default level.
static const flatlogs::eventCodeT eventCode
The event code.