串口调试助手-QT

2023-05-16

串口调试助手----------该程序使用Qt框架,C ++语言编译而成

项目文件介绍:

main.cpp 该文件为该程序的入口程序

mainwindow.h 该文件为该程序的主要声明部分

mainwindow.cpp 该文件为该程序的主要定义部分

mainwindow.ui 该文件为该程序的ui界面设计

该文件中获取串口是通过读取Windows系统下的注册表中的信息得到的, - 使用Qt中的定时器来每个3s读取一次注册表

串口通信方面:通过使用Qt的封装的QSerialPort来实现

main.cpp

#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec();
}

mainwindow.h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSerialPort>
#include <QTimer>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    /*
     * 功能:获取电脑中串口的端口
     * 参数:无
     * 返回值:无
     */
    void Get_Serial_Port(void);
    /*
     * 功能:当串口有数据的时候执行
     * 参数:无
     * 返回值:无
     */
    void readData(void);
    /*
     * 功能:每个3s执行的任务
     * 参数:无
     * 返回值:无
     */
    void myThread(void);

private slots:
    /*
     * 功能:点击pushButton按钮功能
     * 参数:无
     * 返回值:无
     */
    void on_pushButton_clicked();
    /*
     * 功能:点击清空按钮功能,清空显示区的显示
     * 参数:无
     * 返回值:无
     */
    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_5_clicked();

private:
    Ui::MainWindow  *ui;
    //串口类指针
    QSerialPort     *Serial;
    //时间类指针
    QTimer          *time;
};

#endif // MAINWINDOW_H

mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "windows.h"
#include "QVector"
#include "QDebug"
#include "stdio.h"
#include "QMessageBox"
#include <stdlib.h>

#define MAX_KEY_LENGTH 255
#define MAX_VALUE_NAME 16383

/*
 * 功能:读取注册表下的子项
 * 参数:hkey:注册表的根
 *      lpSubkey:注册表根下的路径
 *      retArray:返回要查找的路径下的值的数组
 * 返回值:无
 */
static void Get_Regedit(HKEY hkey,LPCSTR lpSubKey,QVector<QString> &retArray);

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //时间类初始化
    time = new QTimer(this);
    connect(time,&QTimer::timeout,this,&MainWindow::myThread);
    time->start(3000);
    //状态栏显示
    ui->statusBar->showMessage("程序运行中...");
    //初始化串口的显示
    this->Get_Serial_Port();
    QStringList temp;
    //波特率的显示
    temp << "9600" << "4800" << "19200" << "38400" << "57600" << "115200";
    ui->comboBox_2->addItems(temp);
    //数据位的显示
    temp.clear();
    temp << "8" << "5" << "6" << "7";
    ui->comboBox_3->addItems(temp);
    //奇偶检验位的显示
    temp.clear();
    temp << "0" << "1" << "2";
    ui->comboBox_4->addItems(temp);
    //停止位的显示
    temp.clear();
    temp << "1" << "1.5" << "2";
    ui->comboBox_5->addItems(temp);

    this->Serial = new QSerialPort(nullptr);
}

MainWindow::~MainWindow()
{
    delete ui;
}
/*
 * 功能:获取电脑中串口的端口
 * 参数:无
 * 返回值:无
 */
void MainWindow::Get_Serial_Port()
{
    QVector<QString> retArray;
    ui->comboBox->clear();
    Get_Regedit(HKEY_LOCAL_MACHINE,\
                "HARDWARE\\DEVICEMAP\\SERIALCOMM",\
                retArray);

    qDebug() << retArray.size();

    QVector<QString>::iterator iter;
    for (iter=retArray.begin();iter!=retArray.end();iter++)
    {
        qDebug() <<  *iter << "\0";
        ui->comboBox->addItem(*iter);
    }
}
/*
 * 功能:点击pushButton按钮功能,打开串口
 * 参数:无
 * 返回值:无
 */
