170 std::array<char, 16> data{};
174 read(ulogHeader.data.data(), ulogHeader.data.size());
177 if ((ulogHeader.header.fileMagic[0] !=
'U') || (ulogHeader.header.fileMagic[1] !=
'L') || (ulogHeader.header.fileMagic[2] !=
'o') || (ulogHeader.header.fileMagic[3] !=
'g'))
182 LOG_DEBUG(
"{}: version: {}",
nameId(),
static_cast<int>(ulogHeader.header.version));
184 LOG_DEBUG(
"{}: time stamp [µs]: {}",
nameId(), ulogHeader.header.timeStamp);
189 std::array<char, 3> data{};
193 while ((ulogMsgHeader.msgHeader.msg_type !=
'A') && (ulogMsgHeader.msgHeader.msg_type !=
'L'))
195 read(ulogMsgHeader.data.data(), ulogMsgHeader.data.size());
197 LOG_DATA(
"{}: msgSize: {}, msgType: {}",
nameId(), ulogMsgHeader.msgHeader.msg_size, ulogMsgHeader.msgHeader.msg_type);
201 if (ulogMsgHeader.msgHeader.msg_type ==
'B')
203 if (ulogMsgHeader.msgHeader.msg_size > 40)
205 LOG_WARN(
"{}: Exceeding bytes in 'flag bitset message' are ignored. Check for ULog file format update.",
nameId());
210 std::array<char, 40> data{};
214 read(ulogMsgFlagBits.data.data(), ulogMsgFlagBits.data.size() *
sizeof(
char));
218 else if (ulogMsgHeader.msgHeader.msg_type ==
'F')
221 messageFormat.
header = ulogMsgHeader.msgHeader;
226 read(messageFormat.
format.data(), ulogMsgHeader.msgHeader.msg_size);
229 std::string msgName = messageFormat.
format.substr(0, messageFormat.
format.find(
':'));
232 std::stringstream lineStream(messageFormat.
format.substr(messageFormat.
format.find(
':') + 1));
235 std::vector<DataField> msgDataFields;
237 while (std::getline(lineStream, cell,
';'))
239 DataField data_field{ .type = cell.substr(0, cell.find(
' ')), .name = cell.substr(cell.find(
' ') + 1) };
240 msgDataFields.push_back(data_field);
243 if (msgName ==
"sensor_accel")
247 else if (msgName ==
"sensor_gyro")
251 else if (msgName ==
"sensor_mag")
255 else if (msgName ==
"vehicle_gps_position")
259 else if (msgName ==
"vehicle_attitude")
263 else if (msgName ==
"vehicle_air_data")
267 else if (msgName ==
"vehicle_control_mode")
271 else if (msgName ==
"vehicle_status")
275 else if (msgName ==
"cpuload")
281 LOG_ERROR(
"{}: Data format '{}' could not be decoded",
nameId(), msgName);
286 else if (ulogMsgHeader.msgHeader.msg_type ==
'I')
292 else if (ulogMsgHeader.msgHeader.msg_type ==
'M')
298 else if (ulogMsgHeader.msgHeader.msg_type ==
'P')
304 else if (ulogMsgHeader.msgHeader.msg_type ==
'Q')
309 seekg(-3, std::ios_base::cur);
319 std::array<char, 3> data{};
325 read(ulogMsgHeader.data.data(), ulogMsgHeader.data.size());
327 LOG_DATA(
"{}: msgSize: {}",
nameId(), ulogMsgHeader.msgHeader.msg_size);
328 LOG_DATA(
"{}: msgType: {}",
nameId(), ulogMsgHeader.msgHeader.msg_type);
330 if (ulogMsgHeader.msgHeader.msg_type ==
'A')
333 messageAddLog.
header = ulogMsgHeader.msgHeader;
336 read(
reinterpret_cast<char*
>(&messageAddLog.
msg_id),
sizeof(messageAddLog.
msg_id));
346 else if (ulogMsgHeader.msgHeader.msg_type ==
'R')
349 messageRemoveLog.
header = ulogMsgHeader.msgHeader;
350 read(
reinterpret_cast<char*
>(&messageRemoveLog.
msg_id),
sizeof(messageRemoveLog.
msg_id));
355 else if (ulogMsgHeader.msgHeader.msg_type ==
'D')
358 messageData.
header = ulogMsgHeader.msgHeader;
359 read(
reinterpret_cast<char*
>(&messageData.
msg_id),
sizeof(messageData.
msg_id));
368 size_t currentExtractLocation = 0;
372 for (
const auto& dataField : messageFormat)
374 char* currentData = messageData.
data.data() + currentExtractLocation;
375 if (dataField.name ==
"timestamp")
379 currentExtractLocation +=
sizeof(sensorAccel.
timestamp);
381 else if (dataField.name ==
"timestamp_sample")
387 else if (dataField.name ==
"device_id")
391 currentExtractLocation +=
sizeof(sensorAccel.
device_id);
393 else if (dataField.name ==
"error_count")
397 currentExtractLocation +=
sizeof(sensorAccel.
error_count);
399 else if (dataField.name ==
"x")
401 std::memcpy(&sensorAccel.
x, currentData,
sizeof(sensorAccel.
x));
403 currentExtractLocation +=
sizeof(sensorAccel.
x);
405 else if (dataField.name ==
"y")
407 std::memcpy(&sensorAccel.
y, currentData,
sizeof(sensorAccel.
y));
409 currentExtractLocation +=
sizeof(sensorAccel.
y);
411 else if (dataField.name ==
"z")
413 std::memcpy(&sensorAccel.
z, currentData,
sizeof(sensorAccel.
z));
415 currentExtractLocation +=
sizeof(sensorAccel.
z);
417 else if (dataField.name ==
"temperature")
421 currentExtractLocation +=
sizeof(sensorAccel.
temperature);
423 else if (dataField.name ==
"clip_counter")
427 currentExtractLocation += sensorAccel.
clip_counter.size();
429 else if (dataField.name.compare(0, 7,
"_padding"))
437 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
446 MeasurementData{ .multi_id = _subscribedMessages.at(messageData.msg_id).multi_id,
447 .message_name = _subscribedMessages.at(messageData.msg_id).message_name,
448 .data = sensorAccel }));
454 for (
const auto& dataField : messageFormat)
456 char* currentData = messageData.
data.data() + currentExtractLocation;
457 if (dataField.name ==
"timestamp")
461 currentExtractLocation +=
sizeof(sensorGyro.
timestamp);
463 else if (dataField.name ==
"timestamp_sample")
469 else if (dataField.name ==
"device_id")
473 currentExtractLocation +=
sizeof(sensorGyro.
device_id);
475 else if (dataField.name ==
"x")
477 std::memcpy(&sensorGyro.
x, currentData,
sizeof(sensorGyro.
x));
479 currentExtractLocation +=
sizeof(sensorGyro.
x);
481 else if (dataField.name ==
"y")
483 std::memcpy(&sensorGyro.
y, currentData,
sizeof(sensorGyro.
y));
485 currentExtractLocation +=
sizeof(sensorGyro.
y);
487 else if (dataField.name ==
"z")
489 std::memcpy(&sensorGyro.
z, currentData,
sizeof(sensorGyro.
z));
491 currentExtractLocation +=
sizeof(sensorGyro.
z);
493 else if (dataField.name ==
"temperature")
497 currentExtractLocation +=
sizeof(sensorGyro.
temperature);
499 else if (dataField.name ==
"error_count")
503 currentExtractLocation +=
sizeof(sensorGyro.
error_count);
508 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
517 MeasurementData{ .multi_id = _subscribedMessages.at(messageData.msg_id).multi_id,
518 .message_name = _subscribedMessages.at(messageData.msg_id).message_name,
519 .data = sensorGyro }));
524 for (
const auto& dataField : messageFormat)
526 char* currentData = messageData.
data.data() + currentExtractLocation;
527 if (dataField.name ==
"timestamp")
531 currentExtractLocation +=
sizeof(sensorMag.
timestamp);
533 else if (dataField.name ==
"timestamp_sample")
539 else if (dataField.name ==
"device_id")
543 currentExtractLocation +=
sizeof(sensorMag.
device_id);
545 else if (dataField.name ==
"x")
547 std::memcpy(&sensorMag.
x, currentData,
sizeof(sensorMag.
x));
549 currentExtractLocation +=
sizeof(sensorMag.
x);
551 else if (dataField.name ==
"y")
553 std::memcpy(&sensorMag.
y, currentData,
sizeof(sensorMag.
y));
555 currentExtractLocation +=
sizeof(sensorMag.
y);
557 else if (dataField.name ==
"z")
559 std::memcpy(&sensorMag.
z, currentData,
sizeof(sensorMag.
z));
561 currentExtractLocation +=
sizeof(sensorMag.
z);
563 else if (dataField.name ==
"temperature")
567 currentExtractLocation +=
sizeof(sensorMag.
temperature);
569 else if (dataField.name ==
"error_count")
573 currentExtractLocation +=
sizeof(sensorMag.
error_count);
575 else if (dataField.name ==
"is_external")
579 currentExtractLocation +=
sizeof(sensorMag.
is_external);
581 else if (dataField.name.compare(0, 7,
"_padding"))
589 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
598 MeasurementData{ .multi_id = _subscribedMessages.at(messageData.msg_id).multi_id,
599 .message_name = _subscribedMessages.at(messageData.msg_id).message_name,
600 .data = sensorMag }));
605 for (
const auto& dataField : messageFormat)
607 char* currentData = messageData.
data.data() + currentExtractLocation;
608 if (dataField.name ==
"timestamp")
610 std::memcpy(&vehicleGpsPosition.
timestamp, currentData,
sizeof(vehicleGpsPosition.
timestamp));
612 currentExtractLocation +=
sizeof(vehicleGpsPosition.
timestamp);
614 else if (dataField.name ==
"time_utc_usec")
618 currentExtractLocation +=
sizeof(vehicleGpsPosition.
time_utc_usec);
620 else if (dataField.name ==
"lat")
622 std::memcpy(&vehicleGpsPosition.
lat, currentData,
sizeof(vehicleGpsPosition.
lat));
624 currentExtractLocation +=
sizeof(vehicleGpsPosition.
lat);
626 else if (dataField.name ==
"lon")
628 std::memcpy(&vehicleGpsPosition.
lon, currentData,
sizeof(vehicleGpsPosition.
lon));
630 currentExtractLocation +=
sizeof(vehicleGpsPosition.
lon);
632 else if (dataField.name ==
"alt")
634 std::memcpy(&vehicleGpsPosition.
alt, currentData,
sizeof(vehicleGpsPosition.
alt));
636 currentExtractLocation +=
sizeof(vehicleGpsPosition.
alt);
638 else if (dataField.name ==
"alt_ellipsoid")
642 currentExtractLocation +=
sizeof(vehicleGpsPosition.
alt_ellipsoid);
644 else if (dataField.name ==
"s_variance_m_s")
648 currentExtractLocation +=
sizeof(vehicleGpsPosition.
s_variance_m_s);
650 else if (dataField.name ==
"c_variance_rad")
654 currentExtractLocation +=
sizeof(vehicleGpsPosition.
c_variance_rad);
656 else if (dataField.name ==
"eph")
658 std::memcpy(&vehicleGpsPosition.
eph, currentData,
sizeof(vehicleGpsPosition.
eph));
660 currentExtractLocation +=
sizeof(vehicleGpsPosition.
eph);
662 else if (dataField.name ==
"epv")
664 std::memcpy(&vehicleGpsPosition.
epv, currentData,
sizeof(vehicleGpsPosition.
epv));
666 currentExtractLocation +=
sizeof(vehicleGpsPosition.
epv);
668 else if (dataField.name ==
"hdop")
670 std::memcpy(&vehicleGpsPosition.
hdop, currentData,
sizeof(vehicleGpsPosition.
hdop));
672 currentExtractLocation +=
sizeof(vehicleGpsPosition.
hdop);
674 else if (dataField.name ==
"vdop")
676 std::memcpy(&vehicleGpsPosition.
vdop, currentData,
sizeof(vehicleGpsPosition.
lat));
678 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vdop);
680 else if (dataField.name ==
"noise_per_ms")
684 currentExtractLocation +=
sizeof(vehicleGpsPosition.
noise_per_ms);
686 else if (dataField.name ==
"jamming_indicator")
692 else if (dataField.name ==
"vel_m_s")
694 std::memcpy(&vehicleGpsPosition.
vel_m_s, currentData,
sizeof(vehicleGpsPosition.
vel_m_s));
696 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vel_m_s);
698 else if (dataField.name ==
"vel_n_m_s")
700 std::memcpy(&vehicleGpsPosition.
vel_n_m_s, currentData,
sizeof(vehicleGpsPosition.
vel_n_m_s));
702 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vel_n_m_s);
704 else if (dataField.name ==
"vel_e_m_s")
706 std::memcpy(&vehicleGpsPosition.
vel_e_m_s, currentData,
sizeof(vehicleGpsPosition.
vel_e_m_s));
708 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vel_e_m_s);
710 else if (dataField.name ==
"vel_d_m_s")
712 std::memcpy(&vehicleGpsPosition.
vel_d_m_s, currentData,
sizeof(vehicleGpsPosition.
vel_d_m_s));
714 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vel_d_m_s);
716 else if (dataField.name ==
"cog_rad")
718 std::memcpy(&vehicleGpsPosition.
cog_rad, currentData,
sizeof(vehicleGpsPosition.
cog_rad));
720 currentExtractLocation +=
sizeof(vehicleGpsPosition.
cog_rad);
722 else if (dataField.name ==
"timestamp_time_relative")
728 else if (dataField.name ==
"heading")
730 std::memcpy(&vehicleGpsPosition.
heading, currentData,
sizeof(vehicleGpsPosition.
heading));
732 currentExtractLocation +=
sizeof(vehicleGpsPosition.
heading);
734 else if (dataField.name ==
"heading_offset")
738 currentExtractLocation +=
sizeof(vehicleGpsPosition.
heading_offset);
740 else if (dataField.name ==
"fix_type")
742 std::memcpy(&vehicleGpsPosition.
fix_type, currentData,
sizeof(vehicleGpsPosition.
fix_type));
744 currentExtractLocation +=
sizeof(vehicleGpsPosition.
fix_type);
746 else if (dataField.name ==
"vel_ned_valid")
750 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vel_ned_valid);
752 else if (dataField.name ==
"satellites_used")
758 else if (dataField.name.compare(0, 7,
"_padding"))
766 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
772 [[maybe_unused]]
auto newGnssTime =
InsTime(1970, 1, 1, 0, 0, vehicleGpsPosition.
time_utc_usec * 1e-6L);
773 LOG_DATA(
"{}: Updating GnssTime from {} to {} (Diff {} sec)",
nameId(),
lastGnssTime.gnssTime.toYMDHMS(), newGnssTime.toYMDHMS(),
static_cast<double>((newGnssTime -
lastGnssTime.gnssTime).count()));
782 auto iter = std::ranges::find_if(
_epochData, [](
const std::pair<uint64_t, MeasurementData>& v) {
783 return std::holds_alternative<UlogFile::VehicleGpsPosition>(v.second.data);
797 MeasurementData{ .multi_id = _subscribedMessages.at(messageData.msg_id).multi_id,
798 .message_name = _subscribedMessages.at(messageData.msg_id).message_name,
799 .data = vehicleGpsPosition }));
804 for (
const auto& dataField : messageFormat)
806 char* currentData = messageData.
data.data() + currentExtractLocation;
807 if (dataField.name ==
"timestamp")
809 std::memcpy(&vehicleAttitude.
timestamp, currentData,
sizeof(vehicleAttitude.
timestamp));
811 currentExtractLocation +=
sizeof(vehicleAttitude.
timestamp);
813 else if (dataField.name ==
"q")
815 std::memcpy(vehicleAttitude.
q.data(), currentData, vehicleAttitude.
q.size());
816 LOG_DATA(
"{}: vehicleAttitude.q: {}",
nameId(), fmt::join(vehicleAttitude.
q,
", "));
817 currentExtractLocation += vehicleAttitude.
q.size();
819 else if (dataField.name ==
"delta_q_reset")
823 currentExtractLocation += vehicleAttitude.
delta_q_reset.size();
825 if (dataField.name ==
"quat_reset_counter")
831 else if (dataField.name.compare(0, 7,
"_padding"))
839 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
845 auto iter = std::ranges::find_if(
_epochData, [](
const std::pair<uint64_t, MeasurementData>& v) {
846 return std::holds_alternative<UlogFile::VehicleAttitude>(v.second.data);
860 MeasurementData{ .multi_id = _subscribedMessages.at(messageData.msg_id).multi_id,
861 .message_name = _subscribedMessages.at(messageData.msg_id).message_name,
862 .data = vehicleAttitude }));
867 for (
const auto& dataField : messageFormat)
869 char* currentData = messageData.
data.data() + currentExtractLocation;
870 if (dataField.name ==
"timestamp")
872 std::memcpy(&vehicleControlMode.
timestamp, currentData,
sizeof(vehicleControlMode.
timestamp));
874 currentExtractLocation +=
sizeof(vehicleControlMode.
timestamp);
876 else if (dataField.name ==
"flag_armed")
878 std::memcpy(&vehicleControlMode.
flag_armed, currentData,
sizeof(vehicleControlMode.
flag_armed));
880 currentExtractLocation +=
sizeof(vehicleControlMode.
flag_armed);
882 else if (dataField.name ==
"flag_external_manual_override_ok")
888 else if (dataField.name ==
"flag_control_manual_enabled")
894 else if (dataField.name ==
"flag_control_auto_enabled")
900 else if (dataField.name ==
"flag_control_offboard_enabled")
906 else if (dataField.name ==
"flag_control_rates_enabled")
912 else if (dataField.name ==
"flag_control_attitude_enabled")
918 else if (dataField.name ==
"flag_control_yawrate_override_enabled")
924 else if (dataField.name ==
"flag_control_rattitude_enabled")
930 else if (dataField.name ==
"flag_control_force_enabled")
936 else if (dataField.name ==
"flag_control_acceleration_enabled")
942 else if (dataField.name ==
"flag_control_velocity_enabled")
948 else if (dataField.name ==
"flag_control_position_enabled")
954 else if (dataField.name ==
"flag_control_altitude_enabled")
960 else if (dataField.name ==
"flag_control_climb_rate_enabled")
966 else if (dataField.name ==
"flag_control_termination_enabled")
972 else if (dataField.name ==
"flag_control_fixed_hdg_enabled")
978 else if (dataField.name.compare(0, 7,
"_padding"))
986 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
994 for (
const auto& dataField : messageFormat)
996 char* currentData = messageData.
data.data() + currentExtractLocation;
997 if (dataField.name ==
"timestamp")
999 std::memcpy(&vehicleAirData.
timestamp, currentData,
sizeof(vehicleAirData.
timestamp));
1001 currentExtractLocation +=
sizeof(vehicleAirData.
timestamp);
1003 else if (dataField.name ==
"timestamp_sample")
1009 else if (dataField.name ==
"baro_device_id")
1015 else if (dataField.name ==
"baro_alt_meter")
1021 else if (dataField.name ==
"baro_temp_celcius")
1027 else if (dataField.name ==
"baro_pressure_pa")
1033 else if (dataField.name ==
"rho")
1035 std::memcpy(&vehicleAirData.
rho, currentData,
sizeof(vehicleAirData.
rho));
1037 currentExtractLocation +=
sizeof(vehicleAirData.
rho);
1039 else if (dataField.name.compare(0, 7,
"_padding"))
1047 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
1066 auto obs = std::make_shared<ImuObs>(this->
_imuPos);
1068 uint64_t timeSinceStartupNew{};
1070 for ([[maybe_unused]]
const auto& [timestamp, measurement] :
_epochData)
1072 LOG_DATA(
"{}: [{}] {}: {}",
nameId(), timestamp, measurement.multi_id, measurement.message_name);
1075 bool accelFound =
false;
1076 bool angularRateFound =
false;
1081 if (std::holds_alternative<SensorAccel>(it->second.data) && (it->second.multi_id ==
static_cast<uint8_t
>(multi_id))
1085 timeSinceStartupNew = it->first;
1086 float accelX = std::get<SensorAccel>(it->second.data).x;
1087 float accelY = std::get<SensorAccel>(it->second.data).y;
1088 float accelZ = std::get<SensorAccel>(it->second.data).z;
1089 obs->p_acceleration = { accelX, accelY, accelZ };
1093 LOG_DATA(
"{}: accelX = {}, accelY = {}, accelZ = {}",
nameId(), accelX, accelY, accelZ);
1096 else if (std::holds_alternative<SensorGyro>(it->second.data) && (it->second.multi_id ==
static_cast<uint8_t
>(multi_id))
1097 && !angularRateFound)
1099 angularRateFound =
true;
1100 timeSinceStartupNew = it->first;
1101 float gyroX = std::get<SensorGyro>(it->second.data).x;
1102 float gyroY = std::get<SensorGyro>(it->second.data).y;
1103 float gyroZ = std::get<SensorGyro>(it->second.data).z;
1104 obs->p_angularRate = { gyroX, gyroY, gyroZ };
1108 LOG_DATA(
"{}: gyroX = {}, gyroY = {}, gyroZ = {}",
nameId(), gyroX, gyroY, gyroZ);
1111 else if (std::holds_alternative<SensorMag>(it->second.data) && (it->second.multi_id ==
static_cast<uint8_t
>(multi_id))
1112 && !obs->p_magneticField.has_value())
1114 float magX = std::get<SensorMag>(it->second.data).x;
1115 float magY = std::get<SensorMag>(it->second.data).y;
1116 float magZ = std::get<SensorMag>(it->second.data).z;
1117 obs->p_magneticField.emplace(magX, magY, magZ);
1121 LOG_DATA(
"{}: magX = {}, magY = {}, magZ = {}",
nameId(), magX, magY, magZ);
1129 obs->insTime =
lastGnssTime.gnssTime + std::chrono::microseconds(
static_cast<int64_t
>(timeSinceStartupNew) -
static_cast<int64_t
>(
lastGnssTime.timeSinceStartup));
1131 LOG_DATA(
"{}: Sending out ImuObs {}: {}",
nameId(), multi_id, obs->insTime.toYMDHMS());
1136 else if (multi_id == 1)
1149 LOG_DATA(
"{}: Construct PosVelAtt and invoke callback",
nameId());
1151 auto obs = std::make_shared<NAV::PosVelAtt>();
1153 const auto& vehicleGpsPosition = std::get<VehicleGpsPosition>(gpsIter->second.data);
1154 const auto& vehicleAttitude = std::get<VehicleAttitude>(attIter->second.data);
1156 obs->insTime =
InsTime(0, 0, 0, 0, 0, vehicleGpsPosition.time_utc_usec * 1e-6L);
1157 obs->setPosVelAtt_n(Eigen::Vector3d{
deg2rad(1e-7 *
static_cast<double>(vehicleGpsPosition.lat)),
deg2rad(1e-7 *
static_cast<double>(vehicleGpsPosition.lon)), 1e-3 * (
static_cast<double>(vehicleGpsPosition.alt_ellipsoid)) },
1158 Eigen::Vector3d{ vehicleGpsPosition.vel_n_m_s, vehicleGpsPosition.vel_e_m_s, vehicleGpsPosition.vel_d_m_s },
1159 Eigen::Quaterniond{ vehicleAttitude.q.at(0), vehicleAttitude.q.at(1), vehicleAttitude.q.at(2), vehicleAttitude.q.at(3) });
1168 LOG_DATA(
"{}: Sending out PosVelAtt: {}",
nameId(), obs->insTime.toYMDHMS());
1173 else if (ulogMsgHeader.msgHeader.msg_type ==
'L')
1176 messageLog.
header = ulogMsgHeader.msgHeader;
1185 LOG_DATA(
"{}: Log-level: ALERT - Action must be taken immediately",
nameId());
1197 LOG_DATA(
"{}: Log-level: WARNING - Warning conditions",
nameId());
1201 LOG_DATA(
"{}: Log-level: NOTICE - Normal but significant condition",
nameId());
1209 LOG_DATA(
"{}: Log-level: DEBUG - Debug-level messages",
nameId());
1223 else if (ulogMsgHeader.msgHeader.msg_type ==
'C')
1226 messageLogTagged.
header = ulogMsgHeader.msgHeader;
1233 else if (messageLogTagged.
log_level == 49)
1235 LOG_DATA(
"{}: Log-level: ALERT - Action must be taken immediately",
nameId());
1237 else if (messageLogTagged.
log_level == 50)
1241 else if (messageLogTagged.
log_level == 51)
1245 else if (messageLogTagged.
log_level == 52)
1247 LOG_DATA(
"{}: Log-level: WARNING - Warning conditions",
nameId());
1249 else if (messageLogTagged.
log_level == 53)
1251 LOG_DATA(
"{}: Log-level: NOTICE - Normal but significant condition",
nameId());
1253 else if (messageLogTagged.
log_level == 54)
1257 else if (messageLogTagged.
log_level == 55)
1259 LOG_DATA(
"{}: Log-level: DEBUG - Debug-level messages",
nameId());
1266 read(
reinterpret_cast<char*
>(&messageLogTagged.
tag),
sizeof(messageLogTagged.
tag));
1275 else if (ulogMsgHeader.msgHeader.msg_type ==
'S')
1278 messageSync.
header = ulogMsgHeader.msgHeader;
1279 read(
reinterpret_cast<char*
>(messageSync.
syncMsg.data()),
sizeof(messageSync.
syncMsg));
1282 else if (ulogMsgHeader.msgHeader.msg_type ==
'O')
1285 messageDropout.
header = ulogMsgHeader.msgHeader;
1289 else if (ulogMsgHeader.msgHeader.msg_type ==
'I')
1293 else if (ulogMsgHeader.msgHeader.msg_type ==
'M')
1297 else if (ulogMsgHeader.msgHeader.msg_type ==
'P')
1301 else if (ulogMsgHeader.msgHeader.msg_type ==
'Q')
1307 std::string nextChars;
1308 [[maybe_unused]]
auto unidentifiedPos =
static_cast<uint64_t
>(
tellg());
1309 nextChars.resize(100);
1310 read(nextChars.data(), 100);
1311 LOG_WARN(
"{}: Message type not identified. Position: {}, The next 100 chars: {}",
nameId(), unidentifiedPos, nextChars);
1314 seekg(-100, std::ios_base::cur);