13#ifndef __FPSDK_COMMON_TO_JSON_FPL_HPP__
14#define __FPSDK_COMMON_TO_JSON_FPL_HPP__
19#include <nlohmann/json.hpp>
30inline void to_json(nlohmann::json& j,
const LogStatus& s)
32 j = nlohmann::json::object({
35 {
"state", s.state_ },
36 {
"queue_size_", s.queue_size_ },
37 {
"queue_peak", s.queue_peak_ },
38 {
"queue_skip", s.queue_skip_ },
39 {
"queue_bsize", s.queue_bsize_ },
40 {
"queue_bpeak", s.queue_bpeak_ },
41 {
"log_count", s.log_count_ },
42 {
"log_errors", s.log_errors_ },
43 {
"log_size", s.log_size_ },
44 {
"log_duration", s.log_duration_ },
45 {
"log_time_posix", s.log_time_posix_ },
46 {
"log_time_iso", s.log_time_iso_ },
47 {
"pos_source", s.pos_source_ },
48 {
"pos_fix_type", s.pos_fix_type_ },
49 {
"pos_lat", s.pos_lat_ },
50 {
"pos_lon", s.pos_lon_ },
51 {
"pos_height", s.pos_height_ },
57inline void to_json(nlohmann::json& j,
const LogMeta& m)
59 j = nlohmann::json::object({
62 {
"hw_uid", m.hw_uid_ },
63 {
"product_model", m.product_model_ },
64 {
"sw_version", m.sw_version_ },
65 {
"log_start_time_posix", m.log_start_time_posix_ },
66 {
"log_start_time_iso", m.log_start_time_iso_ },
67 {
"log_profile", m.log_profile_ },
68 {
"log_target", m.log_target_ },
69 {
"log_filename", m.log_filename_ },
75inline void to_json(nlohmann::json& j,
const StreamMsg& m)
77 j = nlohmann::json::object({
79 {
"_stamp", m.rec_time_ },
80 {
"_stream", m.stream_name_ },
83 if (std::all_of(m.msg_data_.data(), m.msg_data_.data() + m.msg_data_.size(),
84 [](
const uint8_t c) { return std::isprint(c) || std::isspace(c); })) {
93inline void to_json(nlohmann::json& j,
const FileDump& m)
95 j = nlohmann::json::object({
97 {
"_mtime", m.mtime_.GetRosTime() },
98 {
"_filename", m.filename_ },
101 if (std::all_of(m.data_.data(), m.data_.data() + m.data_.size(),
102 [](
const uint8_t c) { return std::isprint(c) || std::isspace(c); })) {
Fixposition SDK: .fpl utilities.
@ LOGSTATUS
Logging status.
@ LOGMETA
Logfile meta data.
@ FILEDUMP
Dump of an entire (small) file.
@ STREAMMSG
Stream message raw data with timestamp.
const char * FplTypeStr(const FplType type)
Stringify type.
std::string BufToStr(const std::vector< uint8_t > &buf)
Convert buffer to string.
std::string Base64Enc(const std::vector< uint8_t > &buf)
Encode to base64.
Fixposition SDK: String utilities.
Helper for extracting data of a stream message (NMEA, RTCM3, etc.)
Helper for extracting recording status data.
Helper for extracting data of a stream message (NMEA, RTCM3, etc.)
Fixposition SDK: to_json() helpers for some fpsdk::common::time types.