void MainWindow::on_pushButton_clicked()
{
    if(!Serial->isOpen())
    {
        qDebug() << ui->comboBox->currentText();
        //设置串口的端口名称
        Serial->setPortName(ui->comboBox->currentText());
        //toInt:将字符串转换为数字
        //设置串口的波特率
        Serial->setBaudRate((ui->comboBox_2->currentText()).toInt(nullptr,10));
        //设置串口的数据位
        Serial->setDataBits((QSerialPort::DataBits((ui->comboBox_3->currentText()).toInt(nullptr,10))));
        //设置串口的奇偶校验位
        Serial->setParity(QSerialPort::Parity((ui->comboBox_4->currentText()).toInt(nullptr,10)));
        //设置串口的停止位
        Serial->setStopBits(QSerialPort::StopBits((ui->comboBox_5->currentText()).toInt(nullptr,10)));
        //设置串口的流
        Serial->setFlowControl(QSerialPort::NoFlowControl);
        BOOL isSerial = Serial->open(QIODevice::ReadWrite);
        if(!isSerial)
        {
            qDebug() << "串口打开错误!";
            return;
        }
        //创建一个信号与槽,使得串口有数据可以读取的时候可以执行readData()函数
        connect(Serial,&QSerialPort::readyRead,this,&MainWindow::readData);
        ui->pushButton->setText("已启动");
    }
    else
    {
        ui->pushButton->setText("启动");
        Serial->close();
    }

}

/*
 * 功能:读取注册表下的子项
 * 参数:hkey:注册表的根
 *      lpSubkey:注册表根下的路径
 *      retArray:返回要查找的路径下的值的数组
 * 返回值:无
 */
static void Get_Regedit(HKEY hkey,LPCSTR lpSubKey,QVector<QString> &retArray)
{
    HKEY  phkey = nullptr;
    BOOL isSuccess = false;
    /*
     * 功能:打开注册表,返回值为是否打开成功
     */
    isSuccess = RegOpenKeyA(hkey,lpSubKey,&phkey);
    if(isSuccess != ERROR_SUCCESS)
    {
        qDebug() << "注册表打开失败!";
        return;
    }
    qDebug() << "注册表打开成功!";
    /*
     * 功能:读取注册表下的子项
     */
    DWORD i =0;
    LSTATUS retCode = ERROR_SUCCESS;

    CHAR achValue[MAX_VALUE_NAME];
    DWORD cchValue = MAX_VALUE_NAME;
    BYTE Data[MAX_VALUE_NAME];
    DWORD cbData = MAX_VALUE_NAME;
    do
    {
        cchValue = MAX_VALUE_NAME;
        cbData = MAX_VALUE_NAME;
        achValue[0] = '\0';
        Data[0] = '\0';
        QString temp = "";
        retCode = RegEnumValueA(phkey, i,achValue,&cchValue,nullptr,nullptr,Data,&cbData);

        if (retCode == ERROR_SUCCESS && achValue[0] != '\0')
        {
            qDebug() << i++ << achValue << " ";
            BYTE j = 0;
            while(Data[j] != '\0')
                temp += (CHAR)(Data[j++]);
            qDebug() << temp;
            retArray.append(temp);
        }
    }while(achValue[0] != '\0');
    /*
     * 功能:关闭注册表,返回值为是否打开成功
     */
    isSuccess = RegCloseKey(phkey);
    if(isSuccess != ERROR_SUCCESS)
    {
        qDebug() << "注册表关闭失败!";
        return;
    }
    qDebug() << "注册表关闭成功!";
    return;
}

/*
 * 功能:点击清空按钮功能,清空显示区的显示
 * 参数:无
 * 返回值:无
 */
void MainWindow::on_pushButton_2_clicked()
{
    ui->textBrowser->setText("");
}

/*
 * 功能:当串口有数据的时候执行,在显示区域显示
 *      串口接受到的值
 * 参数:无
 * 返回值:无
 */
void MainWindow::readData(void)
{
    //是否选择了该按钮,选择以16进制进行输出
    if(ui->radioButton->isChecked())
    {
        QByteArray temp = Serial->readAll().toHex();
        for(int i = 0;i < temp.length();++i)
        {
            //在16进制开始加入"0x"
            if(i % 2 == 0)
                ui->textBrowser->insertPlainText("0x");
            ui->textBrowser->insertPlainText((QString)temp.at(i));
            //在16进制结束加上空格" "
            if(i % 2 == 1)
                ui->textBrowser->insertPlainText(" ");
        }
    }
    //没有选择则按照ASCII码输出
    else
        ui->textBrowser->insertPlainText(Serial->readAll());
    ui->textBrowser->moveCursor(QTextCursor::End);
}
/*
 * 功能:向串口中发送数据
 * 参数:无
 * 返回值:无
 */
