Skip to content

Commit

Permalink
new hack for some LG monitors
Browse files Browse the repository at this point in the history
closes: #1848
  • Loading branch information
guillomovitch committed Oct 16, 2012
1 parent a62e40d commit eadc9ea
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/FusionInventory/Agent/Task/Inventory/Input/Generic/Screen.pm
Expand Up @@ -167,6 +167,20 @@ sub _getEdidInfo {
substr($edid->{serial_number2}->[0], 0, 8) .
sprintf("%08x", $edid->{serial_number}) .
substr($edid->{serial_number2}->[0], 8, 4) ;
} elsif (
$edid->{EISA_ID} &&
$edid->{EISA_ID} eq 'GSM4b21'
) {
# split serial in two parts
my ($high, $low) = $edid->{serial_number} =~ /(\d+) (\d\d\d)$/x;

# translate the first part using a custom alphabet
my @alphabet = split(//, "0123456789ABCDEFGHJKLMNPQRSTUVWXYZ");
my $base = scalar @alphabet;

$info->{SERIAL} =
$alphabet[$high / $base] . $alphabet[$high % $base] .
$low;
} else {
$info->{SERIAL} = $edid->{serial_number2} ?
$edid->{serial_number2}->[0] :
Expand Down
12 changes: 12 additions & 0 deletions t/inventory/generic/screen.t
Expand Up @@ -296,6 +296,18 @@ my %tests = (
SERIAL => '11004M0C00313',
DESCRIPTION => '49/2010'
},
'lcd.lg-l1960.1' => {
MANUFACTURER => 'LG Electronics Inc. (GoldStar Technology, Inc.)',
CAPTION => 'L1960TR ',
SERIAL => '9Y670',
DESCRIPTION => '11/2007'
},
'lcd.lg-l1960.2' => {
MANUFACTURER => 'LG Electronics Inc. (GoldStar Technology, Inc.)',
CAPTION => 'L1960TR ',
SERIAL => '9Y676',
DESCRIPTION => '11/2007'
},
'lcd.lenovo-3000-v100' => {
MANUFACTURER => 'AU Optronics',
CAPTION => undef,
Expand Down

0 comments on commit eadc9ea

Please sign in to comment.