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 #ifndef BT_BATTERY_INFO_PARCEL_H 16 #define BT_BATTERY_INFO_PARCEL_H 17 18 #include <string> 19 20 namespace OHOS { 21 namespace bluetooth { 22 23 /** 24 * @brief remote device battery information. 25 * 26 * @since 12 27 */ 28 class BatteryInfo { 29 public: BatteryInfo()30 BatteryInfo() {} ~BatteryInfo()31 ~BatteryInfo() {} 32 ResetInfo()33 void ResetInfo() 34 { 35 batteryLevel_ = -1; 36 leftEarBatteryLevel_ = -1; 37 leftEarChargeState_ = 0; 38 rightEarBatteryLevel_ = -1; 39 rightEarChargeState_ = 0; 40 boxBatteryLevel_ = -1; 41 boxChargeState_ = 0; 42 } 43 44 public: 45 int32_t batteryLevel_ = -1; 46 int32_t leftEarBatteryLevel_ = -1; 47 int32_t leftEarChargeState_ = 0; 48 int32_t rightEarBatteryLevel_ = -1; 49 int32_t rightEarChargeState_ = 0; 50 int32_t boxBatteryLevel_ = -1; 51 int32_t boxChargeState_ = 0; 52 }; 53 54 class BatteryDetailInfo { 55 public: BatteryDetailInfo()56 BatteryDetailInfo() {} ~BatteryDetailInfo()57 ~BatteryDetailInfo() {} 58 ResetInfo()59 void ResetInfo() 60 { 61 batteryObtainType_ = 0; 62 batteryInfo_.ResetInfo(); 63 } 64 public: 65 uint8_t batteryObtainType_ = 0; // 0 not exist,1 AT,2 ECHO,3 ALL 66 BatteryInfo batteryInfo_; 67 }; 68 } 69 } 70 71 #endif //BT_BATTERY_INFO_PARCEL_H