Qt Serial- Open function returns false
-
wrote on 4 May 2020, 14:30 last edited by
-
wrote on 4 May 2020, 16:44 last edited by
What a stupid I am. The name of port I am trying to use is COM6 but i gave name randomly STMcomm in code. The name should be same. Thank you for your support sir.
-
Hi and welcome to devnet,
You might want to print the error returned by the error property.
-
wrote on 4 May 2020, 14:44 last edited by
Thanks for answer but how should I call that specific error function?
-
Did you try to just send its value to
qDebug() <<
? -
wrote on 4 May 2020, 14:56 last edited by
-
wrote on 4 May 2020, 15:36 last edited by
-
Good, one more thing: there's no reason for your
serialPort
variable to be statically declared. You should fix that. -
wrote on 4 May 2020, 16:12 last edited by
I know I am asking too much but I don't know what is statically declared means. I looked a bit and as I understand that means initializing without new.
I moved *QSerialPort serialPort; part to header file if you meant that. But it didn't help. I can't understand why it should be so hard to just use simple serial port.
-
wrote on 4 May 2020, 16:44 last edited by
What a stupid I am. The name of port I am trying to use is COM6 but i gave name randomly STMcomm in code. The name should be same. Thank you for your support sir.
-
Your use of static falls in the last paragraphe of this article.
1/10