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

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

 



On Thu, Apr 14, 2011 at 01:48:46PM +0800, yingchun li wrote:
> Hi,
>      I have a mobile device, and using USB general serial driver to
> put some log to PC.

Ick, don't use that driver for any "real" work.  What type of device is
this really?  We should use the real driver for it.

> 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.

Are you using the tty interface properly?  What happens when your
application gets the hangup signal?  Does it disconnect and reconnect to
the new device that shows up when the device is plugged in?

thanks,

greg k-h
--
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