<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Link between 2 serial ports]]></title><description><![CDATA[<p dir="auto">Hello,<br />
I want to do a link between 2 serial ports (all coming in COM3 have to be resent to COM4 and the same in the other way).</p>
<p dir="auto">I use the terminal version and in "main.cpp" I create another MainWindow variable w1. In "MainWindow.cpp" I was able in method MainWindow::ReadData() to modify so I can test what is the COM (the code is included below).</p>
<p dir="auto">My problem is that when I do "serial-&gt;write(data);" it sends the data on the same COM that the bytes received. I want to send data received in the other one: if I get data on COM3 I want to send them on COM4 and vice-versa.</p>
<p dir="auto">Have someone an idea ?</p>
<p dir="auto">Thanks</p>
<hr />
<p dir="auto">void MainWindow::readData()<br />
{<br />
QByteArray data = serial-&gt;readAll();<br />
console-&gt;putData(data);<br />
if (serial-&gt;portName()=="COM3")<br />
serial-&gt;write(data);<br />
}</p>
]]></description><link>https://forum.qt.io/topic/48002/link-between-2-serial-ports</link><generator>RSS for Node</generator><lastBuildDate>Wed, 05 Aug 2026 05:06:52 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/48002.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Nov 2014 14:56:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Link between 2 serial ports on Mon, 10 Nov 2014 22:41:17 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">To make it simple, just use one MainWindow with two serial ports (use meaningful names for the variables) and one slot for each serial port (you can optimize that later)</p>
]]></description><link>https://forum.qt.io/post/250925</link><guid isPermaLink="true">https://forum.qt.io/post/250925</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 10 Nov 2014 22:41:17 GMT</pubDate></item></channel></rss>