[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 1

pm_control_state Subroutine

Purpose

Controls and queries the Power Management states

Library

Standard C Library (libc.a)

Syntax

#include <sys/pm.h>
int pm_control_state(control, PMS)
int control;
struct pm_state *PMS;

Description

The pm_control_state subroutine controls and queries the Power Management (PM) states.

Parameters

control Specifies one of the following Power Management control commands:
PM_CTRL_QUERY_STATE
Queries the current system PM state.
PM_CTRL_REQUEST_STATE
Requests to move to system full-on, system PM enable, system standby or system suspend state.
PM_CTRL_START_STATE
Forces to move to system full-on, system PM enable, system standby or system suspend state.
PM_CTRL_QUERY_REQUEST
Queries the result of the requested action.
PMS Specifies a pointer to the following pm_state structure.
struct pm_state {
   int   state;
   int   id;
   int   event;
   int   devno;
}

The contents of the structure depends on the PM control command.

  • When the control is PM_CTRL_QUERY_STATE, state is returned.
  • When the control is PM_CTRL_REQUEST_STATE, input is state and output is id.
  • When the control is PM_CTRL_START_STATE, input is state and output is event and devno (if event is PM_EVENT_ERROR).
  • When the control is PM_CTRL_QUERY_REQUEST, input is id and output is event and devno (if event is PM_EVENT_ERROR).

Event value is one of the following,

PM_EVENT_LID_OPEN
LID open
PM_EVENT_RTC
specified time to resume
PM_EVENT_RINGING
ringing
PM_EVENT_MOUSE
mouse event
PM_EVENT_KEYBOARD
keyboard event
PM_EVENT_EXTRA_INPUTDD
extra input DD
PM_EVENT_EXTRA_BUTTON
extra button
PM_EVENT_ERROR
action failed

Return Values

PM_SUCCESS Indicates successful completion.
PM_ERROR Indicates an error condition. The variable errno is set to identify the error.

Error Codes

EINVAL The argument or command is not valid.

Implementation Specifics

The pm_control_state subroutine is part of the Base Operating System (BOS) Runtime.

Related Information

The pm_control_parameter subroutine, pm_event_query subroutine, pm_battery_control subroutine.


[ Previous | Next | Contents | Glossary | Home | Search ]