ok, i am using the moblin beta image along with libusb 1.0.

i am writing a udev rules file and it looks like,

# comment
SUBSYSTEMS=="usb", SYSFS{vendor}=="Multiplex Engineering", SYSFS{product}=="USB", NAME="dii", MODE="0666", OPTIONS+="last_rule"
RUN+="/media/disk/scan"

when i plug in my widget, its shows up on bus 3/port 2, i get a device node created, /dev/usb/003/002, but with perms of 0660 (the default!).

when i run my program and try to access the device as a user, i get the msg, libusb needs write access to the target. so fine, i use sudo to run as root, and i get an error back from claim_interface, -6, device or resource busy.

my calling code looks like, ...

  r = libusb_init(NULL);
  if (r < 0) {
     fprintf(stderr, "failed to initialise libusb\n");
     exit(1);
  }
  libusb_set_debug(NULL, 0x2);

  r = get_device();
  if (r < 0) {
     fprintf(stderr, "Could not find/open device (0x%x:0x%x)\n", VID, PID);
     goto exit;
  }
  r = libusb_claim_interface(devh, 0);
  if (r < 0) {
fprintf(stderr, "usb_claim_interface error %d (%s)\n", r, strerror(errno));
     goto exit;
  }

i used udevadm to test   and i get ...

udev_rules_new: temporary index used 6900 bytes (345 * 20 bytes)
udev_device_new_from_syspath: device 0x9294830 has devpath '/bus/usb'
*udev_rules_apply_to_event: RUN '/media/disk/scan' /etc/udev/rules.d/12-local.rules:3*

my questions:

1. assuming that udevd is seeing the rule, why is my 0666 mode ignored for the default 0660 ?
2. what could be keeping this device busy behind my back?

suggestions? thx, jackc...


--
  jack craig
     [email protected]
        831-684-1375 (Office)
           831-596-6924 (cell)
              IM: jackcraigaptos (AIM)

_______________________________________________
Moblin dev Mailing List
[email protected]

To manage or unsubscribe from this mailing list visit:
https://lists.moblin.org/mailman/listinfo/dev or your user account on 
http://moblin.org once logged in.

For more information on the Moblin Developer Mailing lists visit:
http://moblin.org/community/mailing-lists

Reply via email to