• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("//build/ohos.gni")
15import("//build/ohos_var.gni")
16
17SUBSYSTEM_DIR = "//foundation/communication"
18
19FwkCAdapterSrc = [
20  "c_adapter/ohos_bt_adapter_utils.cpp",
21  "c_adapter/ohos_bt_gap.cpp",
22  "c_adapter/ohos_bt_gatt.cpp",
23  "c_adapter/ohos_bt_gatt_client.cpp",
24  "c_adapter/ohos_bt_gatt_server.cpp",
25  "c_adapter/ohos_bt_spp.cpp",
26  "c_adapter/ohos_bt_socket.cpp",
27]
28
29FwkSrc = [
30  "src/bluetooth_a2dp_snk.cpp",
31  "src/bluetooth_a2dp_src.cpp",
32  "src/bluetooth_avrcp_ct.cpp",
33  "src/bluetooth_avrcp_tg.cpp",
34  "src/bluetooth_ble_advertiser.cpp",
35  "src/bluetooth_ble_central_manager.cpp",
36  "src/bluetooth_device_class.cpp",
37  "src/bluetooth_gatt_characteristic.cpp",
38  "src/bluetooth_gatt_client.cpp",
39  "src/bluetooth_gatt_descriptor.cpp",
40  "src/bluetooth_gatt_manager.cpp",
41  "src/bluetooth_gatt_server.cpp",
42  "src/bluetooth_gatt_service.cpp",
43  "src/bluetooth_hfp_ag.cpp",
44  "src/bluetooth_hfp_hf.cpp",
45  "src/bluetooth_hid_host.cpp",
46  "src/bluetooth_host.cpp",
47  "src/bluetooth_map_mce.cpp",
48  "src/bluetooth_map_mse.cpp",
49  "src/bluetooth_opp.cpp",
50  "src/bluetooth_pan.cpp",
51  "src/bluetooth_pbap_pce.cpp",
52  "src/bluetooth_pbap_pse.cpp",
53  "src/bluetooth_proxy_manager.cpp",
54  "src/bluetooth_remote_device.cpp",
55  "src/bluetooth_socket.cpp",
56  "src/bluetooth_socket_inputstream.cpp",
57  "src/bluetooth_socket_outputstream.cpp",
58  "src/bluetooth_utils.cpp",
59  "src/bluetooth_host_load_callback.cpp",
60  "src/bluetooth_load_system_ability.cpp",
61]
62
63BT_IPCSRC_DIR = "ipc/src"
64FwkIpcSrc = [
65  "$BT_IPCSRC_DIR/bluetooth_a2dp_sink_observer_stub.cpp",
66  "$BT_IPCSRC_DIR/bluetooth_a2dp_sink_proxy.cpp",
67  "$BT_IPCSRC_DIR/bluetooth_a2dp_src_observer_stub.cpp",
68  "$BT_IPCSRC_DIR/bluetooth_a2dp_src_proxy.cpp",
69  "$BT_IPCSRC_DIR/bluetooth_avrcp_ct_observer_stub.cpp",
70  "$BT_IPCSRC_DIR/bluetooth_avrcp_ct_proxy.cpp",
71  "$BT_IPCSRC_DIR/bluetooth_avrcp_tg_observer_stub.cpp",
72  "$BT_IPCSRC_DIR/bluetooth_avrcp_tg_proxy.cpp",
73  "$BT_IPCSRC_DIR/bluetooth_ble_advertise_callback_stub.cpp",
74  "$BT_IPCSRC_DIR/bluetooth_ble_advertiser_proxy.cpp",
75  "$BT_IPCSRC_DIR/bluetooth_ble_central_manager_callback_stub.cpp",
76  "$BT_IPCSRC_DIR/bluetooth_ble_central_manager_proxy.cpp",
77  "$BT_IPCSRC_DIR/bluetooth_ble_peripheral_observer_stub.cpp",
78  "$BT_IPCSRC_DIR/bluetooth_gatt_client_callback_stub.cpp",
79  "$BT_IPCSRC_DIR/bluetooth_gatt_client_proxy.cpp",
80  "$BT_IPCSRC_DIR/bluetooth_gatt_server_callback_stub.cpp",
81  "$BT_IPCSRC_DIR/bluetooth_gatt_server_proxy.cpp",
82  "$BT_IPCSRC_DIR/bluetooth_hfp_ag_observer_stub.cpp",
83  "$BT_IPCSRC_DIR/bluetooth_hfp_ag_proxy.cpp",
84  "$BT_IPCSRC_DIR/bluetooth_hfp_hf_observer_stub.cpp",
85  "$BT_IPCSRC_DIR/bluetooth_hfp_hf_proxy.cpp",
86  "$BT_IPCSRC_DIR/bluetooth_hid_host_observer_stub.cpp",
87  "$BT_IPCSRC_DIR/bluetooth_hid_host_proxy.cpp",
88  "$BT_IPCSRC_DIR/bluetooth_host_observer_stub.cpp",
89  "$BT_IPCSRC_DIR/bluetooth_host_proxy.cpp",
90  "$BT_IPCSRC_DIR/bluetooth_map_mce_observer_stub.cpp",
91  "$BT_IPCSRC_DIR/bluetooth_map_mce_proxy.cpp",
92  "$BT_IPCSRC_DIR/bluetooth_map_mse_observer_stub.cpp",
93  "$BT_IPCSRC_DIR/bluetooth_map_mse_proxy.cpp",
94  "$BT_IPCSRC_DIR/bluetooth_opp_observer_stub.cpp",
95  "$BT_IPCSRC_DIR/bluetooth_opp_proxy.cpp",
96  "$BT_IPCSRC_DIR/bluetooth_pan_observer_stub.cpp",
97  "$BT_IPCSRC_DIR/bluetooth_pan_proxy.cpp",
98  "$BT_IPCSRC_DIR/bluetooth_pbap_pce_observer_stub.cpp",
99  "$BT_IPCSRC_DIR/bluetooth_pbap_pce_proxy.cpp",
100  "$BT_IPCSRC_DIR/bluetooth_pbap_pse_observer_stub.cpp",
101  "$BT_IPCSRC_DIR/bluetooth_pbap_pse_proxy.cpp",
102  "$BT_IPCSRC_DIR/bluetooth_remote_device_observer_stub.cpp",
103  "$BT_IPCSRC_DIR/bluetooth_socket_proxy.cpp",
104]
105
106config("btframework_config") {
107  cflags_cc = [
108    "-fPIC",
109    "-Wno-unused-parameter",
110    "-Wunused-private-field",
111  ]
112  include_dirs = [
113    "include",
114    "ipc/include",
115    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/common",
116    "$SUBSYSTEM_DIR/bluetooth/interfaces/inner_api/include/c_header",
117  ]
118}
119
120config("btframework_public_config") {
121  visibility = [ "*" ]
122  include_dirs = [
123    "$SUBSYSTEM_DIR/bluetooth/interfaces/inner_api/include",
124    "$SUBSYSTEM_DIR/bluetooth/interfaces/inner_api/include/c_header",
125  ]
126}
127
128ohos_shared_library("btframework") {
129  stack_protector_ret = true
130  configs = [ ":btframework_config" ]
131  public_configs = [ ":btframework_public_config" ]
132  innerapi_tags = [ "platformsdk" ]
133  sources = FwkSrc
134  sources += FwkCAdapterSrc
135  sources += FwkIpcSrc
136
137  deps = [ ":btcommon" ]
138
139  external_deps = [
140    "c_utils:utils",
141    "hilog:libhilog",
142    "hisysevent:libhisysevent",
143    "ipc:ipc_core",
144    "samgr:samgr_proxy",
145  ]
146
147  subsystem_name = "communication"
148  part_name = "bluetooth"
149}
150
151config("btcommon_public_config") {
152  include_dirs = [
153    "common",
154    "ipc/common",
155    "ipc/interface",
156    "ipc/parcel",
157  ]
158}
159
160ohos_shared_library("btcommon") {
161  stack_protector_ret = true
162  public_configs = [ ":btcommon_public_config" ]
163  innerapi_tags = [ "chipsetsdk" ]
164  sources = [
165    "ipc/common/avrcp_media.cpp",
166    "ipc/common/ble_parcel_data.cpp",
167    "ipc/common/ble_service_data.cpp",
168    "ipc/common/bt_uuid.cpp",
169    "ipc/common/gatt_data.cpp",
170    "ipc/common/hands_free_unit_calls.cpp",
171    "ipc/common/opp_transfer_information.cpp",
172    "ipc/common/pbap_pce_parameter.cpp",
173    "ipc/common/raw_address.cpp",
174    "ipc/parcel/bluetooth_a2dp_a2dpCodecInfo.cpp",
175    "ipc/parcel/bluetooth_a2dp_a2dpCodecStatus.cpp",
176    "ipc/parcel/bluetooth_avrcp_meItem.cpp",
177    "ipc/parcel/bluetooth_avrcp_mpItem.cpp",
178    "ipc/parcel/bluetooth_ble_advertiser_data.cpp",
179    "ipc/parcel/bluetooth_ble_advertiser_settings.cpp",
180    "ipc/parcel/bluetooth_ble_scan_filter.cpp",
181    "ipc/parcel/bluetooth_ble_scan_result.cpp",
182    "ipc/parcel/bluetooth_ble_scan_settings.cpp",
183    "ipc/parcel/bluetooth_bt_uuid.cpp",
184    "ipc/parcel/bluetooth_gatt_characteristic_parcel.cpp",
185    "ipc/parcel/bluetooth_gatt_descriptor_parcel.cpp",
186    "ipc/parcel/bluetooth_gatt_device.cpp",
187    "ipc/parcel/bluetooth_gatt_service_parcel.cpp",
188    "ipc/parcel/bluetooth_hfp_hf_call.cpp",
189    "ipc/parcel/bluetooth_map_mce_parameter.cpp",
190    "ipc/parcel/bluetooth_opp_transfer_information.cpp",
191    "ipc/parcel/bluetooth_pbap_pce_parameter.cpp",
192    "ipc/parcel/bluetooth_raw_address.cpp",
193    "ipc/parcel/parcel_bt_uuid.cpp",
194  ]
195
196  deps = []
197
198  external_deps = [
199    "c_utils:utils",
200    "hilog:libhilog",
201    "hisysevent:libhisysevent",
202    "ipc:ipc_core",
203  ]
204
205  subsystem_name = "communication"
206  part_name = "bluetooth"
207}
208