void MainWindow::on_pushButton_3_clicked()
{
    //判断串口是否处于打开状态
    if(Serial->isOpen())
    {
        QByteArray temp = ui->textEdit->toPlainText().toUtf8();
        qDebug() << temp;
        Serial->write(temp);
    }
    else
    {
        //串口没有连接的时候发送数据就会出错
        QMessageBox messageBox(QMessageBox::Icon(2),"警告","串口未连接",QMessageBox::Yes,nullptr);
        messageBox.exec();
    }
}
/*
 * 功能:清空发送区
 * 参数:无
 * 返回值:无
 */
void MainWindow::on_pushButton_4_clicked()
{
    ui->textEdit->clear();
}
/*
 * 功能:退出程序
 * 参数:无
 * 返回值:无
 */
void MainWindow::on_pushButton_5_clicked()
{
    if(Serial->isOpen())
        Serial->close();
    this->close();
}
/*
 * 功能:每个3s执行的任务,判断端口和串口是否打开
 * 参数:无
 * 返回值:无
 */
void MainWindow::myThread()
{
    qDebug() << "线程OK ";
    if(Serial->isReadable())
        ui->pushButton->setText("已启动");
    else
        ui->pushButton->setText("启动");
    this->Get_Serial_Port();
}

mainwindow.ui

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>MainWindow</class>
 <widget class="QMainWindow" name="MainWindow">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>768</width>
    <height>500</height>
   </rect>
  </property>
  <property name="minimumSize">
   <size>
    <width>768</width>
    <height>500</height>
   </size>
  </property>
  <property name="maximumSize">
   <size>
    <width>768</width>
    <height>500</height>
   </size>
  </property>
  <property name="windowTitle">
   <string>串口助手</string>
  </property>
  <widget class="QWidget" name="centralWidget">
   <widget class="QPushButton" name="pushButton">
    <property name="geometry">
     <rect>
      <x>20</x>
      <y>230</y>
      <width>93</width>
      <height>28</height>
     </rect>
    </property>
    <property name="text">
     <string>启动</string>
    </property>
   </widget>
   <widget class="QPushButton" name="pushButton_2">
    <property name="geometry">
     <rect>
      <x>120</x>
      <y>290</y>
      <width>93</width>
      <height>28</height>
     </rect>
    </property>
    <property name="text">
     <string>清空显示</string>
    </property>
   </widget>
   <widget class="QComboBox" name="comboBox">
    <property name="geometry">
     <rect>
      <x>120</x>
      <y>50</y>
      <width>87</width>
      <height>22</height>
     </rect>
    </property>
   </widget>
   <widget class="QComboBox" name="comboBox_2">
    <property name="geometry">
     <rect>
      <x>120</x>
      <y>80</y>
      <width>87</width>
      <height>22</height>
     </rect>
    </property>
   </widget>
   <widget class="QComboBox" name="comboBox_3">
    <property name="geometry">
     <rect>
      <x>120</x>
      <y>110</y>
      <width>87</width>
      <height>22</height>
     </rect>
    </property>
   </widget>
   <widget class="QComboBox" name="comboBox_4">
    <property name="geometry">
     <rect>
      <x>120</x>
      <y>140</y>
      <width>87</width>
      <height>22</height>
     </rect>
    </property>
   </widget>
   <widget class="QComboBox" name="comboBox_5">
    <property name="geometry">
     <rect>
      <x>120</x>
      <y>170</y>
      <width>87</width>
      <height>22</height>
     </rect>
    </property>
   </widget>
   <widget class="QRadioButton" name="radioButton">
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>295</y>
      <width>115</width>
      <height>19</height>
     </rect>
    </property>
    <property name="text">
     <string>以16进制输出</string>
    </property>
   </widget>
   <widget class="QPushButton" name="pushButton_3">
    <property name="geometry">
     <rect>
      <x>120</x>
      <y>360</y>
      <width>93</width>
      <height>28</height>
     </rect>
    </property>
    <property name="text">
     <string>发送</string>
    </property>
   </widget>
   <widget class="QGroupBox" name="groupBox">
    <property name="geometry">
     <rect>
      <x>230</x>
      <y>4</y>
      <width>551</width>
      <height>331</height>
     </rect>
    </property>
    <property name="title">
     <string>接受显示区</string>
    </property>
    <widget class="QTextBrowser" name="textBrowser">
     <property name="geometry">
      <rect>
       <x>10</x>
       <y>20</y>
       <width>521</width>
       <height>301</height>
      </rect>
     </property>
    </widget>
   </widget>
   <widget class="QGroupBox" name="groupBox_2">
    <property name="geometry">
     <rect>
      <x>230</x>
      <y>340</y>
      <width>541</width>
      <height>121</height>
     </rect>
    </property>
    <property name="title">
     <string>发送显示区</string>
    </property>
    <widget class="QTextEdit" name="textEdit">
     <property name="geometry">
      <rect>
       <x>10</x>
       <y>20</y>
       <width>521</width>
       <height>91</height>
      </rect>
     </property>
    </widget>
   </widget>
   <widget class="QPushButton" name="pushButton_4">
    <property name="geometry">
     <rect>
      <x>120</x>
      <y>400</y>
      <width>93</width>
      <height>28</height>
     </rect>
    </property>
    <property name="text">
     <string>清空发送</string>
    </property>
   </widget>
   <widget class="QLabel" name="label">
    <property name="geometry">
     <rect>
      <x>20</x>
      <y>50</y>
      <width>71</width>
      <height>21</height>
     </rect>
    </property>
    <property name="text">
     <string>串口端口</string>
    </property>
   </widget>
   <widget class="QLabel" name="label_2">
    <property name="geometry">
     <rect>
      <x>20</x>
      <y>83</y>
      <width>80</width>
      <height>15</height>
     </rect>
    </property>
    <property name="text">
     <string>串口波特率</string>
    </property>
   </widget>
   <widget class="QLabel" name="label_3">
    <property name="geometry">
     <rect>
      <x>20</x>
      <y>113</y>
      <width>80</width>
      <height>15</height>
     </rect>
    </property>
    <property name="text">
     <string>串口数据位</string>
    </property>
   </widget>
   <widget class="QLabel" name="label_4">
    <property name="geometry">
     <rect>
      <x>20</x>
      <y>143</y>
      <width>80</width>
      <height>15</height>
     </rect>
    </property>
    <property name="text">
     <string>串口校验位</string>
    </property>
   </widget>
   <widget class="QLabel" name="label_5">
    <property name="geometry">
     <rect>
      <x>20</x>
      <y>173</y>
      <width>80</width>
      <height>15</height>
     </rect>
    </property>
    <property name="text">
     <string>串口停止位</string>
    </property>
   </widget>
   <widget class="QLabel" name="label_6">
    <property name="geometry">
     <rect>
      <x>25</x>
      <y>5</y>
      <width>191</width>
      <height>41</height>
     </rect>
    </property>
    <property name="font">
     <font>
      <family>楷体</family>
      <pointsize>12</pointsize>
     </font>
    </property>
    <property name="text">
     <string>欢迎使用调试助手</string>
    </property>
   </widget>
   <widget class="QPushButton" name="pushButton_5">
    <property name="geometry">
     <rect>
      <x>120</x>
      <y>230</y>
      <width>93</width>
      <height>28</height>
     </rect>
    </property>
    <property name="text">
     <string>退出</string>
    </property>
   </widget>
  </widget>
  <widget class="QStatusBar" name="statusBar"/>
  <widget class="QMenuBar" name="menuBar">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>768</width>
     <height>26</height>
    </rect>
   </property>
   <widget class="QMenu" name="menu">
    <property name="title">
     <string>菜单</string>
    </property>
    <addaction name="separator"/>
    <addaction name="actiondsa"/>
   </widget>
   <widget class="QMenu" name="menu_2">
    <property name="title">
     <string>帮助</string>
    </property>
   </widget>
   <addaction name="menu"/>
   <addaction name="menu_2"/>
  </widget>
  <widget class="QToolBar" name="toolBar">
   <property name="windowTitle">
    <string>toolBar</string>
   </property>
   <attribute name="toolBarArea">
    <enum>TopToolBarArea</enum>
   </attribute>
   <attribute name="toolBarBreak">
    <bool>false</bool>
   </attribute>
  </widget>
  <action name="actiondsa">
   <property name="text">
    <string>退出</string>
   </property>
  </action>
 </widget>
 <layoutdefault spacing="6" margin="11"/>
 <resources/>
 <connections/>
