3#include <QtCore/QLoggingCategory>
4#include <QtCore/QString>
12#include <ulog_cpp/data_handler_interface.hpp>
13#include <ulog_cpp/messages.hpp>
14#include <ulog_cpp/subscription.hpp>
59using MessageCallback = std::function<bool(
const ulog_cpp::TypedDataView &sample)>;
75 void error(
const std::string &msg,
bool is_recoverable)
override;
76 void messageFormat(
const ulog_cpp::MessageFormat &message_format)
override;
77 void addLoggedMessage(
const ulog_cpp::AddLoggedMessage &add_logged_message)
override;
79 void data(
const ulog_cpp::Data &
data)
override;
94 std::string _targetMessageName;
96 QString &_errorMessage;
97 std::shared_ptr<ulog_cpp::MessageFormat> _messageFormat;
98 std::set<uint16_t> _messageIds;
99 bool _hadFatalError =
false;
100 bool _headerComplete =
false;
101 int _messageCount = 0;
112 const std::string &messageName,
114 QString &errorMessage);
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
void addLoggedMessage(const ulog_cpp::AddLoggedMessage &add_logged_message) override
bool hadFatalError() const
Check if a fatal error occurred during parsing.
void messageFormat(const ulog_cpp::MessageFormat &message_format) override
void headerComplete() override
virtual ~MessageHandler()=default
bool hasMessageFormat() const
Check if the target message format was found.
int messageCount() const
Get the number of messages processed.
bool isHeaderComplete() const
Check if the ULog header was successfully parsed.
void data(const ulog_cpp::Data &data) override
std::function< bool(const ulog_cpp::TypedDataView &sample)> MessageCallback
bool isValidHeader(const char *data, qint64 size)
uint64_t getHeaderTimestamp(const char *data, qint64 size)
bool iterateMessages(const char *data, qint64 size, const std::string &messageName, const MessageCallback &callback, QString &errorMessage)
constexpr int kHeaderSize
constexpr char kMagicBytes[]
ULog file magic bytes: "ULog" followed by 0x01 (version 1) followed by 0x12 (file compat)
int getVersion(const char *data, qint64 size)