Android->auto detecting USB printer

This commit is contained in:
Guanzl
2017-04-05 09:16:52 +08:00
parent 5470e64b66
commit d9775e5b58

View File

@ -764,7 +764,12 @@ static void handle_generic_device_event(struct uevent *uevent)
make_dir(devpath, 0755);
snprintf(devpath, sizeof(devpath), "/dev/bus/usb/%03d/%03d", bus_id, device_id);
}
} else {
} else if (!strncmp(uevent->subsystem, "usbmisc", 7)){
if(!strncmp(uevent->device_name, "usb/lp",6)) {
base = "/dev/usb/";
make_dir(base, 0755);
}
}else {
/* ignore other USB events */
return;
}