Package oshi.util.platform.mac
Class IOKitUtil
- java.lang.Object
-
- oshi.util.platform.mac.IOKitUtil
-
public class IOKitUtil extends java.lang.Object
Provides utilities for IOKit- Author:
- widdis[at]gmail[dot]com
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CoreFoundation.CFMutableDictionaryRef
getBSDNameMatchingDict(java.lang.String bsdName)
Convenience method to get the IO dictionary matching a bsd namestatic boolean
getIORegistryBooleanProperty(int entry, java.lang.String key)
Convenience method to get a Boolean value from an IO Registrystatic byte[]
getIORegistryByteArrayProperty(int entry, java.lang.String key)
Convenience method to get a byte array value from an IO Registrystatic int
getIORegistryIntProperty(int entry, java.lang.String key)
Convenience method to get an Int value from an IO Registrystatic long
getIORegistryLongProperty(int entry, java.lang.String key)
Convenience method to get a Long value from an IO Registrystatic java.lang.String
getIORegistryStringProperty(int entry, java.lang.String key)
Convenience method to get a String value from an IO Registrystatic int
getMatchingService(java.lang.String serviceName)
Opens an IOService matching the given namestatic int
getMatchingServices(java.lang.String serviceName, com.sun.jna.ptr.IntByReference serviceIterator)
Convenience method to get matching IOService objectsstatic int
getMatchingServices(CoreFoundation.CFMutableDictionaryRef matchingDictionary, com.sun.jna.ptr.IntByReference serviceIterator)
Convenience method to get matching IOService objectsstatic int
getRoot()
Gets the IO Registry root
-
-
-
Method Detail
-
getRoot
public static int getRoot()
Gets the IO Registry root- Returns:
- an int handle to the IORoot
-
getMatchingService
public static int getMatchingService(java.lang.String serviceName)
Opens an IOService matching the given name- Parameters:
serviceName
- The service name to match- Returns:
- an int handle to an IOService if successful, 0 if failed
-
getMatchingServices
public static int getMatchingServices(java.lang.String serviceName, com.sun.jna.ptr.IntByReference serviceIterator)
Convenience method to get matching IOService objects- Parameters:
serviceName
- The service name to matchserviceIterator
- An interator over matching items, set on return- Returns:
- 0 if successful, an error code if failed.
-
getMatchingServices
public static int getMatchingServices(CoreFoundation.CFMutableDictionaryRef matchingDictionary, com.sun.jna.ptr.IntByReference serviceIterator)
Convenience method to get matching IOService objects- Parameters:
matchingDictionary
- The dictionary to matchserviceIterator
- An interator over matching items, set on return- Returns:
- 0 if successful, an error code if failed.
-
getIORegistryStringProperty
public static java.lang.String getIORegistryStringProperty(int entry, java.lang.String key)
Convenience method to get a String value from an IO Registry- Parameters:
entry
- A handle to the registry entrykey
- The string name of the key to retrieve- Returns:
- The value of the registry entry if it exists; null otherwise
-
getIORegistryLongProperty
public static long getIORegistryLongProperty(int entry, java.lang.String key)
Convenience method to get a Long value from an IO Registry- Parameters:
entry
- A handle to the registry entrykey
- The string name of the key to retrieve- Returns:
- The value of the registry entry if it exists; 0 otherwise
-
getIORegistryIntProperty
public static int getIORegistryIntProperty(int entry, java.lang.String key)
Convenience method to get an Int value from an IO Registry- Parameters:
entry
- A handle to the registry entrykey
- The string name of the key to retrieve- Returns:
- The value of the registry entry if it exists; 0 otherwise
-
getIORegistryBooleanProperty
public static boolean getIORegistryBooleanProperty(int entry, java.lang.String key)
Convenience method to get a Boolean value from an IO Registry- Parameters:
entry
- A handle to the registry entrykey
- The string name of the key to retrieve- Returns:
- The value of the registry entry if it exists; false otherwise
-
getIORegistryByteArrayProperty
public static byte[] getIORegistryByteArrayProperty(int entry, java.lang.String key)
Convenience method to get a byte array value from an IO Registry- Parameters:
entry
- A handle to the registry entrykey
- The string name of the key to retrieve- Returns:
- The value of the registry entry if it exists; null otherwise
-
getBSDNameMatchingDict
public static CoreFoundation.CFMutableDictionaryRef getBSDNameMatchingDict(java.lang.String bsdName)
Convenience method to get the IO dictionary matching a bsd name- Parameters:
bsdName
- The bsd name of the registry entry- Returns:
- The dictionary ref
-
-