Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

Power Manager Reference

Framework
CoreServices/CoreServices.h
Declared in
Power.h

Overview

The Power Manager controls power to the internal hardware devices of battery-powered Macintosh computers (such PowerBook computers). The Power Manager automatically shuts off power to internal devices to conserve power whenever the computer has not been used for a predetermined amount of time. In addition, the Power Manager allows your application or other software to

Most applications do not need to know whether they are executing on a battery-powered Macintosh computer because the transition between power states is largely invisible. As a result, most applications do not need to use Power Manager routines. You need Power Manager only if you are writing a program--such as a device driver--that must control power to some subsystem of a battery-powered Macintosh computer or that might be affected by the idle or sleep state.

Carbon supports Power Manager functions prior to Power Manager 2.0. However, many of these functions do nothing on Mac OS X; these calls have been retained in Carbon as the only means for implementing power management on Mac OS 8 and 9. Before using any of the Power Manager API, you should call the PMFeatures function to check the availability of the feature you wish to use. On Mac OS X, use the functions provided in IOKit for power management. For more information on IOKit, see I/O Kit Fundamentals.

Functions by Task

Function descriptions are grouped by the tasks for which you use the functions. For an alphabetical list of functions, go to the API index at the end of the document.

Controlling the Idle State

Controlling and Reading the Wakeup Timer

Controlling the Sleep Queue

Controlling Serial Power

Reading the Status of the Internal Modem

Reading the Status of the Battery and of the Battery Charger

Miscellaneous

Functions

BatteryCount

short BatteryCount (
   void
);

Availability
Declared In
Power.h

CurrentProcessorSpeed

Returns the current effective clock speed of the CPU in megahertz.

short CurrentProcessorSpeed (
   void
);

Return Value

The clock speed of the CPU in megahertz (MHz). One MHz represents one million cycles per second.

Special Considerations

Prior to Mac OS X 10.4, this function returns the maximum clock speed, not the current effective clock speed.

Availability
Declared In
Power.h

DisposeHDSpindownUPP

Unimplemented.

void DisposeHDSpindownUPP (
   HDSpindownUPP userUPP
);

Availability
Declared In
Power.h

DisposePMgrStateChangeUPP

Unimplemented

void DisposePMgrStateChangeUPP (
   PMgrStateChangeUPP userUPP
);

Special Considerations

The I/O Kit Framework header file IOPMLib.h (in I/O Kit Framework Reference) provides access to common power management facilites, such as initiating system sleep, getting current idle timer values, registering for sleep/wake notifications, and preventing system sleep. For additional information about power management for device drivers, see I/O Kit Fundamentals and I/O Kit Device Driver Design Guidelines.

Availability
Declared In
Power.h

DisposeSleepQUPP

void DisposeSleepQUPP (
   SleepQUPP userUPP
);

Availability
Declared In
Power.h

GetCPUSpeed

Returns the current effective clock speed of the CPU in megahertz.

long GetCPUSpeed (
   void
);

Return Value

The clock speed of the CPU in megahertz.

Discussion

For more information, see CurrentProcessorSpeed.

Availability
Declared In
Power.h

InvokeHDSpindownUPP

Unimplemented.

void InvokeHDSpindownUPP (
   HDQueueElement *theElement,
   HDSpindownUPP userUPP
);

Availability
Declared In
Power.h

InvokePMgrStateChangeUPP

Unimplemented.

void InvokePMgrStateChangeUPP (
   PMgrQueueElement *theElement,
   long stateBits,
   PMgrStateChangeUPP userUPP
);

Availability
Declared In
Power.h

InvokeSleepQUPP

long InvokeSleepQUPP (
   long message,
   SleepQRecPtr qRecPtr,
   SleepQUPP userUPP
);

Availability
Declared In
Power.h

MaximumProcessorSpeed

short MaximumProcessorSpeed (
   void
);

Version Notes

MaximumProcessorSpeed is unimplemented on versions of Mac OS X prior to Mac OS X 10.1.

Availability
Declared In
Power.h

MinimumProcessorSpeed

