vdi-cloud/terminal/kiosk-shell/src/config.h
宋一鸣 162dcc1e02 初始化:导入 VDI 云终端代码与会话基础能力
变更详情:init: VDI 云终端代码(kiosk-shell 登录/桌面列表/Moonlight/RDP/看门狗)
2026-10-28 20:52:20 +08:00

54 lines
1.5 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 终端本地配置
//
// 对应《VDI 云桌面软件开发方案》4.2 节 config_template 的终端侧镜像:
// 终端保存一份本地的配置版本,API 下发后覆盖。
// 当前阶段先做本地文件版本,后续由 vdt-agent 接管与 API 同步。
#ifndef KIOSK_SHELL_CONFIG_H
#define KIOSK_SHELL_CONFIG_H
#include <string>
namespace vdi {
struct TerminalConfig {
// 设备身份
std::string sn; // 序列号
std::string deviceKey; // 预置密钥(注册用)
// 首配
std::string server; // 服务器地址
std::string username; // 登录账号
std::string password; // 登录密码
std::string wifiSsid; // WiFi SSID
std::string wifiPassword;
// 显示档位:1920x1440 / 2560x1440 / 1920x1080 / 1280x720
std::string resolution = "1920x1440";
// 是否记住连接参数
bool remember = true;
int version = 0;
};
// 配置路径:~/.config/vdi-terminal/client.conf
std::string configDir();
std::string configPath();
// 读取配置;文件不存在时返回默认值
TerminalConfig loadConfig();
// 判断是否已经有 Agent/API 下发的可用桌面连接配置。
bool hasConnectionConfig(const TerminalConfig& cfg);
// 保存配置
bool saveConfig(const TerminalConfig& cfg);
// 读取设备序列号(优先取 /etc/machine-id,其次 /proc/device-tree/serial-number)
std::string readSerialNumber();
} // namespace vdi
#endif // KIOSK_SHELL_CONFIG_H