</ui>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

串口调试助手-QT 的相关文章

  • Spyder cell分块运行 run cell

    Spyder是一个使用方便的Python开发环境 xff0c 安装Anaconda时自带 python代码分块 xff1a 使用Spyder xff0c 可以在python文件 xff08 py xff09 里使用 In 进行分块 如下图
  • C语言中实现bool(布尔型变量)

    C语言中 xff0c 本身没有bool xff08 布尔型变量 xff09 但是我们可以用其他方式来模拟 一 如果简单的使用char int long变量来表示0 1 xff0c 则太浪费空间了 二 这里介绍一种巧妙的方式实现bool xf
  • 随机解调-多频点信号与伪随机序列混频

    随机解调的多频点信号x与伪随机序列经过混频后 xff0c 被均匀的涂抹到了整个频率轴上 xff0c 然后经低通滤波 xff0c 低速均匀采样 xff0c 最后通过OMP等算法恢复原始信号 xff0c 整体上是压缩感知求解欠定方程y 61 A
  • 寻路算法 Astar A星算法

    lt span style 61 34 white space pre 34 gt lt span gt lt span style 61 34 white space pre 34 gt lt span gt 首先是创建一些变量 lt p
  • eclipse调试C代码时printf()不能输出到控制台的解决方法

    1 问题 在ecplise下使用CDT开发C C 43 43 程序中 xff0c 使用debug调试时 xff0c 到了printf 打印函数 xff0c 在console窗口中并没有打印出信息来 xff0c 停止后才会有输出 2 原因 在

