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 16 /** 17 * @file iam_executor_idriver_manager.h 18 * 19 * @brief Driver manager of executor. 20 * @since 3.1 21 * @version 3.2 22 */ 23 24 #ifndef IAM_EXECUTOR_IDRIVER_MANAGER_H 25 #define IAM_EXECUTOR_IDRIVER_MANAGER_H 26 27 #include <cstdint> 28 #include <map> 29 30 #include "iam_executor_iauth_driver_hdi.h" 31 32 namespace OHOS { 33 namespace UserIam { 34 namespace UserAuth { 35 /** 36 * @brief Hardware device interface config. 37 */ 38 struct HdiConfig { 39 /** Driver ID. */ 40 uint16_t id; // non-zero 41 /** The current driver. */ 42 std::shared_ptr<IAuthDriverHdi> driver; 43 }; 44 45 class IDriverManager { 46 public: 47 /** 48 * @brief Default constructor. 49 */ 50 IDriverManager() = default; 51 52 /** 53 * @brief Deconstructor. 54 */ 55 virtual ~IDriverManager() = default; 56 57 /** 58 * @brief Start. 59 * 60 * @param hdiName2Config Hardware device interface name and config. 61 * @return Return the result success or not. 62 */ 63 static int32_t Start(const std::map<std::string, HdiConfig> &hdiName2Config); 64 }; 65 } // namespace UserAuth 66 } // namespace UserIam 67 } // namespace OHOS 68 69 #endif // IAM_EXECUTOR_IDRIVER_MANAGER_H