short MinimumProcessorSpeed (
   void
);

Special Considerations

MinimumProcessorSpeed is unimplemented on versions of Mac OS X prior to Mac OS X v10.1.

Availability
Declared In
Power.h

NewHDSpindownUPP

Unimplemented.

HDSpindownUPP NewHDSpindownUPP (
   HDSpindownProcPtr userRoutine
);

Return Value

See the description of the HDSpindownUPP data type.

Discussion

See the callback HDSpindownProcPtr for more information.

Special Considerations

The I/O Kit Framework header file IOPMLib.h (in I/O Kit Framework Reference) provides access to common power management facilites, such as initiating system sleep, getting current idle timer values, registering for sleep/wake notifications, and preventing system sleep. For additional information about power management for device drivers, see I/O Kit Fundamentals and I/O Kit Device Driver Design Guidelines.

Availability
Declared In
Power.h

NewPMgrStateChangeUPP

Unimplemented.

PMgrStateChangeUPP NewPMgrStateChangeUPP (
   PMgrStateChangeProcPtr userRoutine
);

Return Value

See the description of the PMgrStateChangeUPP data type.

Availability
Declared In
Power.h

NewSleepQUPP

SleepQUPP NewSleepQUPP (
   SleepQProcPtr userRoutine
);

Return Value

See the description of the SleepQUPP data type.

Discussion

See the callback SleepQProcPtr for more information.

Availability
Declared In
Power.h

SleepQInstall

Adds an entry to the sleep queue.

void SleepQInstall (
   SleepQRecPtr qRecPtr
);

Parameters
qRecPtr

A pointer to a sleep queue record that you must provide.

Availability
Declared In
Power.h

SleepQRemove

Removes an entry from the sleep queue.

void SleepQRemove (
   SleepQRecPtr qRecPtr
);

Parameters
qRecPtr

A pointer to a sleep queue record that you provided when you added your routine to the sleep queue.

Availability
Declared In
Power.h

UpdateSystemActivity

OSErr UpdateSystemActivity (
   UInt8 activity
);

Return Value

A result code. See “Power Manager Result Codes.”

Availability
Declared In
Power.h

Callbacks

HDSpindownProcPtr

typedef void (*HDSpindownProcPtr) (
   HDQueueElement * theElement
);

If you name your function MyHDSpindownCallback, you would declare it like this:

void MyHDSpindownCallback (
   HDQueueElement * theElement
);

Availability
Declared In
Power.h

PMgrStateChangeProcPtr

typedef void (*PMgrStateChangeProcPtr) (
   PMgrQueueElement * theElement,
   long stateBits
);

If you name your function MyPMgrStateChangeCallback, you would declare it like this:

void MyPMgrStateChangeCallback (
   PMgrQueueElement * theElement,
   long stateBits
);

Availability
Declared In
Power.h

PowerHandlerProcPtr

typedef OSStatus (*PowerHandlerProcPtr) (
   UInt32 message,
   void * param,
   UInt32 refCon,
   RegEntryID * regEntryID
);

If you name your function MyPowerHandlerCallback, you would declare it like this:

OSStatus MyPowerHandlerCallback (
   UInt32 message,
   void * param,
   UInt32 refCon,
   RegEntryID * regEntryID
);

Return Value

A result code. See “Power Manager Result Codes.”

Availability
Declared In
Power.h

SleepQProcPtr

typedef long (*SleepQProcPtr) (
   long message,
   SleepQRecPtr qRecPtr
);

If you name your function MySleepQProc, you would declare it like this:

long MySleepQProc (
   long message,
   SleepQRecPtr qRecPtr
);

Availability
Declared In
Power.h

Data Types

ActivityInfo

struct ActivityInfo {
   short ActivityType;
   unsigned long ActivityTime;
};
typedef struct ActivityInfo ActivityInfo;

Fields
ActivityType

A short representing the type of activity to fetch.

ActivityTime

An unsigned long representing the time of the last activity in ticks.

Availability
Declared In
Power.h

BatteryByte

typedef SInt8 BatteryByte;

Availability
Declared In
Power.h

