浏览代码

add the reported timestamp

Sven Czarnian 3 年之前
父节点
当前提交
a934767ffb
共有 1 个文件被更改,包括 6 次插入0 次删除
  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());