Browse Source

add the reported timestamp

Sven Czarnian 3 years ago
parent
commit
a934767ffb
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/com/AircraftReporter.cpp

+ 6 - 0
src/com/AircraftReporter.cpp

@@ -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());