1# Copyright (c) 2021-2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//base/usb/usb_manager/usbmgr.gni") 15 16config("usbsrv_private_config") { 17 include_dirs = [ 18 "//third_party/jsoncpp/include/json", 19 "${usb_manager_path}/interfaces/innerkits/native/include", 20 ] 21} 22 23config("usbsrv_public_config") { 24 include_dirs = [ 25 "native/include", 26 "${usb_manager_path}/services/zidl/include", 27 "${usb_manager_path}/utils/native/include", 28 "//drivers/peripheral/usb/hdi_service/include", 29 ] 30} 31 32ohos_shared_library("usbservice") { 33 install_enable = true 34 sources = [ 35 "${usb_manager_path}/services/zidl/src/usb_srv_stub.cpp", 36 "native/src/usb_descriptor_parser.cpp", 37 "native/src/usb_device_manager.cpp", 38 "native/src/usb_host_manager.cpp", 39 "native/src/usb_port_manager.cpp", 40 "native/src/usb_right_manager.cpp", 41 "native/src/usb_serial_reader.cpp", 42 "native/src/usb_server_event_handler.cpp", 43 "native/src/usb_service.cpp", 44 "native/src/usb_service_subscriber.cpp", 45 "native/src/usbd_bulkcallback_impl.cpp", 46 ] 47 48 configs = [ 49 "${utils_path}:utils_config", 50 ":usbsrv_private_config", 51 ] 52 53 public_configs = [ ":usbsrv_public_config" ] 54 55 deps = [ "//third_party/jsoncpp:jsoncpp" ] 56 57 external_deps = [ 58 "ability_base:want", 59 "ability_runtime:ability_manager", 60 "bundle_framework:appexecfwk_base", 61 "bundle_framework:appexecfwk_core", 62 "c_utils:utils", 63 "common_event_service:cesfwk_innerkits", 64 "drivers_interface_usb:libusb_proxy_1.0", 65 "eventhandler:libeventhandler", 66 "hisysevent_native:libhisysevent", 67 "hiviewdfx_hilog_native:libhilog", 68 "ipc:ipc_core", 69 "safwk:system_ability_fwk", 70 "samgr:samgr_proxy", 71 ] 72 73 part_name = "usb_manager" 74} 75 76ohos_prebuilt_etc("usb_service.init") { 77 source = "usb_service.cfg" 78 relative_install_dir = "init" 79 part_name = "usb_manager" 80} 81