Re: write() only sends 16 chars to serial port?
- From: Grant Edwards <grante@xxxxxxxx>
- Date: Wed, 19 Sep 2007 21:06:18 -0000
On 2007-09-19, gus.reid@xxxxxxxxx <gus.reid@xxxxxxxxx> wrote:
you probably want to call tcdrain()
tcdrain() waits until all output written to the object
referred to by fd has been transmitted.
Not sure I need it, but I'll probably add the tcdrain for
safety. I'm closing the port pretty soon after each access
since there can be multiple processes controlling my hardware.
NB: When you close the port (assuming no other processes have
it open), DTR and RTS will drop (go inactive). There's also
nothing to prevent multiple processes from opening the device
simultaneously. That's generally handled at the application
level using lock files.
This doesn't seem to flush the buffer when I do it, but I
don't know if that's guaranteed behaviour or not.
I'm not sure if that situation is well-defined or not. I
_think_ close() does a drain() before the port is actually
shut down.
--
Grant Edwards grante Yow! I wonder if I could
at ever get started in the
visi.com credit world?
.
- References:
- Re: write() only sends 16 chars to serial port?
- From: Grant Edwards
- Re: write() only sends 16 chars to serial port?
- From: gus . reid
- Re: write() only sends 16 chars to serial port?
- Prev by Date: Re: write() only sends 16 chars to serial port?
- Next by Date: Re: Viewing multiple .png files simultaneously
- Previous by thread: Re: write() only sends 16 chars to serial port?
- Next by thread: Re: write() only sends 16 chars to serial port?
- Index(es):