From b8301d704fb586ff93b8abdc29aa26ce1246d551 Mon Sep 17 00:00:00 2001 From: cxh Date: Mon, 5 Jan 2026 10:26:07 +0800 Subject: [PATCH] 1 --- src/serial_AT.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/serial_AT.cpp b/src/serial_AT.cpp index b6e2c17..5eb8f12 100644 --- a/src/serial_AT.cpp +++ b/src/serial_AT.cpp @@ -34,6 +34,18 @@ static std::mutex at_tasks_mutex; static std::unique_ptr http_server; static std::thread http_thread; +static bool is_imei_ready() +{ + std::lock_guard lock(imei_mutex); + return !IMEI.empty(); +} + +static std::string get_imei() +{ + std::lock_guard lock(imei_mutex); + return IMEI; +} + void start_http_server(int port) { http_server = std::make_unique(); @@ -95,18 +107,6 @@ void stop_http_server() // 只保留一个任务:AT+GSN static std::vector at_tasks = {{"AT+GSN", 3, 0, {}}}; -static bool is_imei_ready() -{ - std::lock_guard lock(imei_mutex); - return !IMEI.empty(); -} - -static std::string get_imei() -{ - std::lock_guard lock(imei_mutex); - return IMEI; -} - // ================== 发送线程 ================== static void serial_at_send_loop() {