Function

IOPSGetPowerSourceDescription

Returns a CFDictionary with readable information about the specific power source.

Declaration

CFDictionaryRef IOPSGetPowerSourceDescription(CFTypeRef blob, CFTypeRef ps);

Parameters

blob

The CFTypeRef returned by IOPSCopyPowerSourcesInfo()

ps

One of the CFTypeRefs in the CFArray returned by IOPSCopyPowerSourcesList()

Return Value

Returns NULL if an error was encountered, otherwise a CFDictionary. Caller should NOT release the returned CFDictionary - it will be released as part of the CFTypeRef returned by IOPSCopyPowerSourcesInfo().

Discussion

See the C-strings defined in IOPSKeys.h for specific keys into the dictionary. Don't expect all keys to be present in any dictionary. Some power sources, for example, may not support the "Time Remaining To Empty" key and it will not be present in their dictionaries.

See Also

Power Source Descriptions

IOPSCopyExternalPowerAdapterDetails

Returns a CFDictionary that describes the attached (AC) external power adapter (if any external power adapter is attached.

IOPSCopyPowerSourcesInfo

Returns a blob of Power Source information in an opaque CFTypeRef.

IOPSCopyPowerSourcesList

Returns a CFArray of Power Source handles, each of type CFTypeRef.

IOPSGetProvidingPowerSourceType(CFTypeRef)

Indicates the power source the computer is currently drawing from.

IOPSNotificationCreateRunLoopSource

Returns a CFRunLoopSourceRef that notifies the caller when power source information changes.