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 battery 18 * @{ 19 * 20 * @brief Provides APIs for obtaining and subscribing to battery information. 21 * 22 * The battery module provides APIs for the battery service to obtain and subscribe to battery information. 23 * After obtaining an object or proxy of this module, the battery service can invoke related APIs to obtain and 24 * subscribe to battery information. 25 * 26 * @since 3.1 27 * @version 1.0 28 */ 29 30/** 31 * @file IBatteryCallback.idl 32 * 33 * @brief Provides the callback of battery information. 34 * 35 * The battery module provides a callback for the battery service to subscribe to battery information changes. 36 * 37 * @since 3.1 38 * @version 1.0 39 */ 40 41package ohos.hdi.battery.v1_0; 42 43import ohos.hdi.battery.v1_0.Types; 44 45/** 46 * @brief Represents the callback of battery information. 47 * 48 * After creating a callback object, the battery service can call {@link IBatteryInterface} to register a callback to 49 * subscribe to battery information changes. 50 * 51 * @since 3.1 52 */ 53[callback] interface IBatteryCallback { 54 55 /** 56 * @brief Callback of battery information changes. 57 * 58 * 59 * 60 * @param event Battery information, such as the battery level, voltage, and health status. 61 * @see BatteryInfo 62 * 63 * @since 3.1 64 */ 65 Update([in] struct BatteryInfo event); 66} 67/** @} */ 68