Commit d1e6008f authored by 957dd's avatar 957dd

将第三方库改变了utf-8格式能提交,和加入了远程重启

parent 3856a8a5
Deviceld.txt
build/CMakeFiles/
build/cmake_install.cmake
build/CMakeCache.txt
build/CTestTestfile.cmake
\ No newline at end of file
No preview for this file type
......@@ -6,6 +6,7 @@
#include <chrono>
#include <iomanip>
#include <string>
#include <cstdlib>
#include "device_tag_bind.hpp"
#include "serial_port.hpp"
#include "positioning_data.hpp"
......@@ -70,11 +71,17 @@ void onSerialMessageReceived(const std::vector<uint8_t>& message) {
x_local[i] = (static_cast<uint16_t>(message[13]) << 8) | message[14];
y_local[i] = (static_cast<uint16_t>(message[15]) << 8) | message[16];
static auto last_print = std::chrono::steady_clock::now();
if ((std::chrono::steady_clock::now() - last_print) > std::chrono::milliseconds(200)) {
std::cout << "串口数据更新 -> 标签ID: " << tag_id[i]
<< ", X: " << x_local[i]
<< ", Y: " << y_local[i] << std::endl;
last_print = std::chrono::steady_clock::now();
}
}
}
// std::this_thread::sleep_for(std::chrono::milliseconds(200));
}
std::string file_open_read(){
......@@ -140,6 +147,13 @@ std::shared_ptr<MqttTopicsHandler> mqtt_init_and_connect() {
sub_json["head"].is_object() &&
sub_json["head"].contains("message_type") &&
sub_json["head"]["message_type"].is_number_integer() &&
sub_json["head"]["message_type"].get<int>() == 2011){
system("sudo reboot");
}
if (sub_json.contains("head") &&
sub_json["head"].is_object() &&
sub_json["head"].contains("message_type") &&
sub_json["head"]["message_type"].is_number_integer() &&
sub_json["head"]["message_type"].get<int>() == 3){
std::string device_local_label_id=g_device_tag_t.find(sub_topic);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment