Tuxi_Test_Qt/README.md

64 lines
1.0 KiB
Markdown
Raw Permalink 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.

# Qt MQTT Demo
这是一个基于Qt6的MQTT客户端演示程序支持连接MQTT服务器并进行设备通信。
## 功能特性
- MQTT服务器连接/断开
- 设备任务下发
- 消息订阅和接收
- 实时状态显示
- 用户友好的图形界面
## 编译要求
- Qt 6.4+
- CMake 3.16+
- C++17编译器
- Qt6 MQTT模块
## 编译步骤
### 使用CMake编译
```bash
# 创建构建目录
mkdir -p build
cd build
# 配置项目
cmake ..
# 编译
cmake --build . -j$(nproc)
# 运行
./QtDemo
```
### 安装Qt6 MQTT依赖
在Ubuntu/Debian系统上
```bash
sudo apt update
sudo apt install qt6-base-dev qt6-tools-dev libqt6mqtt6-dev
```
## 使用说明
1. **连接MQTT服务器**
- 输入服务器地址和端口
- 可选:输入用户名和密码
- 点击"连接"按钮
2. **发送设备任务**
- 确保MQTT已连接
- 输入设备SN号
- 点击"发送任务"按钮
3. **查看消息**
- 所有MQTT消息和系统日志显示在消息区域
- 包含时间戳和详细信息
## 项目结构