168 std::array<char, 16> data{};
172 read(ulogHeader.data.data(), ulogHeader.data.size());
175 if ((ulogHeader.header.fileMagic[0] !=
'U') || (ulogHeader.header.fileMagic[1] !=
'L') || (ulogHeader.header.fileMagic[2] !=
'o') || (ulogHeader.header.fileMagic[3] !=
'g'))
180 LOG_DEBUG(
"{}: version: {}",
nameId(),
static_cast<int>(ulogHeader.header.version));
182 LOG_DEBUG(
"{}: time stamp [µs]: {}",
nameId(), ulogHeader.header.timeStamp);
187 std::array<char, 3> data{};
191 while ((ulogMsgHeader.msgHeader.msg_type !=
'A') && (ulogMsgHeader.msgHeader.msg_type !=
'L'))
193 read(ulogMsgHeader.data.data(), ulogMsgHeader.data.size());
195 LOG_DATA(
"{}: msgSize: {}, msgType: {}",
nameId(), ulogMsgHeader.msgHeader.msg_size, ulogMsgHeader.msgHeader.msg_type);
199 if (ulogMsgHeader.msgHeader.msg_type ==
'B')
201 if (ulogMsgHeader.msgHeader.msg_size > 40)
203 LOG_WARN(
"{}: Exceeding bytes in 'flag bitset message' are ignored. Check for ULog file format update.",
nameId());
208 std::array<char, 40> data{};
212 read(ulogMsgFlagBits.data.data(), ulogMsgFlagBits.data.size() *
sizeof(
char));
216 else if (ulogMsgHeader.msgHeader.msg_type ==
'F')
219 messageFormat.
header = ulogMsgHeader.msgHeader;
224 read(messageFormat.
format.data(), ulogMsgHeader.msgHeader.msg_size);
227 std::string msgName = messageFormat.
format.substr(0, messageFormat.
format.find(
':'));
230 std::stringstream lineStream(messageFormat.
format.substr(messageFormat.
format.find(
':') + 1));
233 std::vector<DataField> msgDataFields;
235 while (std::getline(lineStream, cell,
';'))
237 DataField data_field{ .type = cell.substr(0, cell.find(
' ')), .name = cell.substr(cell.find(
' ') + 1) };
238 msgDataFields.push_back(data_field);
241 if (msgName ==
"sensor_accel")
245 else if (msgName ==
"sensor_gyro")
249 else if (msgName ==
"sensor_mag")
253 else if (msgName ==
"vehicle_gps_position")
257 else if (msgName ==
"vehicle_attitude")
261 else if (msgName ==
"vehicle_air_data")
265 else if (msgName ==
"vehicle_control_mode")
269 else if (msgName ==
"vehicle_status")
273 else if (msgName ==
"cpuload")
279 LOG_ERROR(
"{}: Data format '{}' could not be decoded",
nameId(), msgName);
284 else if (ulogMsgHeader.msgHeader.msg_type ==
'I')
290 else if (ulogMsgHeader.msgHeader.msg_type ==
'M')
296 else if (ulogMsgHeader.msgHeader.msg_type ==
'P')
302 else if (ulogMsgHeader.msgHeader.msg_type ==
'Q')
307 seekg(-3, std::ios_base::cur);
317 std::array<char, 3> data{};
323 read(ulogMsgHeader.data.data(), ulogMsgHeader.data.size());
325 LOG_DATA(
"{}: msgSize: {}",
nameId(), ulogMsgHeader.msgHeader.msg_size);
326 LOG_DATA(
"{}: msgType: {}",
nameId(), ulogMsgHeader.msgHeader.msg_type);
328 if (ulogMsgHeader.msgHeader.msg_type ==
'A')
331 messageAddLog.
header = ulogMsgHeader.msgHeader;
334 read(
reinterpret_cast<char*
>(&messageAddLog.
msg_id),
sizeof(messageAddLog.
msg_id));
344 else if (ulogMsgHeader.msgHeader.msg_type ==
'R')
347 messageRemoveLog.
header = ulogMsgHeader.msgHeader;
348 read(
reinterpret_cast<char*
>(&messageRemoveLog.
msg_id),
sizeof(messageRemoveLog.
msg_id));
353 else if (ulogMsgHeader.msgHeader.msg_type ==
'D')
356 messageData.
header = ulogMsgHeader.msgHeader;
357 read(
reinterpret_cast<char*
>(&messageData.
msg_id),
sizeof(messageData.
msg_id));
366 size_t currentExtractLocation = 0;
370 for (
const auto& dataField : messageFormat)
372 char* currentData = messageData.
data.data() + currentExtractLocation;
373 if (dataField.name ==
"timestamp")
377 currentExtractLocation +=
sizeof(sensorAccel.
timestamp);
379 else if (dataField.name ==
"timestamp_sample")
385 else if (dataField.name ==
"device_id")
389 currentExtractLocation +=
sizeof(sensorAccel.
device_id);
391 else if (dataField.name ==
"error_count")
395 currentExtractLocation +=
sizeof(sensorAccel.
error_count);
397 else if (dataField.name ==
"x")
399 std::memcpy(&sensorAccel.
x, currentData,
sizeof(sensorAccel.
x));
401 currentExtractLocation +=
sizeof(sensorAccel.
x);
403 else if (dataField.name ==
"y")
405 std::memcpy(&sensorAccel.
y, currentData,
sizeof(sensorAccel.
y));
407 currentExtractLocation +=
sizeof(sensorAccel.
y);
409 else if (dataField.name ==
"z")
411 std::memcpy(&sensorAccel.
z, currentData,
sizeof(sensorAccel.
z));
413 currentExtractLocation +=
sizeof(sensorAccel.
z);
415 else if (dataField.name ==
"temperature")
419 currentExtractLocation +=
sizeof(sensorAccel.
temperature);
421 else if (dataField.name ==
"clip_counter")
425 currentExtractLocation += sensorAccel.
clip_counter.size();
427 else if (dataField.name.compare(0, 7,
"_padding"))
435 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
444 MeasurementData{ .multi_id = _subscribedMessages.at(messageData.msg_id).multi_id,
445 .message_name = _subscribedMessages.at(messageData.msg_id).message_name,
446 .data = sensorAccel }));
452 for (
const auto& dataField : messageFormat)
454 char* currentData = messageData.
data.data() + currentExtractLocation;
455 if (dataField.name ==
"timestamp")
459 currentExtractLocation +=
sizeof(sensorGyro.
timestamp);
461 else if (dataField.name ==
"timestamp_sample")
467 else if (dataField.name ==
"device_id")
471 currentExtractLocation +=
sizeof(sensorGyro.
device_id);
473 else if (dataField.name ==
"x")
475 std::memcpy(&sensorGyro.
x, currentData,
sizeof(sensorGyro.
x));
477 currentExtractLocation +=
sizeof(sensorGyro.
x);
479 else if (dataField.name ==
"y")
481 std::memcpy(&sensorGyro.
y, currentData,
sizeof(sensorGyro.
y));
483 currentExtractLocation +=
sizeof(sensorGyro.
y);
485 else if (dataField.name ==
"z")
487 std::memcpy(&sensorGyro.
z, currentData,
sizeof(sensorGyro.
z));
489 currentExtractLocation +=
sizeof(sensorGyro.
z);
491 else if (dataField.name ==
"temperature")
495 currentExtractLocation +=
sizeof(sensorGyro.
temperature);
497 else if (dataField.name ==
"error_count")
501 currentExtractLocation +=
sizeof(sensorGyro.
error_count);
506 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
515 MeasurementData{ .multi_id = _subscribedMessages.at(messageData.msg_id).multi_id,
516 .message_name = _subscribedMessages.at(messageData.msg_id).message_name,
517 .data = sensorGyro }));
522 for (
const auto& dataField : messageFormat)
524 char* currentData = messageData.
data.data() + currentExtractLocation;
525 if (dataField.name ==
"timestamp")
529 currentExtractLocation +=
sizeof(sensorMag.
timestamp);
531 else if (dataField.name ==
"timestamp_sample")
537 else if (dataField.name ==
"device_id")
541 currentExtractLocation +=
sizeof(sensorMag.
device_id);
543 else if (dataField.name ==
"x")
545 std::memcpy(&sensorMag.
x, currentData,
sizeof(sensorMag.
x));
547 currentExtractLocation +=
sizeof(sensorMag.
x);
549 else if (dataField.name ==
"y")
551 std::memcpy(&sensorMag.
y, currentData,
sizeof(sensorMag.
y));
553 currentExtractLocation +=
sizeof(sensorMag.
y);
555 else if (dataField.name ==
"z")
557 std::memcpy(&sensorMag.
z, currentData,
sizeof(sensorMag.
z));
559 currentExtractLocation +=
sizeof(sensorMag.
z);
561 else if (dataField.name ==
"temperature")
565 currentExtractLocation +=
sizeof(sensorMag.
temperature);
567 else if (dataField.name ==
"error_count")
571 currentExtractLocation +=
sizeof(sensorMag.
error_count);
573 else if (dataField.name ==
"is_external")
577 currentExtractLocation +=
sizeof(sensorMag.
is_external);
579 else if (dataField.name.compare(0, 7,
"_padding"))
587 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
596 MeasurementData{ .multi_id = _subscribedMessages.at(messageData.msg_id).multi_id,
597 .message_name = _subscribedMessages.at(messageData.msg_id).message_name,
598 .data = sensorMag }));
603 for (
const auto& dataField : messageFormat)
605 char* currentData = messageData.
data.data() + currentExtractLocation;
606 if (dataField.name ==
"timestamp")
608 std::memcpy(&vehicleGpsPosition.
timestamp, currentData,
sizeof(vehicleGpsPosition.
timestamp));
610 currentExtractLocation +=
sizeof(vehicleGpsPosition.
timestamp);
612 else if (dataField.name ==
"time_utc_usec")
616 currentExtractLocation +=
sizeof(vehicleGpsPosition.
time_utc_usec);
618 else if (dataField.name ==
"lat")
620 std::memcpy(&vehicleGpsPosition.
lat, currentData,
sizeof(vehicleGpsPosition.
lat));
622 currentExtractLocation +=
sizeof(vehicleGpsPosition.
lat);
624 else if (dataField.name ==
"lon")
626 std::memcpy(&vehicleGpsPosition.
lon, currentData,
sizeof(vehicleGpsPosition.
lon));
628 currentExtractLocation +=
sizeof(vehicleGpsPosition.
lon);
630 else if (dataField.name ==
"alt")
632 std::memcpy(&vehicleGpsPosition.
alt, currentData,
sizeof(vehicleGpsPosition.
alt));
634 currentExtractLocation +=
sizeof(vehicleGpsPosition.
alt);
636 else if (dataField.name ==
"alt_ellipsoid")
640 currentExtractLocation +=
sizeof(vehicleGpsPosition.
alt_ellipsoid);
642 else if (dataField.name ==
"s_variance_m_s")
646 currentExtractLocation +=
sizeof(vehicleGpsPosition.
s_variance_m_s);
648 else if (dataField.name ==
"c_variance_rad")
652 currentExtractLocation +=
sizeof(vehicleGpsPosition.
c_variance_rad);
654 else if (dataField.name ==
"eph")
656 std::memcpy(&vehicleGpsPosition.
eph, currentData,
sizeof(vehicleGpsPosition.
eph));
658 currentExtractLocation +=
sizeof(vehicleGpsPosition.
eph);
660 else if (dataField.name ==
"epv")
662 std::memcpy(&vehicleGpsPosition.
epv, currentData,
sizeof(vehicleGpsPosition.
epv));
664 currentExtractLocation +=
sizeof(vehicleGpsPosition.
epv);
666 else if (dataField.name ==
"hdop")
668 std::memcpy(&vehicleGpsPosition.
hdop, currentData,
sizeof(vehicleGpsPosition.
hdop));
670 currentExtractLocation +=
sizeof(vehicleGpsPosition.
hdop);
672 else if (dataField.name ==
"vdop")
674 std::memcpy(&vehicleGpsPosition.
vdop, currentData,
sizeof(vehicleGpsPosition.
lat));
676 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vdop);
678 else if (dataField.name ==
"noise_per_ms")
682 currentExtractLocation +=
sizeof(vehicleGpsPosition.
noise_per_ms);
684 else if (dataField.name ==
"jamming_indicator")
690 else if (dataField.name ==
"vel_m_s")
692 std::memcpy(&vehicleGpsPosition.
vel_m_s, currentData,
sizeof(vehicleGpsPosition.
vel_m_s));
694 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vel_m_s);
696 else if (dataField.name ==
"vel_n_m_s")
698 std::memcpy(&vehicleGpsPosition.
vel_n_m_s, currentData,
sizeof(vehicleGpsPosition.
vel_n_m_s));
700 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vel_n_m_s);
702 else if (dataField.name ==
"vel_e_m_s")
704 std::memcpy(&vehicleGpsPosition.
vel_e_m_s, currentData,
sizeof(vehicleGpsPosition.
vel_e_m_s));
706 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vel_e_m_s);
708 else if (dataField.name ==
"vel_d_m_s")
710 std::memcpy(&vehicleGpsPosition.
vel_d_m_s, currentData,
sizeof(vehicleGpsPosition.
vel_d_m_s));
712 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vel_d_m_s);
714 else if (dataField.name ==
"cog_rad")
716 std::memcpy(&vehicleGpsPosition.
cog_rad, currentData,
sizeof(vehicleGpsPosition.
cog_rad));
718 currentExtractLocation +=
sizeof(vehicleGpsPosition.
cog_rad);
720 else if (dataField.name ==
"timestamp_time_relative")
726 else if (dataField.name ==
"heading")
728 std::memcpy(&vehicleGpsPosition.
heading, currentData,
sizeof(vehicleGpsPosition.
heading));
730 currentExtractLocation +=
sizeof(vehicleGpsPosition.
heading);
732 else if (dataField.name ==
"heading_offset")
736 currentExtractLocation +=
sizeof(vehicleGpsPosition.
heading_offset);
738 else if (dataField.name ==
"fix_type")
740 std::memcpy(&vehicleGpsPosition.
fix_type, currentData,
sizeof(vehicleGpsPosition.
fix_type));
742 currentExtractLocation +=
sizeof(vehicleGpsPosition.
fix_type);
744 else if (dataField.name ==
"vel_ned_valid")
748 currentExtractLocation +=
sizeof(vehicleGpsPosition.
vel_ned_valid);
750 else if (dataField.name ==
"satellites_used")
756 else if (dataField.name.compare(0, 7,
"_padding"))
764 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
770 [[maybe_unused]]
auto newGnssTime =
InsTime(1970, 1, 1, 0, 0, vehicleGpsPosition.
time_utc_usec * 1e-6L);
771 LOG_DATA(
"{}: Updating GnssTime from {} to {} (Diff {} sec)",
nameId(),
lastGnssTime.gnssTime.toYMDHMS(), newGnssTime.toYMDHMS(),
static_cast<double>((newGnssTime -
lastGnssTime.gnssTime).count()));
780 auto iter = std::ranges::find_if(
_epochData, [](
const std::pair<uint64_t, MeasurementData>& v) {
781 return std::holds_alternative<UlogFile::VehicleGpsPosition>(v.second.data);
795 MeasurementData{ .multi_id = _subscribedMessages.at(messageData.msg_id).multi_id,
796 .message_name = _subscribedMessages.at(messageData.msg_id).message_name,
797 .data = vehicleGpsPosition }));
802 for (
const auto& dataField : messageFormat)
804 char* currentData = messageData.
data.data() + currentExtractLocation;
805 if (dataField.name ==
"timestamp")
807 std::memcpy(&vehicleAttitude.
timestamp, currentData,
sizeof(vehicleAttitude.
timestamp));
809 currentExtractLocation +=
sizeof(vehicleAttitude.
timestamp);
811 else if (dataField.name ==
"q")
813 std::memcpy(vehicleAttitude.
q.data(), currentData, vehicleAttitude.
q.size());
814 LOG_DATA(
"{}: vehicleAttitude.q: {}",
nameId(), fmt::join(vehicleAttitude.
q,
", "));
815 currentExtractLocation += vehicleAttitude.
q.size();
817 else if (dataField.name ==
"delta_q_reset")
821 currentExtractLocation += vehicleAttitude.
delta_q_reset.size();
823 if (dataField.name ==
"quat_reset_counter")
829 else if (dataField.name.compare(0, 7,
"_padding"))
837 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
843 auto iter = std::ranges::find_if(
_epochData, [](
const std::pair<uint64_t, MeasurementData>& v) {
844 return std::holds_alternative<UlogFile::VehicleAttitude>(v.second.data);
858 MeasurementData{ .multi_id = _subscribedMessages.at(messageData.msg_id).multi_id,
859 .message_name = _subscribedMessages.at(messageData.msg_id).message_name,
860 .data = vehicleAttitude }));
865 for (
const auto& dataField : messageFormat)
867 char* currentData = messageData.
data.data() + currentExtractLocation;
868 if (dataField.name ==
"timestamp")
870 std::memcpy(&vehicleControlMode.
timestamp, currentData,
sizeof(vehicleControlMode.
timestamp));
872 currentExtractLocation +=
sizeof(vehicleControlMode.
timestamp);
874 else if (dataField.name ==
"flag_armed")
876 std::memcpy(&vehicleControlMode.
flag_armed, currentData,
sizeof(vehicleControlMode.
flag_armed));
878 currentExtractLocation +=
sizeof(vehicleControlMode.
flag_armed);
880 else if (dataField.name ==
"flag_external_manual_override_ok")
886 else if (dataField.name ==
"flag_control_manual_enabled")
892 else if (dataField.name ==
"flag_control_auto_enabled")
898 else if (dataField.name ==
"flag_control_offboard_enabled")
904 else if (dataField.name ==
"flag_control_rates_enabled")
910 else if (dataField.name ==
"flag_control_attitude_enabled")
916 else if (dataField.name ==
"flag_control_yawrate_override_enabled")
922 else if (dataField.name ==
"flag_control_rattitude_enabled")
928 else if (dataField.name ==
"flag_control_force_enabled")
934 else if (dataField.name ==
"flag_control_acceleration_enabled")
940 else if (dataField.name ==
"flag_control_velocity_enabled")
946 else if (dataField.name ==
"flag_control_position_enabled")
952 else if (dataField.name ==
"flag_control_altitude_enabled")
958 else if (dataField.name ==
"flag_control_climb_rate_enabled")
964 else if (dataField.name ==
"flag_control_termination_enabled")
970 else if (dataField.name ==
"flag_control_fixed_hdg_enabled")
976 else if (dataField.name.compare(0, 7,
"_padding"))
984 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
992 for (
const auto& dataField : messageFormat)
994 char* currentData = messageData.
data.data() + currentExtractLocation;
995 if (dataField.name ==
"timestamp")
997 std::memcpy(&vehicleAirData.
timestamp, currentData,
sizeof(vehicleAirData.
timestamp));
999 currentExtractLocation +=
sizeof(vehicleAirData.
timestamp);
1001 else if (dataField.name ==
"timestamp_sample")
1007 else if (dataField.name ==
"baro_device_id")
1013 else if (dataField.name ==
"baro_alt_meter")
1019 else if (dataField.name ==
"baro_temp_celcius")
1025 else if (dataField.name ==
"baro_pressure_pa")
1031 else if (dataField.name ==
"rho")
1033 std::memcpy(&vehicleAirData.
rho, currentData,
sizeof(vehicleAirData.
rho));
1035 currentExtractLocation +=
sizeof(vehicleAirData.
rho);
1037 else if (dataField.name.compare(0, 7,
"_padding"))
1045 LOG_WARN(
"{}: dataField.name = '{}' or dataField.type = '{}' is unknown",
nameId(), dataField.name, dataField.type);
1064 auto obs = std::make_shared<ImuObs>(this->
_imuPos);
1066 uint64_t timeSinceStartupNew{};
1068 for ([[maybe_unused]]
const auto& [timestamp, measurement] :
_epochData)
1070 LOG_DATA(
"{}: [{}] {}: {}",
nameId(), timestamp, measurement.multi_id, measurement.message_name);
1073 bool accelFound =
false;
1074 bool angularRateFound =
false;
1079 if (std::holds_alternative<SensorAccel>(it->second.data) && (it->second.multi_id ==
static_cast<uint8_t
>(multi_id))
1083 timeSinceStartupNew = it->first;
1084 float accelX = std::get<SensorAccel>(it->second.data).x;
1085 float accelY = std::get<SensorAccel>(it->second.data).y;
1086 float accelZ = std::get<SensorAccel>(it->second.data).z;
1087 obs->p_acceleration = { accelX, accelY, accelZ };
1091 LOG_DATA(
"{}: accelX = {}, accelY = {}, accelZ = {}",
nameId(), accelX, accelY, accelZ);
1094 else if (std::holds_alternative<SensorGyro>(it->second.data) && (it->second.multi_id ==
static_cast<uint8_t
>(multi_id))
1095 && !angularRateFound)
1097 angularRateFound =
true;
1098 timeSinceStartupNew = it->first;
1099 float gyroX = std::get<SensorGyro>(it->second.data).x;
1100 float gyroY = std::get<SensorGyro>(it->second.data).y;
1101 float gyroZ = std::get<SensorGyro>(it->second.data).z;
1102 obs->p_angularRate = { gyroX, gyroY, gyroZ };
1106 LOG_DATA(
"{}: gyroX = {}, gyroY = {}, gyroZ = {}",
nameId(), gyroX, gyroY, gyroZ);
1109 else if (std::holds_alternative<SensorMag>(it->second.data) && (it->second.multi_id ==
static_cast<uint8_t
>(multi_id))
1110 && !obs->p_magneticField.has_value())
1112 float magX = std::get<SensorMag>(it->second.data).x;
1113 float magY = std::get<SensorMag>(it->second.data).y;
1114 float magZ = std::get<SensorMag>(it->second.data).z;
1115 obs->p_magneticField.emplace(magX, magY, magZ);
1119 LOG_DATA(
"{}: magX = {}, magY = {}, magZ = {}",
nameId(), magX, magY, magZ);
1127 obs->insTime =
lastGnssTime.gnssTime + std::chrono::microseconds(
static_cast<int64_t
>(timeSinceStartupNew) -
static_cast<int64_t
>(
lastGnssTime.timeSinceStartup));
1129 LOG_DATA(
"{}: Sending out ImuObs {}: {}",
nameId(), multi_id, obs->insTime.toYMDHMS());
1134 else if (multi_id == 1)
1147 LOG_DATA(
"{}: Construct PosVelAtt and invoke callback",
nameId());
1149 auto obs = std::make_shared<NAV::PosVelAtt>();
1151 const auto& vehicleGpsPosition = std::get<VehicleGpsPosition>(gpsIter->second.data);
1152 const auto& vehicleAttitude = std::get<VehicleAttitude>(attIter->second.data);
1154 obs->insTime =
InsTime(0, 0, 0, 0, 0, vehicleGpsPosition.time_utc_usec * 1e-6L);
1155 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)) },
1156 Eigen::Vector3d{ vehicleGpsPosition.vel_n_m_s, vehicleGpsPosition.vel_e_m_s, vehicleGpsPosition.vel_d_m_s },
1157 Eigen::Quaterniond{ vehicleAttitude.q.at(0), vehicleAttitude.q.at(1), vehicleAttitude.q.at(2), vehicleAttitude.q.at(3) });
1166 LOG_DATA(
"{}: Sending out PosVelAtt: {}",
nameId(), obs->insTime.toYMDHMS());
1171 else if (ulogMsgHeader.msgHeader.msg_type ==
'L')
1174 messageLog.
header = ulogMsgHeader.msgHeader;
1183 LOG_DATA(
"{}: Log-level: ALERT - Action must be taken immediately",
nameId());
1195 LOG_DATA(
"{}: Log-level: WARNING - Warning conditions",
nameId());
1199 LOG_DATA(
"{}: Log-level: NOTICE - Normal but significant condition",
nameId());
1207 LOG_DATA(
"{}: Log-level: DEBUG - Debug-level messages",
nameId());
1221 else if (ulogMsgHeader.msgHeader.msg_type ==
'C')
1224 messageLogTagged.
header = ulogMsgHeader.msgHeader;
1231 else if (messageLogTagged.
log_level == 49)
1233 LOG_DATA(
"{}: Log-level: ALERT - Action must be taken immediately",
nameId());
1235 else if (messageLogTagged.
log_level == 50)
1239 else if (messageLogTagged.
log_level == 51)
1243 else if (messageLogTagged.
log_level == 52)
1245 LOG_DATA(
"{}: Log-level: WARNING - Warning conditions",
nameId());
1247 else if (messageLogTagged.
log_level == 53)
1249 LOG_DATA(
"{}: Log-level: NOTICE - Normal but significant condition",
nameId());
1251 else if (messageLogTagged.
log_level == 54)
1255 else if (messageLogTagged.
log_level == 55)
1257 LOG_DATA(
"{}: Log-level: DEBUG - Debug-level messages",
nameId());
1264 read(
reinterpret_cast<char*
>(&messageLogTagged.
tag),
sizeof(messageLogTagged.
tag));
1273 else if (ulogMsgHeader.msgHeader.msg_type ==
'S')
1276 messageSync.
header = ulogMsgHeader.msgHeader;
1277 read(
reinterpret_cast<char*
>(messageSync.
syncMsg.data()),
sizeof(messageSync.
syncMsg));
1280 else if (ulogMsgHeader.msgHeader.msg_type ==
'O')
1283 messageDropout.
header = ulogMsgHeader.msgHeader;
1287 else if (ulogMsgHeader.msgHeader.msg_type ==
'I')
1291 else if (ulogMsgHeader.msgHeader.msg_type ==
'M')
1295 else if (ulogMsgHeader.msgHeader.msg_type ==
'P')
1299 else if (ulogMsgHeader.msgHeader.msg_type ==
'Q')
1305 std::string nextChars;
1306 [[maybe_unused]]
auto unidentifiedPos =
static_cast<uint64_t
>(
tellg());
1307 nextChars.resize(100);
1308 read(nextChars.data(), 100);
1309 LOG_WARN(
"{}: Message type not identified. Position: {}, The next 100 chars: {}",
nameId(), unidentifiedPos, nextChars);
1312 seekg(-100, std::ios_base::cur);