1# Copyright (c) 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. 13import("//build/ohos.gni") 14 15declare_args() { 16 drivers_peripheral_bluetooth_mac_update = false 17} 18 19root_path = "//drivers/peripheral/bluetooth/hci/hdi_service" 20 21ohos_shared_library("libhci_interface_service_1.0") { 22 include_dirs = [ 23 "$root_path", 24 "$root_path/implement", 25 ] 26 27 if (drivers_peripheral_bluetooth_mac_update) { 28 defines = [ "BT_MAC_UPDATE" ] 29 } 30 31 sources = [ 32 "$root_path/hci_interface_impl.cpp", 33 "$root_path/implement/bluetooth_address.cpp", 34 "$root_path/implement/h4_protocol.cpp", 35 "$root_path/implement/hci_protocol.cpp", 36 "$root_path/implement/hci_watcher.cpp", 37 "$root_path/implement/mct_protocol.cpp", 38 "$root_path/implement/vendor_interface.cpp", 39 ] 40 41 if (is_standard_system) { 42 external_deps = [ 43 "c_utils:utils", 44 "drivers_interface_bluetooth:bluetooth_hci_idl_headers", 45 "hdf_core:libhdf_host", 46 "hdf_core:libhdf_utils", 47 "hilog:libhilog", 48 "ipc:ipc_core", 49 ] 50 } else { 51 external_deps = [ "hilog:libhilog" ] 52 } 53 54 install_images = [ chipset_base_dir ] 55 subsystem_name = "hdf" 56 part_name = "drivers_peripheral_bluetooth" 57} 58 59ohos_shared_library("libbluetooth_hci_hdi_driver") { 60 include_dirs = [ "$root_path" ] 61 62 sources = [ "$root_path/hci_interface_driver.cpp" ] 63 64 if (is_standard_system) { 65 external_deps = [ 66 "c_utils:utils", 67 "hdf_core:libhdf_host", 68 "hdf_core:libhdf_ipc_adapter", 69 "hdf_core:libhdf_utils", 70 "hdf_core:libhdi", 71 "hilog:libhilog", 72 "ipc:ipc_single", 73 ] 74 } else { 75 external_deps = [ 76 "hilog:libhilog", 77 "ipc:ipc_single", 78 ] 79 } 80 81 external_deps += [ "drivers_interface_bluetooth:libbluetooth_hci_stub_1.0" ] 82 83 shlib_type = "hdi" 84 install_images = [ chipset_base_dir ] 85 subsystem_name = "hdf" 86 part_name = "drivers_peripheral_bluetooth" 87} 88 89group("hdi_bluetooth_hci_service") { 90 deps = [ 91 ":libbluetooth_hci_hdi_driver", 92 ":libhci_interface_service_1.0", 93 ] 94} 95