1
This commit is contained in:
parent
d14778df59
commit
b8301d704f
@ -34,6 +34,18 @@ static std::mutex at_tasks_mutex;
|
|||||||
static std::unique_ptr<httplib::Server> http_server;
|
static std::unique_ptr<httplib::Server> http_server;
|
||||||
static std::thread http_thread;
|
static std::thread http_thread;
|
||||||
|
|
||||||
|
static bool is_imei_ready()
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(imei_mutex);
|
||||||
|
return !IMEI.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string get_imei()
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(imei_mutex);
|
||||||
|
return IMEI;
|
||||||
|
}
|
||||||
|
|
||||||
void start_http_server(int port)
|
void start_http_server(int port)
|
||||||
{
|
{
|
||||||
http_server = std::make_unique<httplib::Server>();
|
http_server = std::make_unique<httplib::Server>();
|
||||||
@ -95,18 +107,6 @@ void stop_http_server()
|
|||||||
// 只保留一个任务:AT+GSN
|
// 只保留一个任务:AT+GSN
|
||||||
static std::vector<AtTask> at_tasks = {{"AT+GSN", 3, 0, {}}};
|
static std::vector<AtTask> at_tasks = {{"AT+GSN", 3, 0, {}}};
|
||||||
|
|
||||||
static bool is_imei_ready()
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(imei_mutex);
|
|
||||||
return !IMEI.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string get_imei()
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(imei_mutex);
|
|
||||||
return IMEI;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================== 发送线程 ==================
|
// ================== 发送线程 ==================
|
||||||
static void serial_at_send_loop()
|
static void serial_at_send_loop()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user