@elypheldia said in How I listen serial port with writing client code?:
Sorry if used the wrong term. I am new on qt. I wanted to indicate that I read the data I wrote to the tnt0 serial port from terminal with using cat /dev/tnt0. But How can I do this with client code instead of reading from terminal. I just wanna open the tnt1 serial port from code., and I wanna read from there.
You are confusing to me.
Do you want to use /dev/tnt0 or /dev/tnt1?
With the code example you have provided, you are writing hello on serial device /dev/tnt0. Is this working?
You have defined a slot MySerialPort::readData() , which is called when data are ready to be read from serial port.
I have proposed you some changes to display debug message when slot is called. Is this slot called?
I don't know:
what kind of device is connected to this serial port? if the serial port configuration is correct according to attached device? the attached device communication protocol: It is a binary or text protocol? Are carriage return or line feed required?