Queries and controls the battery status.
PM (Power Management) Library (libpm.a)
int pmlib_request_battery (cmd, pmb); int cmd; pmlib_battery_t *pmb;
|cmd||Determines the action to be taken by the pmlib_request_battery subroutine and is one of the following values:|
|pmb||Points to the following pmlib_battery_t structure:|
When cmd is PMLIB_QUERY_BATTERY, the returned pmb.attribute is bit-wise OR of following values:
|PMLIB_BATTERY_SUPPORTED||Battery is supported.|
|PMLIB_BATTERY_NICD||Battery is NiCd|
|PMLIB_BATTERY_CHARGING||Battery is being charged.|
|PMLIB_BATTERY_DISCHARGING||Battery is being discharged.|
|PMLIB_BATTERY_AC||AC adapter is in use.|
|PMLIB_BATTERY_DC||Battery is in use.|
|PMLIB_BATTERY_REFRESH_REQ||Need to refresh battery.|
The pmlib_request_battery subroutine queries the battery information or requests to discharge the battery. The pmlib_request_ subroutine can be called by any user.
Upon successful completion, PMLIB_SUCCESS is returned. If the pmlib_request_state subroutine fails, PMLIB_ERROR is returned and errno variable is set to an error code.
|ESRCH||PM daemon is not running.|
The pmlib_request_battery subroutine is part of the Base Operation System (BOS) Runtime.
The pmlib_get_event_notice subroutine, pmlib_request_state subroutine, pmlib_request_parameter subroutine, pmlib_register_application subroutine.