Hi, Just a quick question.
I am trying to use the serial port to access a device, and the device is
designed to draw power from the RTS and DTR lines.
In my program I assert them with the syntax:
/* Assert RTS for +ve supply, clear DTR for Negative */
tcflush(pico_portFD, TCIFLUSH);
par = TIOCM_RTS; ioctl (fd, TIOCMBIS, &par);
par = TIOCM_DTR; ioctl (fd, TIOCMBIC, &par);
tcsetattr(pico_portFD, TCSANOW, &new_pico_termios);
opened = TRUE;
If I compile and run this, the bits will only get set properly after I use the pre-written driver software in windows, and then reboot.
Could someone tell me whether this is the correct way to implement these features.
I presume the ioctl takes effect immediately, or does it only take effect when tcsetattr() is called?
Thanks,
Phil
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!