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() {