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 #ifndef OHOS_DM_DFX_CONSTANTS_H 16 #define OHOS_DM_DFX_CONSTANTS_H 17 18 #include "dm_device_info.h" 19 20 #include <string> 21 #include <unordered_map> 22 23 namespace OHOS { 24 namespace DistributedHardware { 25 // HisysEvent Type 26 const int DM_HISYEVENT_FAULT = 1; 27 const int DM_HISYEVENT_STATISTIC = 2; 28 const int DM_HISYEVENT_SECURITY = 3; 29 const int DM_HISYEVENT_BEHAVIOR = 4; 30 31 // HiDumper Flag 32 enum class HidumperFlag { 33 HIDUMPER_UNKNOWN = 0, 34 HIDUMPER_GET_HELP, 35 HIDUMPER_GET_TRUSTED_LIST, 36 HIDUMPER_GET_DEVICE_STATE, 37 }; 38 39 // HiDumper info 40 constexpr const char* ARGS_HELP_INFO = "-help"; 41 constexpr const char* HIDUMPER_GET_TRUSTED_LIST_INFO = "-getTrustlist"; 42 43 // HiDumper command 44 const std::unordered_map<std::string, HidumperFlag> MAP_ARGS = { 45 { std::string(ARGS_HELP_INFO), HidumperFlag::HIDUMPER_GET_HELP }, 46 { std::string(HIDUMPER_GET_TRUSTED_LIST_INFO), HidumperFlag::HIDUMPER_GET_TRUSTED_LIST }, 47 }; 48 49 // HiDumper device type 50 typedef struct DumperInfo { 51 DmDeviceType deviceTypeId; 52 std::string deviceTypeInfo; 53 } DumperInfo; 54 } // namespace DistributedHardware 55 } // namespace OHOS 56 #endif // OHOS_DM_DFX_CONSTANTS_H 57