Monitor: detect serial number and manufacture date

This commit is contained in:
李通洲
2024-01-10 16:34:14 +08:00
parent f5a57ab747
commit 0645f559af
7 changed files with 72 additions and 6 deletions
+14
View File
@@ -50,6 +50,20 @@ void ffEdidGetPhysicalSize(const uint8_t edid[128], uint32_t* width, uint32_t* h
*height = (((uint32_t) edid[68] & 0x0F) << 8) + edid[67];
}
void ffEdidGetSerialAndManufactureDate(const uint8_t edid[128], uint32_t* serial, uint16_t* year, uint16_t* week)
{
if (edid[17] > 0 && edid[17] < 0xFF)
{
*year = edid[17] + 1990;
*week = edid[16];
if (*week == 0xFF) *week = 0;
}
else
*year = *week = 0;
*serial = *(uint32_t*) &edid[12];
}
bool ffEdidGetHdrCompatible(const uint8_t* edid, uint32_t length)
{
if (length <= 128) return false;
+1
View File
@@ -7,4 +7,5 @@ void ffEdidGetVendorAndModel(const uint8_t edid[128], FFstrbuf* result);
bool ffEdidGetName(const uint8_t edid[128], FFstrbuf* name);
void ffEdidGetPhysicalResolution(const uint8_t edid[128], uint32_t* width, uint32_t* height);
void ffEdidGetPhysicalSize(const uint8_t edid[128], uint32_t* width, uint32_t* height); // in mm
void ffEdidGetSerialAndManufactureDate(const uint8_t edid[128], uint32_t* serial, uint16_t* year, uint16_t* week);
bool ffEdidGetHdrCompatible(const uint8_t* edid, uint32_t length);