/* * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @addtogroup battery * @{ * * @brief Provides APIs for obtaining and subscribing to battery information. * * The battery module provides APIs for the battery service to obtain and subscribe to battery information. * After obtaining an object or proxy of this module, the battery service can invoke related APIs to obtain and * subscribe to battery information. * * @since 3.1 * @version 1.0 */ /** * @file IBatteryCallback.idl * * @brief Provides the callback of battery information. * * The battery module provides a callback for the battery service to subscribe to battery information changes. * * @since 3.1 * @version 1.0 */ package ohos.hdi.battery.v1_2; import ohos.hdi.battery.v1_2.Types; /** * @brief Represents the callback of battery information. * * After creating a callback object, the battery service can call {@link IBatteryInterface} to register a callback to * subscribe to battery information changes. * * @since 3.1 */ [callback] interface IBatteryCallback { /** * @brief Callback of battery information changes. * * * * @param event Battery information, such as the battery level, voltage, and health status. * @see BatteryInfo * * @since 3.1 */ Update([in] struct BatteryInfo event); } /** @} */