BatteryInfo

struct BatteryInfo {
   UInt8 flags;
   UInt8 warningLevel;
   UInt8 reserved;
   UInt8 batteryLevel;
};
typedef struct BatteryInfo BatteryInfo;

Fields
flags

An unsigned, 8-bit integer representing battery state information.

warningLevel

An unsigned, 8-bit integer representing a scaled warning level. The value of this field is in the range of 0-255.

reserved

This field is reserved for internal use.

batteryLevel

An unsigned, 8-bit integer representing a scaled battery level. The value for this field is in the range of 0-255.

Availability
Declared In
Power.h

BatteryTimeRec

struct BatteryTimeRec {
   unsigned long expectedBatteryTime;
   unsigned long minimumBatteryTime;
   unsigned long maximumBatteryTime;
   unsigned long timeUntilCharged;
};
typedef struct BatteryTimeRec BatteryTimeRec;

Fields
expectedBatteryTime

An unsigned long representing in seconds, the estimated battery time remaining.

minimumBatteryTime

An unsigned long representing in seconds, the minimum battery time remaining.

maximumBatteryTime

An unsigned long representing in seconds, the maximum battery time remaining.

timeUntilCharged

An unsigned long representing in seconds, the time remaining until the battery is fully charged.

Availability
Declared In
Power.h

DevicePowerInfo

struct DevicePowerInfo {
   UInt32 version;
   RegEntryID regID;
   OptionBits flags;
   UInt32 minimumWakeTime;
   UInt32 sleepPowerNeeded;
};
typedef struct DevicePowerInfo DevicePowerInfo;

Fields
version

The version of this structure.

regID

The Registry Entry ID for the device.

flags

A value of type OptionBits representing device power information.

minimumWakeTime

The minimum number of seconds before the device sleeps again.

sleepPowerNeeded

The milliwatts the device requires in the sleep state.

Availability
Declared In
Power.h

HDQueueElement

struct HDQueueElement {
   struct HDQueueElement * hdQLink;
      short hdQType;
      short hdFlags;
      HDSpindownUPP hdProc;
      long hdUser;
   };
   typedef struct HDQueueElement HDQueueElement;

Fields
hdQLink

A pointer to the next queue element.

hdQType

A value of type short representing the queue element type.

hdFlags

A value of type short representing flags.

hdProc

A pointer to the hard drive spindown routine to call.

hdUser

A user-defined value.

Availability
Declared In
Power.h

HDSpindownUPP

typedef HDSpindownProcPtr HDSpindownUPP;

Availability
Declared In
Power.h

ModemByte

typedef SInt8 ModemByte;

Availability
Declared In
Power.h

PMgrQueueElement

struct PMgrQueueElement {
   struct PMgrQueueElement * pmQLink;
      short pmQType;
      short pmFlags;
      long pmNotifyBits;
      PMgrStateChangeUPP pmProc;
      long pmUser;
   };
   typedef struct PMgrQueueElement PMgrQueueElement;

Fields
pmQLink

A pointer to the next queue element.

pmQType

A value of type short representing the queue element type.

pmFlags

A value of type short representing flags.

pmNotifyBits

A bitmap representing the changes of which you wish to be notified.

pmProc

A pointer to the routine to call.

pmUser

A user-defined value.

Availability
Declared In
Power.h

PMgrStateChangeUPP

typedef PMgrStateChangeProcPtr PMgrStateChangeUPP;

Availability
Declared In
Power.h

PMResultCode

typedef long PMResultCode;

Availability
Declared In
Power.h

PowerLevel

typedef UInt32 PowerLevel;

Availability
Declared In
Power.h

PowerSourceID

typedef SInt16 PowerSourceID;

Availability
Declared In
Power.h

PowerSourceParamBlock

