35 lines
820 B
C++
35 lines
820 B
C++
#pragma once
|
||
|
||
#include "serial_port.h"
|
||
|
||
// 全局 IMEI(读取成功后写入)
|
||
extern std::string IMEI;
|
||
|
||
struct RadioInfo
|
||
{
|
||
std::string state; // CONNECT / NOCONN
|
||
std::string rat; // NR5G-SA / NR5G-NSA / LTE / WCDMA ...
|
||
|
||
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; // 调试原始串
|
||
};
|
||
|
||
extern RadioInfo g_radio_info;
|
||
|
||
// 初始化 AT 串口(启动线程)
|
||
void init_serial_at(const std::string& device, int baudrate);
|
||
|
||
// 停止 AT 串口(停止线程,join)
|
||
void stop_serial_at();
|
||
|
||
void start_http_server(int port);
|
||
void stop_http_server();
|
||
|
||
RadioInfo get_radio_info();
|