Package oshi.util
Class EdidUtil
java.lang.Object
oshi.util.EdidUtil
EDID parsing utility.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetDescriptorRangeLimits(byte[] desc) Parse descriptor range limitsstatic byte[][]getDescriptors(byte[] edid) Get the VESA descriptorsstatic StringgetDescriptorText(byte[] desc) Parse descriptor textstatic intgetDescriptorType(byte[] desc) Get the VESA descriptor typestatic intgetHcm(byte[] edid) Get monitor width in cmstatic StringgetManufacturerID(byte[] edid) Gets the Manufacturer ID from (up to) 3 5-bit characters in bytes 8 and 9static StringgetModel(byte[] edid) Get the monitor model from the EDIDstatic StringgetPreferredResolution(byte[] edid) Get the preferred resolution for the monitor (Eg: 1920x1080)static StringgetProductID(byte[] edid) Gets the Product ID, bytes 10 and 11static StringgetSerialNo(byte[] edid) Gets the Serial number, bytes 12-15static StringgetTimingDescriptor(byte[] desc) Parse a detailed timing descriptorstatic intgetVcm(byte[] edid) Get monitor height in cmstatic StringgetVersion(byte[] edid) Return the EDID versionstatic bytegetWeek(byte[] edid) Return the week of year of manufacturestatic intgetYear(byte[] edid) Return the year of manufacturestatic booleanisDigital(byte[] edid) Test if this EDID is a digital monitor based on byte 20static StringtoString(byte[] edid) Parse an EDID byte array into user-readable information
-
Method Details
-
getManufacturerID
Gets the Manufacturer ID from (up to) 3 5-bit characters in bytes 8 and 9- Parameters:
edid- The EDID byte array- Returns:
- The manufacturer ID
-
getProductID
Gets the Product ID, bytes 10 and 11- Parameters:
edid- The EDID byte array- Returns:
- The product ID
-
getSerialNo
Gets the Serial number, bytes 12-15- Parameters:
edid- The EDID byte array- Returns:
- If all 4 bytes represent alphanumeric characters, a 4-character string, otherwise a hex string.
-
getWeek
public static byte getWeek(byte[] edid) Return the week of year of manufacture- Parameters:
edid- The EDID byte array- Returns:
- The week of year
-
getYear
public static int getYear(byte[] edid) Return the year of manufacture- Parameters:
edid- The EDID byte array- Returns:
- The year of manufacture
-
getVersion
Return the EDID version- Parameters:
edid- The EDID byte array- Returns:
- The EDID version
-
isDigital
public static boolean isDigital(byte[] edid) Test if this EDID is a digital monitor based on byte 20- Parameters:
edid- The EDID byte array- Returns:
- True if the EDID represents a digital monitor, false otherwise
-
getHcm
public static int getHcm(byte[] edid) Get monitor width in cm- Parameters:
edid- The EDID byte array- Returns:
- Monitor width in cm
-
getVcm
public static int getVcm(byte[] edid) Get monitor height in cm- Parameters:
edid- The EDID byte array- Returns:
- Monitor height in cm
-
getDescriptors
public static byte[][] getDescriptors(byte[] edid) Get the VESA descriptors- Parameters:
edid- The EDID byte array- Returns:
- A 2D array with four 18-byte elements representing VESA descriptors
-
getDescriptorType
public static int getDescriptorType(byte[] desc) Get the VESA descriptor type- Parameters:
desc- An 18-byte VESA descriptor- Returns:
- An integer representing the first four bytes of the VESA descriptor
-
getTimingDescriptor
Parse a detailed timing descriptor- Parameters:
desc- An 18-byte VESA descriptor- Returns:
- A string describing part of the detailed timing descriptor
-
getDescriptorRangeLimits
Parse descriptor range limits- Parameters:
desc- An 18-byte VESA descriptor- Returns:
- A string describing some of the range limits
-
getDescriptorText
Parse descriptor text- Parameters:
desc- An 18-byte VESA descriptor- Returns:
- Plain text starting at the 4th byte
-
getPreferredResolution
Get the preferred resolution for the monitor (Eg: 1920x1080)- Parameters:
edid- The edid Byte array- Returns:
- Plain text preferred resolution
-
getModel
Get the monitor model from the EDID- Parameters:
edid- The edid Byte array- Returns:
- Plain text monitor model
-
toString
Parse an EDID byte array into user-readable information- Parameters:
edid- An EDID byte array- Returns:
- User-readable text represented by the EDID
-