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 BT_STATISTIC_H 17 #define BT_STATISTIC_H 18 19 #include "stdint.h" 20 #include "cJSON.h" 21 #include <map> 22 #include <vector> 23 24 namespace Communication { 25 namespace Softbus { 26 class BtStatistic { 27 public: 28 BtStatistic(); 29 ~BtStatistic() = default; 30 31 static BtStatistic& GetInstance(); 32 int32_t GetBtStatisticInfo(cJSON *json); 33 34 private: 35 void GetGattClientDeviceInfo(cJSON *json); 36 void GetGattServerDeviceInfo(cJSON *json); 37 void GetBleAdvertiserDeviceInfo(cJSON *json); 38 void GetBleCentralDeviceInfo(cJSON *json); 39 void GetBleGattDeviceInfo(cJSON *json); 40 void GetA2dpSrcDeviceInfo(cJSON *json); 41 void GetA2dpSinkDeviceInfo(cJSON *json); 42 void GetAvrCTDeviceInfo(cJSON *json); 43 void GetAvrTGDeviceInfo(cJSON *json); 44 void GetHfpAGDeviceInfo(cJSON *json); 45 void GetHfpHFDeviceInfo(cJSON *json); 46 void GetMapMseDeviceInfo(cJSON *json); 47 void GetPbapPseDeviceInfo(cJSON *json); 48 void GetHidHostDeviceInfo(cJSON *json); 49 void GetOppDeviceInfo(cJSON *json); 50 void GetPanDeviceInfo(cJSON *json); 51 52 void GetGattDeviceInfo(cJSON *json, uint32_t gattId); 53 54 typedef void (BtStatistic::*GetProfileDeviceInfo)(cJSON *); 55 std::map<uint32_t, GetProfileDeviceInfo> getProfileDeviceInfoMap_; 56 std::vector<int32_t> connectState_; 57 }; 58 } // namespace SoftBus 59 } // namespace Communication 60 61 #endif // BT_STATISTIC_H