Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Devices /
Chapter 6 - Power Manager / Power Manager Reference
Power Manager Routines / Reading the Status of the Internal Modem


ModemStatus

You can use the ModemStatus function to get information about the state of the internal modem.

FUNCTION ModemStatus (VAR Status: Byte): OSErr;
Status
On exit, a byte value whose bits encode information about the current state of the internal modem. See the description below for the meaning of each bit.
DESCRIPTION
The ModemStatus function returns information about the internal modem in a portable Macintosh computer. Bits 0 and 2 through 5 of the Status parameter encode information about the state of the internal modem. (Currently, bits 6 and 7 are reserved; in addition, bit 1 is reserved and is always set.) The Power Manager recognizes the following constants for specifying bits in the Status parameter.

CONST
   modemOnBit           = 0;  {1 if modem is on}
   ringWakeUpBit        = 2;  {1 if ring wakeup is enabled}
   modemInstalledBit    = 3;  {1 if internal modem is installed}
   ringDetectBit        = 4;  {1 if incoming call is detected}
   modemOnHookBit       = 5;  {1 if modem is off hook}
Constant descriptions

modemOnBit
The modem's power is on or off. If this bit is set, the modem is switched on. You can use the serial power control functions to control power to the modem. See "Switching Serial Power On and Off," beginning on page 6-25, for information about these functions.
ringWakeUpBit
The state of the ring-wakeup feature. If this bit is set, the ring-wakeup feature is enabled.
modemInstalledBit
The modem is or is not installed. If this bit is set, an internal modem is installed.
ringDetectBit
The ring-detect state. If this bit is set, the modem has detected an incoming call.
modemOnHookBit
The modem is on or off hook. If this bit is set, the modem is off hook. The modem indicates that it is off hook whenever it is busy sending or receiving data or processing commands. The modem cannot receive an incoming call when it is off hook.
The Power Manager also defines these bit masks:

CONST
   modemOnMask          = $1;    {modem on}
   ringWakeUpMask       = $4;    {ring wakeup enabled}
   modemInstalledMask   = $8;    {internal modem installed}
   ringDetectMask       = $10;   {incoming call detected}
   modemOnHookMask      = $20;   {modem off hook}
The user can use the Portable or PowerBook control panel to enable or disable the ring-wakeup feature. When the ring-wakeup feature is enabled and the computer is in the sleep state, the Power Manager returns the computer to the operating state when the modem receives an incoming call.

RESULT CODES
noErr0No error

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996