USB device - when has it finished adding (sub-)devices?

Christopher Lang christopher.lang at acurana.de
Sat Jan 10 10:29:06 PST 2009


Hi,

when adding for example one of these GSM USB modems to a system running hald, 
quite a number of devices are being added, usually some vendor specific USB 
interfaces, and also one ore more tty ports, maybe a mass storage device etc.

When playing with libhal and reading through the HAL docs, one question came 
up:

How do I know, that for example a GSM USB modem is done adding tty ports?

In my application I am trying to recognise one of these GSM modems and hand it 
to an upper layer of the application, once all tty ports of that particular 
device showed up.

What I am looking for is a criteria, that tells me: "ok, now all (tty) ports 
originating from USB device X have been added, the device is ready to be 
used".

I was thinking about a timeout solution, so I would wait about a second after 
a tty port was being added, and if during that time no other tty port 
originating from a certian parent came in, that is it, device is complete, I 
will send the parent and its ports to the application to be used.

But that solution still could fail, if for whatever reason a port takes longer 
to appear.

Any hint with regard to that "adding devices complete" criteria is highly 
appreciated.

many thanks
Chris

http://www.acurana.de/



More information about the hal mailing list