mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
Monitor: detect serial number and manufacture date
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user