forum subscription

Wanna help programmers by answering latest C++ questions?

We will email you whenever a new question is posted in C++ section. Max 2 emails per week.

QextSerialPort: Use the value read on serial port

Hello everyone,

I am a beginner in C++ with Qt Creator and I have started using the QextSerialPort library to read sensor data sent on the COM port. I can get the values on the console using the PortListener class and I would like to be able to use them to do operations on them or display them on an interface. I just don't know how to make the class return a variable in my hand that matches the values displayed in debug.

I guess I have to create a function that takes a variable and the name of the port as arguments and returns the variable that contains the data? But well I don't know how to do it, I hope my question is not too vague, all the tracks or advice are welcome. Do not hesitate if you need more information.

PortListener class look like:

Image

And the main like:

Image

Quentin Plisson 3 months ago
  • Whitelisted Links