随机推荐

  • C语言中带参宏定义

    include lt stdio h gt 1 带参宏定义中 xff0c 宏名和形参表之间不能有空格出现 2 宏定义中不存在值传递 xff0c 它只是一个符号的替换过程 3 带参宏定义中 xff0c 形参不分配内存空间 xff0c 因此不必
  • kaldi新手入门及语音识别的流程(标贝科技)

    kaldi新手入门及语音识别的流程 标贝科技 欢迎体验标贝语音开放平台 地址 xff1a https ai data baker com source 61 qaz123 xff08 注 xff1a 填写邀请码hi25d7 xff0c 每日
  • 结构体字节对齐详解【含实例】

    一 前言 结构体字节对齐属于老生常谈的问题 xff0c 看似简单 xff0c 却很容易忘记 而且因为结构体使用的普遍性 xff0c 使得字节对齐也成为了一个不得不谈的话题 二 什么是结构体字节对齐 假设现在有一个结构体如下 xff0c 问你
  • Mina基础(五):编写自定义协议及编解码器

    为什么要制定协议呢 xff1f 我们知道 xff0c 底层传输的都是二进制数据 xff0c 服务端和客户端建立连接后进行数据的交互 xff0c 接受这对方发送来的消息 xff0c 如何判定发送的请求或者响应的数据结束了呢 xff1f 总不能
  • c++之存储类

    C 43 43 存储类 存储类定义 C 43 43 程序中变量 函数的范围 xff08 可见性 xff09 和生命周期 这些说明符放置在它们所修饰的类型之前 下面列出 C 43 43 程序中可用的存储类 xff1a autoregister
  • STM32串口通信 中断配置

    一 关于如何配置通过中断的方式配置串口的收发 xff0c 一共就是这8个步骤 1 使能串口时钟 使能GPIO时钟 2 引脚复用映射 3 GPIO端口模式设置 4 串口参数初始化设置 5 开启中断初始化NVIC 6 使能串口 7 编写中断处理
  • altium designer导出bom表和贴片图

    altium designer的简单使用 xff0c 做一下记录 1 导出bom表 xff0c https jingyan baidu com article cb5d6105133e8f005c2fe0fe html 2 导出贴片图 xf
  • 基于RPLIDAR激光雷达开发无人机机载室内二维重建装置(2)——RPLIDAR测试

    从官网上 xff08 http www slamtec com xff09 下载开发用的SDK及数据手册等相关资料 xff0c 但Arduino相关资料貌似已失效 xff0c 之后尝试从其他渠道下载 先安装对应系统的驱动 xff0c 之后打
  • Visio2016与office2016安装解决方法终极版

    基本解决方案 删除注册表 office软件在我们日常生活中的应用十分广泛 xff0c 在购买电脑时大部分会给电脑装上office家庭版 xff0c 但是有些人由于工作需要可能使用office更多的功能 xff0c 因此可以选择安装专业版 而
  • 微带天线学习

    微带天线学习 侧馈矩形微带天线同轴馈电矩形微带天线双频微带天线 学习方法是根据HFSS软件学习微带天线的优化 参数计算 xff0c 以及根据HFSS仿真结果进一步理解微带天线中参数对天线性能的影响 微带天线贴片尺寸计算方法及matlab代码
  • Zotero IEEE trans期刊cls格式调整

    Zotero IEEE trans期刊cls格式调整 Zotero软件自带的IEEE期刊的引用格式不符合期刊投稿要求 xff0c 因此需要改变cls文件 xff0c 改变引用格式 cls格式编辑网站 xff1a https editor c
  • ADS2021安装

    1 ADS简介 先进设计系统 Advanced Design system xff08 ADS xff09 Agilent Technologies 是领先的电子设计自动化软件 xff0c 适用于射频 微波和信号完整性应用 2 ADS的安装
  • Mysql整体介绍(适用于5.X版本)(上)(标贝科技)

    标贝科技 https ai data baker com source 61 qwer12 填写邀请码fwwqgs xff0c 每日免费调用量还可以翻倍 Mysql整体介绍 xff08 适用于5 X版本 xff09 标贝科技 Mysql 8
  • TE、TM、TEM模式的区别

    在一众电磁仿真软件的使用中 xff0c 牵涉到平面波的设置或Floquet端口的设置 在设置平面波时 xff0c 论坛里有不少人提到TE波 TM波 xff1b 在设置Floquet端口时 xff0c 又有不少人提到TE极化 TM极化 其实
  • linux下TCP socket编程入门案例(二)——非阻塞的TCP server&client

    文章目录 1 相关概念介绍1 1 阻塞与非阻塞1 2 两者区别1 3 select模型 2 编码实现2 1 代码改进2 2 实现服务端客户端 3 运行结果 在 上一篇 阻塞的TCP server amp client 中 xff0c 介绍了
  • cartographer 主从机rviz订阅地图出错

    cartographer 主从机rviz订阅地图出错 配置及想法 机器人以及虚拟机都是ubuntu16 43 kinetic xff0c 本意想在虚拟机端查看机器人cartographer的建图情况 直接在虚拟机端运行命令 rviz d t
  • TCP的连接和建立(三次握手和四次挥手)

    1 TCP连接的建立 连接的建立 xff0c 通常称为三次握手 建立连接前服务器处在收听状态 第一步 xff1a 客户机的TCP向服务器的TCP发送连接请求报文段 同步位 61 1 这时客户进程进入同步已发送状态 第二步 xff1a 服务器
  • 网络编程(8)自定义网络通讯协议

    C C 43 43 网络通讯真正要用起来 xff0c 不但要写一个好的网络服务器 xff0c 还要定好一套通讯协议才能真正实用 通讯协议业界目前除了用开源的如XMPP以外 xff0c 基本上都是自定义一套通讯协议 xff0c 自已负责封包
  • libtorch导致OPENCV错误:对‘cv::imread(std::string const&, int)’未定义的引用

    1 问题描述 xff1a 报错 xff1a cmakelist txt 提示 xff1a 如果你报了相同的错误 xff0c 但是没有安装libtorch的话 xff0c 可能是cmakelist中没有target link librarie
  • 串口调试助手-QT

    串口调试助手 该程序使用Qt框架 xff0c C 43 43 语言编译而成 项目文件介绍 xff1a main cpp 该文件为该程序的入口程序 mainwindow h 该文件为该程序的主要声明部分 mainwindow cpp 该文件为