Top Description Fields Constructors Methods
com.sun.jna.platform.mac

public Class IOKitUtil

extends Object
Class Inheritance
Imports
com.sun.jna.platform.mac.CoreFoundation.CFDictionaryRef, .CoreFoundation.CFMutableDictionaryRef, .IOKit.IOIterator, .IOKit.IORegistryEntry, .IOKit.IOService, com.sun.jna.ptr.IntByReference, .PointerByReference

Provides utilities for IOKit.

Field Summary

Modifier and TypeField and Description
private static final IOKit
private static final SystemB

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static CoreFoundation.CFMutableDictionaryRef

Returns:

The dictionary ref if successful, null if failed. Callers should release when finished, using IOKit#IOObjectRelease.
getBSDNameMatchingDict
(String
The bsd name of the registry entry
bsdName
)

Convenience method to get the IO dictionary matching a bsd name.

public static int

Returns:

The master port.

Multiple calls to getMasterPort will not result in leaking ports (each call to IOKit#IOMasterPort 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.

getMasterPort
()

Gets a pointer to the Mach Master Port.

public static IOKit.IOService

Returns:

a handle to an IOService if successful, null if failed. Callers should release when finished, using IOKit#IOObjectRelease.
getMatchingService
(String
The service name to match
serviceName
)

Opens a the first IOService matching a service name.

public static IOKit.IOService

Returns:

a handle to an IOService if successful, null if failed. Callers should release when finished, using IOKit#IOObjectRelease.
getMatchingService
(CoreFoundation.CFDictionaryRef
The dictionary to match. This method will consume a reference to the dictionary.
matchingDictionary
)

Opens a the first IOService matching a dictionary.

public static IOKit.IOIterator

Returns:

a handle to an IOIterator if successful, null if failed. Callers should release when finished, using IOKit#IOObjectRelease.
getMatchingServices
(String
The service name to match
serviceName
)

Convenience method to get IOService objects matching a service name.

public static IOKit.IOIterator

Returns:

a handle to an IOIterator if successful, null if failed. Callers should release when finished, using IOKit#IOObjectRelease.
getMatchingServices
(CoreFoundation.CFDictionaryRef
The dictionary to match. This method will consume a reference to the dictionary.
matchingDictionary
)

Convenience method to get IOService objects matching a dictionary.

public static IOKit.IORegistryEntry

Returns:

a handle to the IORoot. Callers should release when finished, using IOKit#IOObjectRelease.
getRoot
()

Gets the IO Registry root.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

IOback to summary
private static final IOKit IO
SYSback to summary
private static final SystemB SYS

Constructor Detail

IOKitUtilback to summary
private IOKitUtil()

Method Detail

getBSDNameMatchingDictback to summary
public static CoreFoundation.CFMutableDictionaryRef getBSDNameMatchingDict(String bsdName)

Convenience method to get the IO dictionary matching a bsd name.

Parameters
bsdName:String

The bsd name of the registry entry

Returns:CoreFoundation.CFMutableDictionaryRef

The dictionary ref if successful, null if failed. Callers should release when finished, using IOKit#IOObjectRelease.

getMasterPortback to summary
public static int getMasterPort()

Gets a pointer to the Mach Master Port.

Returns:int

The master port.

Multiple calls to getMasterPort will not result in leaking ports (each call to IOKit#IOMasterPort 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.

getMatchingServiceback to summary
public static IOKit.IOService getMatchingService(String serviceName)

Opens a the first IOService matching a service name.

Parameters
serviceName:String

The service name to match

Returns:IOKit.IOService

a handle to an IOService if successful, null if failed. Callers should release when finished, using IOKit#IOObjectRelease.

getMatchingServiceback to summary
public static IOKit.IOService getMatchingService(CoreFoundation.CFDictionaryRef matchingDictionary)

Opens a the first IOService matching a dictionary.

Parameters
matchingDictionary:CoreFoundation.CFDictionaryRef

The dictionary to match. This method will consume a reference to the dictionary.

Returns:IOKit.IOService

a handle to an IOService if successful, null if failed. Callers should release when finished, using IOKit#IOObjectRelease.

getMatchingServicesback to summary
public static IOKit.IOIterator getMatchingServices(String serviceName)

Convenience method to get IOService objects matching a service name.

Parameters
serviceName:String

The service name to match

Returns:IOKit.IOIterator

a handle to an IOIterator if successful, null if failed. Callers should release when finished, using IOKit#IOObjectRelease.

getMatchingServicesback to summary
public static IOKit.IOIterator getMatchingServices(CoreFoundation.CFDictionaryRef matchingDictionary)

Convenience method to get IOService objects matching a dictionary.

Parameters
matchingDictionary:CoreFoundation.CFDictionaryRef

The dictionary to match. This method will consume a reference to the dictionary.

Returns:IOKit.IOIterator

a handle to an IOIterator if successful, null if failed. Callers should release when finished, using IOKit#IOObjectRelease.

getRootback to summary
public static IOKit.IORegistryEntry getRoot()

Gets the IO Registry root.

Returns:IOKit.IORegistryEntry

a handle to the IORoot. Callers should release when finished, using IOKit#IOObjectRelease.