2026-01-04 17:18:24 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include "serial_port.h"
|
|
|
|
|
|
|
2026-01-04 17:42:16 +08:00
|
|
|
|
// 全局 IMEI(读取成功后写入)
|
|
|
|
|
|
extern std::string IMEI;
|
|
|
|
|
|
|
2026-01-22 15:37:26 +08:00
|
|
|
|
struct RadioInfo
|
|
|
|
|
|
{
|
2026-01-22 15:40:25 +08:00
|
|
|
|
int rsrp = -999; // dBm
|
|
|
|
|
|
int rsrq = -999; // dB
|
|
|
|
|
|
int sinr = -999; // dB
|
|
|
|
|
|
|
|
|
|
|
|
int pci = -1; // 物理小区 ID
|
|
|
|
|
|
int band = -1; // 频点 Band
|
|
|
|
|
|
|
|
|
|
|
|
std::string raw; // 原始 AT 返回内容
|
2026-01-22 15:37:26 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern RadioInfo g_radio_info;
|
|
|
|
|
|
|
2026-01-04 17:42:16 +08:00
|
|
|
|
// 初始化 AT 串口(启动线程)
|
2026-01-04 17:18:24 +08:00
|
|
|
|
void init_serial_at(const std::string& device, int baudrate);
|
2026-01-04 17:24:15 +08:00
|
|
|
|
|
2026-01-04 17:42:16 +08:00
|
|
|
|
// 停止 AT 串口(停止线程,join)
|
|
|
|
|
|
void stop_serial_at();
|
2026-01-05 10:24:18 +08:00
|
|
|
|
|
|
|
|
|
|
void start_http_server(int port);
|
|
|
|
|
|
void stop_http_server();
|