1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @addtogroup power 18 * @{ 19 * 20 * @brief Provides APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status, 21 * and managing running locks. 22 * 23 * After obtaining an object or proxy of this module, the power service can invoke related APIs to perform 24 * hibernation/wakeup operations, subscribe to the hibernation/wakeup status, and manage running locks. 25 * 26 * @since 3.1 27 * @version 1.0 28 */ 29 30/** 31 * @file PowerTypes.idl 32 * 33 * @brief Enumerates data types related to power management. 34 * 35 * Such data types include command parameters, callback parameters, and system status. 36 * 37 * @since 3.1 38 * @version 1.0 39 */ 40 41package ohos.hdi.power.v1_0; 42 43/** 44 * @brief Enumerates command parameters for power management. 45 * 46 * @since 3.1 47 */ 48enum PowerHdfCmd { 49 /** Command parameter for registering a callback of the power status */ 50 CMD_REGISTER_CALLBCK = 0, 51 /** Command parameter for hibernating the device */ 52 CMD_START_SUSPEND, 53 /** Command parameter for waking up the device */ 54 CMD_STOP_SUSPEND, 55 /** Command parameter for forcibly hibernating the device */ 56 CMD_FORCE_SUSPEND, 57 /** Command parameter for opening the running lock */ 58 CMD_SUSPEND_BLOCK, 59 /** Command parameter for closing the running lock*/ 60 CMD_SUSPEND_UNBLOCK, 61 /** Command parameter for dumping */ 62 CMD_DUMP, 63}; 64 65/** 66 * @brief Enumerates command parameters for the power status callback. 67 * 68 * @since 3.1 69 */ 70enum PowerHdfCallbackCmd { 71 /** Command parameter for the hibernation callback */ 72 CMD_ON_SUSPEND = 0, 73 /** Command parameter for the wakeup callback */ 74 CMD_ON_WAKEUP, 75}; 76 77/** 78 * @brief Enumerates the power status. 79 * 80 * @since 3.1 81 */ 82enum PowerHdfState { 83 /** Awake state */ 84 AWAKE = 0, 85 /** Inactive state */ 86 INACTIVE, 87 /** Sleep state */ 88 SLEEP, 89}; 90/** @} */ 91