[sane-devel] sanei_usb.c

Gerald Murray gmurray@cloudnet.com
Tue, 28 Jun 2005 11:02:36 -0500


Quoting Paul Smedley <paul@smedley.info>:

> Hi All,
> I'm working on adding support for USB scanners for Sane on OS/2.
>=20
> OS/2 doesn't have libusb, but has a library usbcalls that provides=20
> similar functionality, albeit most of the calls use different syntax.
>=20
> I have sane-find-scanner working now for most scanners, and have starte=
d=20
> work on remaining functions in sanei_usb.c
>=20
> One query I have though is about devname
>=20
> I see in sanei_usb.h that the libusb format for this is libusb:busno:de=
vno
>=20
> Is this defined for all devices or just ones that sanei_usb_init thinks=
=20
> are scanners?

It is defined for each usb device.  Having this naming scheme allows the=20
OS to use the same functionality that applies to filenames for usb device=
s.
So the permissions on that filename can be used to indicate the permissio=
ns
for its associated usb device.=20

> I assume that the format of devname really isn't important - so long as=
=20
> it's useful to the usb method being used (ie kernel, libusb or usbcalls=
=20
> for OS/2) in determining which usb device is being attached to?
>=20
> In which case, I could use usbcalls:deviceno or even just deviceno?

For portability, it would be best to use just one system for all usb devi=
ces
within that operating system.  This is a problem for the OS you are using=
.

> usbcalls doesn't just bus/deviceno - it just has a device number for=20
> each device attached.
>=20
> Thanks for listening - I hope to have some patches (and probably some=20
> more questions!!) soonish :)
>=20
> Cheers,
>=20
> Paul.

regards,

Gerald
--=20