[Voyage-linux] FTDI USB Serial Device converter disconnected
Rainer Stratmann
(spam-protected)
Wed Sep 7 00:24:19 HKT 2011
Am Tuesday 06 September 2011 15:41:06 schrieben Sie:
> The real problem is that the code must be aware of possible errors in the
> filesystem. Assuming that the file-descriptor will always be available is a
> naive approach
The file_descriptor IS available until you close the file.
Because of that the ttyUSB0 is changing to ttyUSB1 if disconnected and connect
again to the bus (for example because of losing power).
Of course you don't receive any further data once disconnected.
> that should be corrected (at least if you really want the
> program to run for months unattended).
>
> *Jordi Soucheiron*
> Software Engineer
> jsoucheiron at dexmatech.com
>
> *DEXMA*
> Parc Tecnològic Barcelona Nord
> c/ Marie Curie, 8-14 (Oficina 227)
> ES-08042, Barcelona
> t: (+34) 93 181 01 96
> www.dexmatech.com
>
> Follow us on Twitter <http://www.twitter.com/dexma> and
> Linkedin<http://www.linkedin.com/company/247838>
>
>
>
>
> 2011/9/6 Rainer Stratmann <RainerStratmann at t-online.de>
>
> > Am Tuesday 06 September 2011 08:54:16 schrieb Sascha Blümle:
> > > Hi Jordi,
> > >
> > > is there any attempt going on to fix the basic problem and not only to
> >
> > cure
> >
> > > the pain? If the device will get disconnected (because of which reason
> > > even)
> >
> > That will not cause a crash.
> > You can close the file with the file-handle.
> > And then open another file and get a new file-handle.
> >
> > > there will be an open file-handle left and the application will run
> > > into eternity.
> > >
> > > Thank you for your efforts.
> > >
> > > BR, Sascha
> > >
> > > > You'll have to manage this kind of exceptions. Using udev to create a
> > > > link to the last ttyUSBX device created could be useful. I use rules
> >
> > like
> >
> > > > this freqüently:
> > > > KERNEL=="ttyUSB[0-9]*" , SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403" ,
> > > > ATTRS{idProduct}=="6001" , ATTRS{product}=="USB-RS485 Cable" ,
> > > > SYMLINK+="ftdi485"
> > > >
> > > > *Jordi *
> >
> > _______________________________________________
> > Voyage-linux mailing list
> > Voyage-linux at list.voyage.hk
> > http://list.voyage.hk/mailman/listinfo/voyage-linux
More information about the Voyage-linux
mailing list