struct PowerSourceParamBlock {
   PowerSourceID sourceID;
   UInt16 sourceCapacityUsage;
   UInt32 sourceVersion;
   OptionBits sourceAttr;
   OptionBits sourceState;
   UInt32 currentCapacity;
   UInt32 maxCapacity;
   UInt32 timeRemaining;
   UInt32 timeToFullCharge;
   UInt32 voltage;
   SInt32 current;
   UInt32 lowWarnLevel;
   UInt32 deadWarnLevel;
   UInt32 reserved[16];
};
typedef struct PowerSourceParamBlock PowerSourceParamBlock;
typedef PowerSourceParamBlock * PowerSourceParamBlockPtr;

Fields
sourceID

A unique ID assigned by the Power Manager.

sourceCapacityUsage

An unsigned, 16-bit integer representing current capacity usage.

sourceVersion

An unsigned, 32-bit integer indicating the version of this record.

sourceAttr

A value of type OptionBits representing power source attributes.

sourceState

A value of type OptionBits representing power source states.

currentCapacity

The current capacity represented in milliwatts or percentage.

maxCapacity

The full capacity represented in milliwatts.

timeRemaining

The time remaining represented in milliwatt-hours.

timeToFullCharge

The time required to charge represented in milliwatt-hours.

voltage

The voltage represented in millivolts.

current

The current represented in milliamperes. This value may be negative if the power source is consuming.

lowWarnLevel

The low warning level represented in milliwatts, or percentage depending on the representation of sourceCapacityUsage.

deadWarnLevel

The dead warming level represented in milliwatts, or percentage depending on the representation of sourceCapacityUsage.

reserved

This field is reserved for future expansion.

Availability
Declared In
Power.h

PowerSourceParamBlockPtr

typedef PowerSourceParamBlock* PowerSourceParamBlockPtr;

Availability
Declared In
Power.h

PowerSummary

struct PowerSummary {
   UInt32 version;
   OptionBits flags;
   UInt32 sleepPowerAvailable;
   UInt32 sleepPowerNeeded;
   UInt32 minimumWakeTime;
   ItemCount deviceCount;
   DevicePowerInfo devices[1];
};
typedef struct PowerSummary PowerSummary;

Fields
version

An unsigned, 32-bit integer indicating the version of this record.

flags

A value of type OptionBits representing power summary information.

sleepPowerAvailable

An unsigned, 32-bit integer indicating the milliwatts available during sleep.

sleepPowerNeeded

An unsigned, 32-bit integer indicating the milliwatts needed during sleep.

minimumWakeTime

An unsigned, 32-bit integer indicating the minimum number of seconds required before sleeping again.

deviceCount

The number of device power info records.

devices

An array of device power info records.

Availability
Declared In
Power.h

SleepQRec

struct SleepQRec {
   SleepQRecPtr sleepQLink;
   short sleepQType;
   SleepQUPP sleepQProc;
   short sleepQFlags;
};
typedef struct SleepQRec SleepQRec;
typedef SleepQRec * SleepQRecPtr;

Fields
sleepQLink

A pointer to the next element in the queue. This pointer is maintained by the Power Manager; your application should not modify this field.

sleepQType

A short indicating the type of the queue, which must be the constant sleepQType (16).

sleepQProc

A pointer to the routine that you provide.

sleepQFlags

A short containing flags which is reserved for use by Apple Computer, Inc.

Availability
Declared In
Power.h

SleepQRecPtr

typedef SleepQRec *SleepQRecPtr;

Availability
Declared In
Power.h

SleepQUPP

typedef SleepQProcPtr SleepQUPP;

Availability
Declared In
Power.h

SoundMixerByte

typedef SInt8 SoundMixerByte;

Availability
Declared In
Power.h

StartupTime

struct StartupTime {
   unsigned long startTime;
   Boolean startEnabled;
   SInt8 filler;
};
typedef struct StartupTime StartupTime;

Availability
Declared In
Power.h

WakeupTime

struct WakeupTime {
   unsigned long wakeTime;
   Boolean wakeEnabled;
   SInt8 filler;
};
typedef struct WakeupTime WakeupTime;

Availability
Declared In
Power.h

Constants

Apple Event Types and Errors

enum {
   kAEMacPowerMgtEvt = 'pmgt',
   kAEMacToWake = 'wake',
   kAEMacLowPowerSaveData = 'pmsd',
   kAEMacEmergencySleep = 'emsl',
   kAEMacEmergencyShutdown = 'emsd'
};

