summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 1aa420d79..fe5f484cd 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -640,8 +640,9 @@ sub whatUsbport() {
# Remove non-printable characters
$idstr =~ tr/[\x00-\x1f]/\./;
# Extract the printer data from the ID string
- my ($manufacturer, $model, $serialnumber, $description) =
- ("", "", "", "");
+ my ($manufacturer, $model, $serialnumber, $description,
+ $commandset, $sku) =
+ ("", "", "", "", "");
if ($idstr =~ /MFG:([^;]+);/ || $idstr =~ /MANUFACTURER:([^;]+);/) {
$manufacturer = $1;
$manufacturer =~ s/Hewlett[-\s_]Packard/HP/;
@@ -653,7 +654,7 @@ sub whatUsbport() {
$model ||= $1;
}
if ($idstr =~ /SKU:([^;]+);/) {
- $model = $1;
+ $sku = $1;
}
if ($idstr =~ /DES:([^;]+);/ || $idstr =~ /DESCRIPTION:([^;]+);/) {
$description = $1;
@@ -663,6 +664,10 @@ sub whatUsbport() {
if ($idstr =~ /SE*R*N:([^;]+);/) {
$serialnumber = $1;
}
+ if ($idstr =~ /CMD:([^;]+);/ ||
+ $idstr =~ /COMMAND\s*SET:([^;]+);/) {
+ $commandset ||= $1;
+ }
# Was there a manufacturer and a model in the string?
if ($manufacturer eq "" || $model eq "") {
next;
@@ -677,7 +682,9 @@ sub whatUsbport() {
MODEL => $model,
MANUFACTURER => $manufacturer,
DESCRIPTION => $description,
- SERIALNUMBER => $serialnumber
+ SERIALNUMBER => $serialnumber,
+ 'COMMAND SET' => $commandset,
+ SKU => $sku
} };
}
@res;