Which tty designator points to my PC's only serial port?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Which tty designator points to my PC's only serial port?
on Fedora 19. Coding in c++
my /dev directory there are many tty designators listed. How do I know which one will use the serial port on my PC.
For my code I chose tty50.
fd = open("/dev/tty50", O_RDWR | O_NOCTTY | O_NDELAY);
It opens successfully, at least the open returns a non-negative, non-zero number, usually a 9.
cfsetispeed(&attribs, B38400);
cfsetospeed(&attribs, B38400);
When configuring the input baud and output baud there are no errors thrown.
char bytestosend[] = "hello\n";
nbytes = TEMP_FAILURE_RETRY (write (fd, bytestosend, 6));
When I go to write I get errno 11 "Resource temporarily unavailable"
Is there something else I need to do?
Can the physical serial port be left "unattached" (nothing plugged into it) just to run through this code
I am porting a Visual Basic 6 test equipment application over to Linux.
I am using Qt 4.8 and QtCreator on Fedora 19.
Qt decided not to include serial port support in version 4.8. And the version of gcc included with the Fedora installation was the wrong version for QtCreator.
I could not get the QSerialPort add on to install and work so I'm going this route with primitive serial port controls using termios.
I tried upgrading Qt to version 5+ but it corrupted my system badly. I actually had to start over from scratch.
I formatted the HD, installed a later version of Fedora and a 5+ version of Qt.
Nothing worked right, QtCreator said it couldn't work with a 5+ version of Qt. (Creator was part of the Qt 5+ install package)
I wasted 2 weeks trying to make it all work together. Finally I just reformatted again, and reinstalled Fedora 19 and Qt 4.8. Now all
is working again. I also have another computer with Red Hat 5 on it and cannot get the QSerialPort add on to install or work with that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.