BatteryByte Bits

enum {
   chargerConnBit = 0,
   hiChargeBit = 1,
   chargeOverFlowBit = 2,
   batteryDeadBit = 3,
   batteryLowBit = 4,
   connChangedBit = 5
};

Constants
chargerConnBit

When this bit is set, it indicates the charger is connected.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

hiChargeBit

When this bit is set, it indicates charging at fastest rate.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

chargeOverFlowBit

When this bit is set, it indicates the hicharge counter has overflowed.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

batteryDeadBit

Always 0.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

batteryLowBit

When this bit is set, it indicates the battery is low.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

connChangedBit

When this bit is set, it indicates the charger connection has changed.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

BatteryByte Masks

enum {
   chargerConnMask = 0x01,
   hiChargeMask = 0x02,
   chargeOverFlowMask = 0x04,
   batteryDeadMask = 0x08,
   batteryLowMask = 0x10,
   connChangedMask = 0x20
};

Constants
chargerConnMask

The charger is connected.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

hiChargeMask

Charging at fastest rate.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

chargeOverFlowMask

The hicharge counter has overflowed.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

batteryDeadMask

The battery is dead.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

batteryLowMask

The battery is low.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

connChangedMask

The connection has changed.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

BatteryInfo Bits

enum {
   batteryInstalled = 7,
   batteryCharging = 6,
   chargerConnected = 5,
   upsConnected = 4,
   upsIsPowerSource = 3
};

Constants
batteryInstalled

When this bit is set, it indicates the battery is currently connected.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

batteryCharging

When this bit is set, it indicates the battery is being charged.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

chargerConnected

When this bit is set, it indicates the charger is connected.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

upsConnected

When this bit is set, it indicates there is an uninterruptable power source (UPS) connected.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

upsIsPowerSource

When this bit is set, it indicates the UPS is the source of power.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

Client Notification Bits

enum {
   pmSleepTimeoutChanged = 0,
   pmSleepEnableChanged = 1,
   pmHardDiskTimeoutChanged = 2,
   pmHardDiskSpindownChanged = 3,
   pmDimmingTimeoutChanged = 4,
   pmDimmingEnableChanged = 5,
   pmDiskModeAddressChanged = 6,
   pmProcessorCyclingChanged = 7,
   pmProcessorSpeedChanged = 8,
   pmWakeupTimerChanged = 9,
   pmStartupTimerChanged = 10,
   pmHardDiskPowerRemovedbyUser = 11,
   pmChargeStatusChanged = 12,
   pmPowerLevelChanged = 13,
   pmWakeOnNetActivityChanged = 14
};

Client Notification Masks

enum {
   pmSleepTimeoutChangedMask = (1 << pmSleepTimeoutChanged),
   pmSleepEnableChangedMask = (1 << pmSleepEnableChanged),
   pmHardDiskTimeoutChangedMask = (1 << pmHardDiskTimeoutChanged),
   pmHardDiskSpindownChangedMask = (1 << pmHardDiskSpindownChanged),
   pmDimmingTimeoutChangedMask = (1 << pmDimmingTimeoutChanged),
   pmDimmingEnableChangedMask = (1 << pmDimmingEnableChanged),
   pmDiskModeAddressChangedMask = (1 << pmDiskModeAddressChanged),
   pmProcessorCyclingChangedMask = (1 << pmProcessorCyclingChanged),
   pmProcessorSpeedChangedMask = (1 << pmProcessorSpeedChanged),
   pmWakeupTimerChangedMask = (1 << pmWakeupTimerChanged),
   pmStartupTimerChangedMask = (1 << pmStartupTimerChanged),
   pmHardDiskPowerRemovedbyUserMask = (1 << pmHardDiskPowerRemovedbyUser),
   pmChargeStatusChangedMask = (1 << pmChargeStatusChanged),
   pmPowerLevelChangedMask = (1 << pmPowerLevelChanged),
   pmWakeOnNetActivityChangedMask = (1 << pmWakeOnNetActivityChanged)
};

