简体   繁体   English

QSerialPort和虚拟端口仿真器

[英]QSerialPort and Virtual Port Emulator

I've got problem with my program based on QSerialPort class. 我的基于QSerialPort类的程序遇到问题。 I've created reciever application for my bluetooth module HC-06 (which connects to pc as serial port) and my app has recieved data from this module without any troubles. 我已经为蓝牙模块HC-06创建了接收器应用程序(该模块通过串行端口连接到PC),并且我的应用程序已从该模块接收到数据,没有任何麻烦。 Now I've just wrote another app which should simulate transmitter. 现在,我刚刚编写了另一个应模拟发射机的应用程序。 Then I tried to use program Free Virtual Serial Port to create a bridge between two virtual serial ports. 然后,我尝试使用程序“免费虚拟串行端口”在两个虚拟串行端口之间创建网桥。 And after that some problems occure. 之后,出现了一些问题。 The reciever app does not emit readyRead() signal even thought I write data to bridged serial port via tranmiter app. 即使认为我通过发送器应用程序将数据写入桥接串行端口,接收器应用程序也不会发出readyRead()信号。 When I disconnet reciever and connect to the same port via Hercules terminal all buffered data are shown. 当我断开接收器并通过Hercules终端连接到同一端口时,将显示所有缓冲的数据。

What am i doing wrong? 我究竟做错了什么? Is there any option to make it work? 有没有使其工作的选择? I am using qt creator 2.8.1 based on qt 5.1.1 on windows 7 64bit. 我正在Windows 7 64bit上使用基于qt 5.1.1的qt Creator 2.8.1。

@user3148625, @ user3148625,

if you talk about this software: http://www.hhdsoftware.com/free-virtual-serial-ports 如果您谈论此软件: http : //www.hhdsoftware.com/free-virtual-serial-ports

then I do not recommend to use it, because this software works with errors (IMHO, bad software). 那么我不建议您使用它,因为该软件会出现错误(恕我直言,错误的软件)。

For example, in attempt to create "bridge" and further to open port by any of terminal program, will be a fail. 例如,尝试通过任何终端程序创建“桥”并进一步打开端口,将是失败的。

Eg I used Windows 8x32 and set of this terminal programs: 例如,我使用Windows 8x32和以下终端程序集:

  1. Termite: http://www.compuphase.com/software_termite.htm 白蚁: http : //www.compuphase.com/software_termite.htm

this program is crashed in attempt to open port 该程序在尝试打开端口时崩溃

  1. Tera Term Pro: http://en.sourceforge.jp/projects/ttssh2/releases/ Tera Term Pro: http//en.sourceforge.jp/projects/ttssh2/releases/

after attempt to open port, this program starts to receive an streaming of trash and also is crashed. 尝试打开端口后,该程序开始接收垃圾流,并且也崩溃了。

I am sure, that other programs will behave also. 我敢肯定,其他程序也将起作用。 Ie a problem not in QtSerialPort but in a bad drivers of "Free Virtual Serial Port" software. 也就是说,问题不在QtSerialPort中,而在“免费虚拟串行端口”软件的错误驱动程序中。 It is an old known problem. 这是一个古老的已知问题。

Thus I advise to use com0com the emulator: http://sourceforge.net/projects/com0com/ 因此,我建议使用com0com仿真器: http : //sourceforge.net/projects/com0com/

Or any other software (eg trial version of Eltima Software virtual ports). 或任何其他软件(例如Eltima Software虚拟端口的试用版)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM