[Libdlo] Equivalent for $DISPLAY
Phil Endecott
spam_from_libdlo at chezphil.org
Sat May 23 07:50:02 PDT 2009
Dear All,
libdlo provides a convenient function, dlo_claim_first_device(), to get
the first attached device. This is great if you only have one device
connected. But there's a danger that we'll end up with utilities that
call this and so cannot be made to work on systems with more than one
device attached.
I'd like to propose that we remove dlo_claim_first_device() and instead
provide something like dlo_claim_default_device(). This will behave
like X applications and check for an environment variable or
command-line option that specifies the device to use, and will fall
back to the first unclaimed device if nothing else is specified.
Suggestions for environment variable and command line option names are
welcome; my initial idea is $DLDISPLAY and --dldisplay.
This leaves the question of how to name the displays. We can see
serial numbers in the dlo_devinfo_t; is this really a unique number?
I.e. do the devices have PROMs in them? I've dismantled my dongle and
it does indeed have an I2C PROM, but is this essential to the design or
is it the first thing that el cheapo OEM will not implement? (I have
seen other USB devices that present a default set of IDs if no PROM is attached.)
I'm trying to think of precedents, but I can only think of things where
the kernel and udev choose names; that doesn't apply to libusb stuff.
What else uses libusb? How does SANE name devices?
Regards, Phil.
More information about the Libdlo
mailing list