DevicePowerInfo Flags

enum {
   kDevicePCIPowerOffAllowed = (1L << 0),
   kDeviceSupportsPMIS = (1L << 1),
   kDeviceCanAssertPMEDuringSleep = (1L << 2),
   kDeviceUsesCommonLogicPower = (1L << 3),
   kDeviceDriverPresent = (1L << 4),
   kDeviceDriverSupportsPowerMgt = (1L << 5)
};

Constants
kDevicePCIPowerOffAllowed

If the bit specified by this mask is set, PCI power off is allowed for this device.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

kDeviceSupportsPMIS

If the bit specified by this mask is set, the device supports Power Manager Interface Specifications.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

kDeviceCanAssertPMEDuringSleep

If the bit specified by this mask is set, the device can assert the PME# line during sleep.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

kDeviceUsesCommonLogicPower

If the bit specified by this mask is set, the device uses common-logic power.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

kDeviceDriverPresent

If the bit specified by this mask is set, the device driver is present.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

kDeviceDriverSupportsPowerMgt

If the bit specified by this mask is set, the device driver installed a power handler.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

HDPwrQType Constants

enum {
   HDPwrQType = 0x4844,
   PMgrStateQType = 0x504D
};

Constants
HDPwrQType

The hard disk spindown queue element type.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

PMgrStateQType

The Power Manager state queue element type.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

HDQueueElement Flags

enum {
   kHDQueuePostBit = 0,
   kHDQueuePostMask = (1 << kHDQueuePostBit)
};

Constants
kHDQueuePostBit

When this bit is set, it indicates the routine will be called on the second pass.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

kHDQueuePostMask

If the bit specified by this mask is set, it indicates the routine will be called on the second pass.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

kMediaPowerCSCode Constants

enum {
   kMediaPowerCSCode = 70
};

kUseDefaultMinimumWakeTime Constants

enum {
   kUseDefaultMinimumWakeTime = 0,
   kPowerSummaryVersion = 1,
   kDevicePowerInfoVersion = 1
};

Constants
kUseDefaultMinimumWakeTime

Defaults to 5 minutes.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

kPowerSummaryVersion

Version of PowerSummary structure.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

kDevicePowerInfoVersion

Version of DevicePowerInfo structure

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

Modem State Bits

enum {
   hasInternalModem = 0,
   intModemRingDetect = 1,
   intModemOffHook = 2,
   intModemRingWakeEnb = 3,
   extModemSelected = 4,
   modemSetBit = 15
};

Constants
hasInternalModem

When this bit is set, it indicates an internal modem is installed.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

intModemRingDetect

When this bit is set, it indicates the internal modem has detected a ring.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

intModemOffHook

When this bit is set, it indicates the internal modem is off the hook.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

intModemRingWakeEnb

When this bit is set, it indicates wakeup on ring is enabled.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

extModemSelected

When this bit is set, it indicates external modem is selected.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

modemSetBit

When this bit is set, it indicates set bit. If 0, clear bit.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

Discussion

These bits are in the bit field returned by the GetIntModemInfo function and set by the SetIntModemState function.

ModemByte Bits

enum {
   modemOnBit = 0,
   ringWakeUpBit = 2,
   modemInstalledBit = 3,
   ringDetectBit = 4,
   modemOnHookBit = 5
};

Constants
modemOnBit

When this bit is set, it indicates the modem is on.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

ringWakeUpBit

When this bit is set, it indicates ring wakeup is enabled.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

modemInstalledBit

When this bit is set, it indicates an internal modem is installed.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

ringDetectBit

When this bit is set, it indicates an incoming call is detected.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

modemOnHookBit

When this bit is set, it indicates the modem is off the hook.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h

ModemByte Masks

enum {
   modemOnMask = 0x01,
   ringWakeUpMask = 0x04,
   modemInstalledMask = 0x08,
   ringDetectMask = 0x10,
   modemOnHookMask = 0x20
};

Constants
modemOnMask

The modem is on.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in Power.h