1 /* 2 * Copyright (C) 2024 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 #ifndef BLUETOOTH_BATTERY_INFO_H 17 #define BLUETOOTH_BATTERY_INFO_H 18 19 #include "bluetooth_def.h" 20 #include "bluetooth_types.h" 21 22 namespace OHOS { 23 namespace Bluetooth { 24 /** 25 * @brief bluetooth battery information define. 26 * 27 * @since 12 28 */ 29 30 /** 31 * @brief Enum for the charge state. 32 * 33 * @since 12 34 */ 35 36 enum class DeviceChargeState : int32_t { 37 // not support super charge, and not charged 38 DEVICE_NORMAL_CHARGE_NOT_CHARGED = 0, 39 40 // not support super charge, and in charged 41 DEVICE_NORMAL_CHARGE_IN_CHARGING = 1, 42 43 // support super charge, and not charged 44 DEVICE_SUPER_CHARGE_NOT_CHARGED = 2, 45 46 // support super charge, and in charged 47 DEVICE_SUPER_CHARGE_IN_CHARGING = 3, 48 }; 49 50 struct DeviceBatteryInfo { 51 // The device 52 std::string deviceId_; 53 54 // Electricity value of the general device. -1 means no power infomation. 55 int32_t batteryLevel_; 56 57 // Electricity value of the left ear. -1 means no power infomation. 58 int32_t leftEarBatteryLevel_; 59 60 // The charge state of the left ear. 61 DeviceChargeState leftEarChargeState_; 62 63 // Electricity value of the right ear. -1 means no power infomation. 64 int32_t rightEarBatteryLevel_; 65 66 // The charge state of the right ear. 67 DeviceChargeState rightEarChargeState_; 68 69 // Electricity value of the box. -1 means no power infomation. 70 int32_t boxBatteryLevel_; 71 72 // The charge state of the box 73 DeviceChargeState boxChargeState_; 74 }; 75 } // namespace Bluetooth 76 } // namespace OHOS 77 #endif