[sane-devel] sanei_usb.c

Paul Smedley paul@smedley.info
Wed, 29 Jun 2005 08:44:07 +0930


Hi Gerald,

On 28/6/2005, "Gerald Murray" <gmurray@cloudnet.com> wrote:

>Quoting Paul Smedley <paul@smedley.info>:
>> One query I have though is about devname
>>=20
>> I see in sanei_usb.h that the libusb format for this is libusb:busno:devno
>>=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 devices.
>So the permissions on that filename can be used to indicate the permissions
>for its associated usb device.=20
Well permissions are pretty much non-existent on os/2...

>> 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 devices
>within that operating system.  This is a problem for the OS you are using..
I don't see why it's a problem?

usbcalls uses a device number for each usb device that's attached to the
system.

Using the format above, I could have for eg.
usbcalls:0 - ie my USB Floppy
usbcalls:1 - ie my USB Printer
usbcalls:2 - ie my USB Scanner

When usbcalls:2 is passed to sanei_usb_open, I know to open device number
2 via usbcalls?  Or am I missing something?

Cheers,

Paul.