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