the problem with general serail gadget driver when re-connect usb cable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
     I have a mobile device, and using USB general serial driver to
put some log to PC.
In user space, there is an APP reading from pipe and writing log data
to serial continually.
    when I start the APP, then insert the usb cable,  I can see the
log data sent to PC continually.
but if I remove the cable, and reconnect it again, the APP is block in
the write function, and
cannot send data to PC anymore.
   following is  main logic of APP,

   open pipe,
   open usb serial(/dev/ttyGS0)

 for (;;) {
   read from pipe
   write to serial(with block mode)
   if write error (that means receive serial disconnect signal, and
write I/O error)
    close serial
    open serial again
}

so, could anyone give me some advice? your any feedback is appreciate.

yingchun
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux