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 17:02:38 +08:00
|
|
|
|
std::string state; // CONNECT / NOCONN
|
|
|
|
|
|
std::string rat; // NR5G-SA / NR5G-NSA / LTE / WCDMA ...
|
|
|
|
|
|
|
2026-01-22 15:48:31 +08:00
|
|
|
|
int pci = -1; // 物理小区 ID
|
|
|
|
|
|
int band = -1; // LTE/NR Band(如果你要解析可以填)
|
|
|
|
|
|
int arfcn = -1; // 频点号,NR/SA必有字段
|
|
|
|
|
|
int rsrp = 0; // dBm
|
|
|
|
|
|
int rsrq = 0; // dB
|
|
|
|
|
|
int sinr = 0; // dB
|
|
|
|
|
|
|
|
|
|
|
|
std::string raw; // 调试原始串
|
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();
|
2026-01-22 17:12:49 +08:00
|
|
|
|
|
|
|
|
|
|
RadioInfo get_radio_info();
|