On Thu, May 6, 2010 at 3:49 AM, Marcus Priesch <mar...@priesch.priv.at> wrote:
> so using bus.n sounds feasible, but is this numbering consistent through
> (un)plugging various adapters ?!?!
>
> i would expect following to happen:
>
>  + plug in adapter 1 -> bus.0
>  + plug in adapter 2 -> bus.1
>  + remove adapter  1 -> bus.0 disappears
>  + plug in adapter 3 -> bus.2 (! - not bus.0 !)
>  + plug in adapter 1 -> bus.0 reappears
>
> sorry for the theoretical question, but currently i dont have that much
> adapters at hand to try it out ;)

Actually, owfs only takes a snapshot of the available usb bus masters
at startup. There is no notification of additional additional usb
devices once under way. (This doesn't apply to the kernel wire module,
but that has it's own problems as I listed earlier.)

Apparently the correct way to handle new adapters is to use udev
rules. There currently is a gap between the understanding of usb
devices as owfs gets them from libusb and what udev knows about
devices.

My suggestion is:
1. figure out what information udev can gather about new devices.
2. figure out a common way for udev and libusb/owfs to identify the
same usb device.
3. decide if you want to start a new instance of owserver for each
device addition, or a single instance of owserver to start new bus.n
entries when a new device is seen.

The advantage of new instances is that the 1:n pattern is easier.
The advantage of a single large instance is that locating and talking
to the owserver is easier (only a single port).

>
> another question would be if the numbering is consistent when restarting
> owfs - although, this would not be a requirement in my case ...
>

Probably not -- it depends on the OS.

>
> ok, so all commandline switches regarding the connection can be passed
> as init string also ?

Yes. (Though not all make sense, like mountpoint and port)

Would it help to have a owserver-like program that talks to dbus? Is
that what you are trying to create?

One thing we could add is an interface in pyowfs (or owcapi) to add
new "interfaces". You could then monitor udev or dbus for new usb
adapters in your code, and notify owfs of their existence, getting
back a positive identifier to the correct bus.n entry.

Paul Alfille

------------------------------------------------------------------------------

_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to