Hi,

2011/1/17 Rémi Denis-Courmont <[email protected]>:
> On Monday 17 January 2011 15:12:48 ext Luiz Augusto von Dentz, you wrote:
>> > I want to share some messages for Usbmoded.
>> >
>> > It is that Usbmoded will not be part be MeeGo 1.2. Its functions will
>> > reply the other components.
>>
>> Does anyone know how this is supposed to work in MeeGo 1.2? IMO
>> changing the cable detection to use udev is probably the best
>> solution,
>
> Cable detection is only one aspect of the problem. Something is still required
> to determine the USB profile, and and initializing the corresponding
> backend(s). The PC should not 'see' (enumerate) the USB gadget until after the
> backend(s) is/are ready to handle PC communication.

That sound a bit racy, it is also strange when compared to Bluetooth
since the application needs to register itself (both via socket or
tty) and handle the connections in the same fd, USB seems to do the
opposite it starts the applications when the cable is plugged and than
expect them to be able to handle endpoint communication immediately.

>> but iirc there where some problems to detect cable unplug
>> since there is no remove event while we keep the tty open and we
>> cannot depend on HUP because windows/ovi suite is known to generate
>> them even if the cable is still connected.
>
> Normally, HUP should be sent when the PC side application closes the device in
> PC OS specific manner. For instance, if the application crashes, the gadget
> side backend needs to be notified that it should restart - *not* that it 
> should
> exit. This is not specific to Windows; you can trigger it with a Linux PC too.

Well that sounds more like a workaround for application that crashes,
maybe this is common for USB but I don't think in general treating a
HUP as a hint to reconnect is a good idea.

> Anyway - it is clear that HUP is ambiguous and insufficient, as it does not
> discriminate physical cable disconnection from logical application
> disconnection.

Exactly, and by that each application need to know more then just the
connection itself but the real cable state (from the parent device?),
now put this in a context where an application/backend is being
initialized and unplug the cable. It sound pretty racy to me.

-- 
Luiz Augusto von Dentz
Computer Engineer
_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev

Reply via email to