From d5d88c3015a1f1614c0ebb007b25db4370e2da5a Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Fri, 26 Jul 2002 00:22:24 +0000 Subject: Added detection of trhe serial number of a USB printer (in preparation for HPOJ 0.9 support in printerdrake). --- perl-install/detect_devices.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'perl-install/detect_devices.pm') diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 235e4945d..b4eef5ec6 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -528,7 +528,8 @@ sub whatUsbport() { # Remove non-printable characters $idstr =~ tr/[\x00-\x1f]/\./; # Extract the printer data from the ID string - my ($manufacturer, $model, $description) = ("", "", ""); + my ($manufacturer, $model, $serialnumber, $description) = + ("", "", "", ""); if (($idstr =~ /MFG:([^;]+);/) || ($idstr =~ /MANUFACTURER:([^;]+);/)) { $manufacturer = $1; @@ -545,6 +546,9 @@ sub whatUsbport() { $description =~ s/Hewlett[-\s_]Packard/HP/; $description =~ s/HEWLETT[-\s_]PACKARD/HP/; } + if ($idstr =~ /SE*R*N:([^;]+);/) { + $serialnumber = $1; + } # Was there a manufacturer and a model in the string? if (($manufacturer eq "") || ($model eq "")) { next; @@ -559,6 +563,7 @@ sub whatUsbport() { MODEL => $model, MANUFACTURER => $manufacturer, DESCRIPTION => $description, + SERIALNUMBER => $serialnumber }}; } @res; -- cgit v1.2.1