add the reported timestamp

This commit is contained in:
Sven Czarnian
2021-10-10 21:32:05 +02:00
parent 70a41bfc0e
commit a934767ffb

View File

@@ -65,6 +65,12 @@ bool AircraftReporter::send(aman::AircraftReport& report) {
bool retval = false;
if (nullptr != this->m_socket) {
/* set the report time */
std::stringstream stream;
auto reportTime = std::chrono::utc_clock::now();
stream << std::format("{0:%y%m%d%H%M}", reportTime);
report.set_reporttime(stream.str());
/* serialize the report */
std::string serialized = report.SerializeAsString();
zmq::message_t message(serialized.size());