Bug #1673
Acer screen serial number
| Status: | New | Start date: | 05/20/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% | |
| Category: | - | |||
| Target version: | accepted changes still unplanned | |||
| For junior contributor: | No | Found in version: |
Description
Remi Collet did a PHP version of his hack to get the full serial number of the Acer monitor. It would be great to integrate the hack in the next release (this guy is deserve a lot of kudo!):
<?php
$base64 = "AP///////wAEcmkADDwAlCgTAQNoKRd4yj2FplZKmiQSUFS/b4BxT4FAgYCBwIEAAQEBAQEBZiFWqlEAHjBGjzMAmuYQAAAeAAAA/QA3TB9QDgAKICAgICAgAAAA/ABYMTkzSFEKCgoKCgoKAAAA/wBMRUswRDA5OTg1NDUKAGoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==";
$found = "LEK0D0998545";
$want = "LEK0D09994003C0C8545";
$edid = base64_decode($base64);
$len = strlen($base64);
$len = strlen($edid);
$sn = unpack("V", substr($edid, 12, 4));
$sn = $sn[1];
$fab = unpack("n", substr($edid, 8, 2));
$fab = chr(64+(($fab[1]&0x7c00)>>10)).chr(64+(($fab[1]&0x3e0)>>5)).chr(64+($fab[1]&0x1f));
$serial = false;
foreach (array(54,72,90,108) as $i) {
$zero = unpack("n", substr($edid, $i, 2));
$type = unpack("C", substr($edid, $i+3, 1));
if ($zero[1]==0 && $type[1]==255) {
$tmp = unpack("a*", substr($edid, $i+5, 13)."\0");
$serial = trim($tmp[1]);
}
}
printf("Manufact: %s\nSerial 1: %d\nSerial 2: %s\n", $fab, $sn, $serial);
if ($serial && $fab="ACR" && strlen($serial)==12) {
$full = substr($serial, 0, 8) . sprintf("%08X", $sn) . substr($serial, 8, 4);
printf("Full S/N: %s\n", $full);
}
History
#1
Updated by David Durieux about 1 year ago
Why not put this patch in the agent instead of server (may apply in this case to different servers use Agent)?
#2
Updated by Gonéri Le Bouder about 1 year ago
I believe we should do both:
Since 2.1.x, the agent send the complet EDID information. In general, it's easier to upgrade the server. That's the reason why I think the agent should not try to understand by iteself what an EDID string is.
On the other side, I make sense to adjust the agent EDID parsing for those who don't use FusionInventory for GLPI (#1607).
#3
Updated by David Durieux about 1 year ago
Yes so patch the server is not good idea, best solution for all is to patch the agent
#4
Updated by Gonéri Le Bouder about 1 year ago
The patch is short and easy to test, I don't get your point here.
#5
Updated by Gonéri Le Bouder 10 months ago
- Target version set to accepted changes still unplanned