public class IOKitUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static CoreFoundation.CFMutableDictionaryRef |
getBSDNameMatchingDict(java.lang.String bsdName)
Convenience method to get the IO dictionary matching a bsd name.
|
static int |
getMasterPort()
Gets a pointer to the Mach Master Port.
|
static IOKit.IOService |
getMatchingService(CoreFoundation.CFDictionaryRef matchingDictionary)
Opens a the first IOService matching a dictionary.
|
static IOKit.IOService |
getMatchingService(java.lang.String serviceName)
Opens a the first IOService matching a service name.
|
static IOKit.IOIterator |
getMatchingServices(CoreFoundation.CFDictionaryRef matchingDictionary)
Convenience method to get IOService objects matching a dictionary.
|
static IOKit.IOIterator |
getMatchingServices(java.lang.String serviceName)
Convenience method to get IOService objects matching a service name.
|
static IOKit.IORegistryEntry |
getRoot()
Gets the IO Registry root.
|
public static int getMasterPort()
Multiple calls to getMasterPort()
will not result in leaking
ports (each call to IOKit.IOMasterPort(int, com.sun.jna.ptr.IntByReference)
adds another send
right to the port) but it is considered good programming practice to
deallocate the port when you are finished with it, using
SystemB.mach_port_deallocate(int, int)
.
public static IOKit.IORegistryEntry getRoot()
IOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.public static IOKit.IOService getMatchingService(java.lang.String serviceName)
serviceName
- The service name to matchnull
if failed.
Callers should release when finished, using
IOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.public static IOKit.IOService getMatchingService(CoreFoundation.CFDictionaryRef matchingDictionary)
matchingDictionary
- The dictionary to match. This method will consume a reference to
the dictionary.null
if failed.
Callers should release when finished, using
IOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.public static IOKit.IOIterator getMatchingServices(java.lang.String serviceName)
serviceName
- The service name to matchnull
if failed.
Callers should release when finished, using
IOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.public static IOKit.IOIterator getMatchingServices(CoreFoundation.CFDictionaryRef matchingDictionary)
matchingDictionary
- The dictionary to match. This method will consume a reference to
the dictionary.null
if failed.
Callers should release when finished, using
IOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.public static CoreFoundation.CFMutableDictionaryRef getBSDNameMatchingDict(java.lang.String bsdName)
bsdName
- The bsd name of the registry entrynull
if failed. Callers
should release when finished, using IOKit.IOObjectRelease(com.sun.jna.platform.mac.IOKit.IOObject)
.