1 /* 2 * Copyright (c) 2023 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 IDRIVER_EXTENSION_MANAGER_H 17 #define IDRIVER_EXTENSION_MANAGER_H 18 #include <vector> 19 20 #include "driver_ext_mgr_types.h" 21 #include "edm_errors.h" 22 #include "ext_object.h" 23 #include "hdf_ext_devmgr_interface_code.h" 24 #include "idriver_ext_mgr_callback.h" 25 #include "iremote_broker.h" 26 27 namespace OHOS { 28 namespace ExternalDeviceManager { 29 class IDriverExtMgr : public IRemoteBroker { 30 public: 31 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.driver.IDriverExtMgr"); 32 ~IDriverExtMgr() = default; 33 34 virtual UsbErrCode QueryDevice(uint32_t busType, std::vector<std::shared_ptr<DeviceData>> &devices) = 0; 35 virtual UsbErrCode BindDevice(uint64_t deviceId, const sptr<IDriverExtMgrCallback> &connectCallback) = 0; 36 virtual UsbErrCode UnBindDevice(uint64_t deviceId) = 0; 37 virtual UsbErrCode QueryDeviceInfo(std::vector<std::shared_ptr<DeviceInfoData>> &deviceInfos, 38 bool isByDeviceId = false, const uint64_t deviceId = 0) = 0; 39 virtual UsbErrCode QueryDriverInfo(std::vector<std::shared_ptr<DriverInfoData>> &driverInfos, 40 bool isByDriverUid = false, const std::string &driverUid = "") = 0; 41 }; 42 } // namespace ExternalDeviceManager 43 } // namespace OHOS 44 #endif // IDRIVER_EXTENSION_MANAGER_H