1 /* 2 * Copyright (c) 2021 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 OHOS_DISTRIBUTED_HARDWARE_IMPL_UTILS_H 17 #define OHOS_DISTRIBUTED_HARDWARE_IMPL_UTILS_H 18 19 #include <unordered_map> 20 21 #include "device_type.h" 22 23 namespace OHOS { 24 namespace DistributedHardware { 25 enum class TaskType : int32_t { 26 UNKNOWN = 0, 27 ENABLE = 1, 28 DISABLE = 2, 29 ON_LINE = 3, 30 OFF_LINE = 4 31 }; 32 33 enum class TaskStep : int32_t { 34 DO_ENABLE = 1, 35 DO_DISABLE = 2, 36 SYNC_ONLINE_INFO = 3, 37 REGISTER_ONLINE_DISTRIBUTED_HARDWARE = 4, 38 UNREGISTER_OFFLINE_DISTRIBUTED_HARDWARE = 5, 39 CLEAR_OFFLINE_INFO = 6, 40 WAIT_UNREGISTGER_COMPLETE = 7 41 }; 42 43 enum class TaskState : int32_t { 44 INIT = 0, 45 RUNNING = 1, 46 SUCCESS = 2, 47 FAIL = 3 48 }; 49 50 struct CompVersion { 51 std::string name; 52 DHType dhType; 53 std::string handlerVersion; 54 std::string sourceVersion; 55 std::string sinkVersion; 56 }; 57 58 struct DHVersion { 59 std::string uuid; 60 std::string dhVersion; 61 std::unordered_map<DHType, CompVersion> compVersions; 62 }; 63 } 64 } 65 #endif