Package oshi.util
Class EdidUtil
- java.lang.Object
-
- oshi.util.EdidUtil
-
@ThreadSafe public final class EdidUtil extends java.lang.Object
EDID parsing utility.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
LOG
-
Constructor Summary
Constructors Modifier Constructor Description private
EdidUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
getAlphaNumericOrHex(byte b)
static java.lang.String
getDescriptorRangeLimits(byte[] desc)
Parse descriptor range limitsstatic byte[][]
getDescriptors(byte[] edid)
Get the VESA descriptorsstatic java.lang.String
getDescriptorText(byte[] desc)
Parse descriptor textstatic int
getDescriptorType(byte[] desc)
Get the VESA descriptor typestatic int
getHcm(byte[] edid)
Get monitor width in cmstatic java.lang.String
getManufacturerID(byte[] edid)
Gets the Manufacturer ID from (up to) 3 5-bit characters in bytes 8 and 9static java.lang.String
getProductID(byte[] edid)
Gets the Product ID, bytes 10 and 11static java.lang.String
getSerialNo(byte[] edid)
Gets the Serial number, bytes 12-15static java.lang.String
getTimingDescriptor(byte[] desc)
Parse a detailed timing descriptorstatic int
getVcm(byte[] edid)
Get monitor height in cmstatic java.lang.String
getVersion(byte[] edid)
Return the EDID versionstatic byte
getWeek(byte[] edid)
Return the week of year of manufacturestatic int
getYear(byte[] edid)
Return the year of manufacturestatic boolean
isDigital(byte[] edid)
Test if this EDID is a digital monitor based on byte 20static java.lang.String
toString(byte[] edid)
Parse an EDID byte array into user-readable information
-
-
-
Method Detail
-
getManufacturerID
public static java.lang.String getManufacturerID(byte[] edid)
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
public static java.lang.String getProductID(byte[] edid)
Gets the Product ID, bytes 10 and 11- Parameters:
edid
- The EDID byte array- Returns:
- The product ID
-
getSerialNo
public static java.lang.String getSerialNo(byte[] edid)
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.
-
getAlphaNumericOrHex
private static java.lang.String getAlphaNumericOrHex(byte b)
-
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
public static java.lang.String getVersion(byte[] edid)
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
public static java.lang.String getTimingDescriptor(byte[] desc)
Parse a detailed timing descriptor- Parameters:
desc
- An 18-byte VESA descriptor- Returns:
- A string describing part of the detailed timing descriptor
-
getDescriptorRangeLimits
public static java.lang.String getDescriptorRangeLimits(byte[] desc)
Parse descriptor range limits- Parameters:
desc
- An 18-byte VESA descriptor- Returns:
- A string describing some of the range limits
-
getDescriptorText
public static java.lang.String getDescriptorText(byte[] desc)
Parse descriptor text- Parameters:
desc
- An 18-byte VESA descriptor- Returns:
- Plain text starting at the 4th byte
-
toString
public static java.lang.String toString(byte[] edid)
Parse an EDID byte array into user-readable information- Parameters:
edid
- An EDID byte array- Returns:
- User-readable text represented by the EDID
-
-