• 大小: 18.27MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-25
  • 语言: 其他
  • 标签: QT  Serial  单片机  

资源简介

利用QT5.9 serialport串口通信模块编写串口调试助手,exe文件可直接运行,附源码。详见 https://blog.csdn.net/qq_43569273/article/details/89015593

资源截图

代码片段和文件信息

#include “serialport.h“
#include 

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

    return a.exec();
}

//https://blog.csdn.net/tt1995cc/article/details/66969245
//https://blog.csdn.net/imkelt/article/details/53000523
/*
char ConvertHexChar(char ch)
{
    if ((ch >= ‘0‘) && (ch <= ‘9‘))
        return ch - 0x30;
    else if ((ch >= ‘A‘) && (ch <= ‘F‘))
        return ch - ‘A‘ + 10;
    else if ((ch >= ‘a‘) && (ch <= ‘f‘))
        return ch - ‘a‘ + 10;
    else return ch -  ch;
}
void StringToHex(QString str QByteArray &senddata) //字符串转换为十六进制数据0-F
{
    int hexdatalowhexdata;
    int hexdatalen = 0;
    int len = str.length();
    senddata.resize(len / 2);
    char lstrhstr;
    for (int i = 0; i < len; ) {
        hstr = str[i].toLatin1();
        if (hstr == ‘ ‘) {
            ++i;
            continue;
        }
        ++i;
        if (i  >= len) break;
        lstr = str[i].toLatin1();
        hexdata = ConvertHexChar(hstr);
        lowhexdata = ConvertHexChar(lstr);
        if ((hexdata == 16) || (lowhexdata == 16))
            break;
        else
            hexdata = hexdata*16 + lowhexdata;
        ++i;
        senddata[hexdatalen] = (char)hexdata;
        ++hexdatalen;
    }
    senddata.resize(hexdatalen);
}
if (sendstr.length() % 2){
    sendstr.insert(sendstr.length()-1 ‘0‘);
}
StringToHex(sendstr bytes);
qDebug()<<(bytes==QByteArray::fromHex(sendstr.toLatin1().data()));//true
*/

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-04-04 10:39  SerialPort\
     文件        1572  2019-04-04 09:29  SerialPort\main.cpp
     文件       10814  2019-04-04 10:02  SerialPort\main.ico
     目录           0  2019-04-04 10:04  SerialPort\MinGW32\
     目录           0  2019-04-03 22:03  SerialPort\MinGW32\iconengines\
     文件       43008  2017-11-16 17:37  SerialPort\MinGW32\iconengines\qsvgicon.dll
     目录           0  2019-04-03 22:03  SerialPort\MinGW32\imageformats\
     文件       33792  2017-11-16 17:08  SerialPort\MinGW32\imageformats\qgif.dll
     文件       46592  2017-11-16 17:37  SerialPort\MinGW32\imageformats\qicns.dll
     文件       36352  2017-11-16 17:07  SerialPort\MinGW32\imageformats\qico.dll
     文件      247808  2017-11-16 17:07  SerialPort\MinGW32\imageformats\qjpeg.dll
     文件       27648  2017-11-16 17:37  SerialPort\MinGW32\imageformats\qsvg.dll
     文件       26624  2017-11-16 17:36  SerialPort\MinGW32\imageformats\qtga.dll
     文件      507904  2017-11-16 17:36  SerialPort\MinGW32\imageformats\qtiff.dll
     文件       25600  2017-11-16 17:36  SerialPort\MinGW32\imageformats\qwbmp.dll
     文件      449536  2017-11-16 17:37  SerialPort\MinGW32\imageformats\qwebp.dll
     文件       22016  2017-11-16 16:53  SerialPort\MinGW32\libEGL.dll
     文件      120334  2015-12-29 06:25  SerialPort\MinGW32\libgcc_s_dw2-1.dll
     文件     2807296  2017-11-16 16:52  SerialPort\MinGW32\libGLESV2.dll
     文件     1540622  2015-12-29 06:25  SerialPort\MinGW32\libstdc++-6.dll
     文件       79360  2015-12-29 06:25  SerialPort\MinGW32\libwinpthread-1.dll
     目录           0  2019-04-03 22:03  SerialPort\MinGW32\platforms\
     文件     1761280  2017-11-16 17:09  SerialPort\MinGW32\platforms\qwindows.dll
     文件     6097408  2019-04-03 22:03  SerialPort\MinGW32\Qt5Core.dll
     文件     6205952  2017-11-16 16:58  SerialPort\MinGW32\Qt5Gui.dll
     文件       77312  2017-11-16 17:37  SerialPort\MinGW32\Qt5SerialPort.dll
     文件      358400  2017-11-16 17:37  SerialPort\MinGW32\Qt5Svg.dll
     文件     6355968  2017-11-16 17:04  SerialPort\MinGW32\Qt5Widgets.dll
     文件      111616  2019-04-04 10:02  SerialPort\MinGW32\SerialPort.exe
     目录           0  2019-04-04 10:06  SerialPort\MSVC2015_64\
     目录           0  2019-04-04 09:51  SerialPort\MSVC2015_64\platforms\
............此处省略11个文件信息

评论

共有 条评论