119e95205Sopenharmony_ci# Copyright (C) 2021-2022 Huawei Device Co., Ltd.
219e95205Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
319e95205Sopenharmony_ci# you may not use this file except in compliance with the License.
419e95205Sopenharmony_ci# You may obtain a copy of the License at
519e95205Sopenharmony_ci#
619e95205Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
719e95205Sopenharmony_ci#
819e95205Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
919e95205Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1019e95205Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1119e95205Sopenharmony_ci# See the License for the specific language governing permissions and
1219e95205Sopenharmony_ci# limitations under the License.
1319e95205Sopenharmony_ci
1419e95205Sopenharmony_ciimport("//build/ohos.gni")
1519e95205Sopenharmony_ciimport("//build/ohos_var.gni")
1619e95205Sopenharmony_ciimport("//foundation/communication/bluetooth_service/bluetooth.gni")
1719e95205Sopenharmony_ci
1819e95205Sopenharmony_ciSUBSYSTEM_DIR = "//foundation/communication"
1919e95205Sopenharmony_ci
2019e95205Sopenharmony_ciconfig("btipc_public_config") {
2119e95205Sopenharmony_ci  include_dirs = [ "include" ]
2219e95205Sopenharmony_ci}
2319e95205Sopenharmony_ci
2419e95205Sopenharmony_ciohos_static_library("btipc_service") {
2519e95205Sopenharmony_ci  # sanitize = {
2619e95205Sopenharmony_ci  #   cfi = true
2719e95205Sopenharmony_ci  #   blocklist = "./ipc_blocklist.txt"
2819e95205Sopenharmony_ci  # }
2919e95205Sopenharmony_ci  stack_protector_ret = true
3019e95205Sopenharmony_ci  public_configs = [ ":btipc_public_config" ]
3119e95205Sopenharmony_ci  include_dirs = [
3219e95205Sopenharmony_ci    "$SUBSYSTEM_DIR/bluetooth_service/services/bluetooth/service/src/permission",
3319e95205Sopenharmony_ci    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/include",
3419e95205Sopenharmony_ci  ]
3519e95205Sopenharmony_ci  sources = [
3619e95205Sopenharmony_ci    "src/bluetooth_ble_advertise_callback_proxy.cpp",
3719e95205Sopenharmony_ci    "src/bluetooth_ble_advertiser_stub.cpp",
3819e95205Sopenharmony_ci    "src/bluetooth_ble_central_manager_callback_proxy.cpp",
3919e95205Sopenharmony_ci    "src/bluetooth_ble_central_manager_stub.cpp",
4019e95205Sopenharmony_ci    "src/bluetooth_ble_peripheral_observer_proxy.cpp",
4119e95205Sopenharmony_ci    "src/bluetooth_gatt_client_callback_proxy.cpp",
4219e95205Sopenharmony_ci    "src/bluetooth_gatt_client_stub.cpp",
4319e95205Sopenharmony_ci    "src/bluetooth_gatt_server_callback_proxy.cpp",
4419e95205Sopenharmony_ci    "src/bluetooth_gatt_server_stub.cpp",
4519e95205Sopenharmony_ci    "src/bluetooth_host_observer_proxy.cpp",
4619e95205Sopenharmony_ci    "src/bluetooth_host_stub.cpp",
4719e95205Sopenharmony_ci    "src/bluetooth_remote_device_observer_proxy.cpp",
4819e95205Sopenharmony_ci    "src/bluetooth_socket_observer_proxy.cpp",
4919e95205Sopenharmony_ci    "src/bluetooth_socket_stub.cpp",
5019e95205Sopenharmony_ci  ]
5119e95205Sopenharmony_ci
5219e95205Sopenharmony_ci  if (bluetooth_service_a2dp_sink_feature) {
5319e95205Sopenharmony_ci    sources += [
5419e95205Sopenharmony_ci      "src/bluetooth_a2dp_sink_observer_proxy.cpp",
5519e95205Sopenharmony_ci      "src/bluetooth_a2dp_sink_stub.cpp",
5619e95205Sopenharmony_ci    ]
5719e95205Sopenharmony_ci  }
5819e95205Sopenharmony_ci
5919e95205Sopenharmony_ci  if (bluetooth_service_a2dp_source_feature) {
6019e95205Sopenharmony_ci    sources += [
6119e95205Sopenharmony_ci      "src/bluetooth_a2dp_src_observer_proxy.cpp",
6219e95205Sopenharmony_ci      "src/bluetooth_a2dp_src_stub.cpp",
6319e95205Sopenharmony_ci    ]
6419e95205Sopenharmony_ci  }
6519e95205Sopenharmony_ci
6619e95205Sopenharmony_ci  if (bluetooth_service_avrcp_ct_feature) {
6719e95205Sopenharmony_ci    sources += [
6819e95205Sopenharmony_ci      "src/bluetooth_avrcp_ct_observer_proxy.cpp",
6919e95205Sopenharmony_ci      "src/bluetooth_avrcp_ct_stub.cpp",
7019e95205Sopenharmony_ci    ]
7119e95205Sopenharmony_ci  }
7219e95205Sopenharmony_ci
7319e95205Sopenharmony_ci  if (bluetooth_service_avrcp_tg_feature) {
7419e95205Sopenharmony_ci    sources += [
7519e95205Sopenharmony_ci      "src/bluetooth_avrcp_tg_observer_proxy.cpp",
7619e95205Sopenharmony_ci      "src/bluetooth_avrcp_tg_stub.cpp",
7719e95205Sopenharmony_ci    ]
7819e95205Sopenharmony_ci  }
7919e95205Sopenharmony_ci
8019e95205Sopenharmony_ci  if (bluetooth_service_hfp_ag_feature) {
8119e95205Sopenharmony_ci    sources += [
8219e95205Sopenharmony_ci      "src/bluetooth_hfp_ag_observer_proxy.cpp",
8319e95205Sopenharmony_ci      "src/bluetooth_hfp_ag_stub.cpp",
8419e95205Sopenharmony_ci    ]
8519e95205Sopenharmony_ci  }
8619e95205Sopenharmony_ci
8719e95205Sopenharmony_ci  if (bluetooth_service_hfp_hf_feature) {
8819e95205Sopenharmony_ci    sources += [
8919e95205Sopenharmony_ci      "src/bluetooth_hfp_hf_observer_proxy.cpp",
9019e95205Sopenharmony_ci      "src/bluetooth_hfp_hf_stub.cpp",
9119e95205Sopenharmony_ci    ]
9219e95205Sopenharmony_ci  }
9319e95205Sopenharmony_ci
9419e95205Sopenharmony_ci  if (bluetooth_service_hid_host_feature) {
9519e95205Sopenharmony_ci    sources += [
9619e95205Sopenharmony_ci      "src/bluetooth_hid_host_observer_proxy.cpp",
9719e95205Sopenharmony_ci      "src/bluetooth_hid_host_stub.cpp",
9819e95205Sopenharmony_ci    ]
9919e95205Sopenharmony_ci  }
10019e95205Sopenharmony_ci
10119e95205Sopenharmony_ci  if (bluetooth_service_pan_feature) {
10219e95205Sopenharmony_ci    sources += [
10319e95205Sopenharmony_ci      "src/bluetooth_pan_observer_proxy.cpp",
10419e95205Sopenharmony_ci      "src/bluetooth_pan_stub.cpp",
10519e95205Sopenharmony_ci    ]
10619e95205Sopenharmony_ci  }
10719e95205Sopenharmony_ci
10819e95205Sopenharmony_ci  cflags_cc = [ "-fvisibility=hidden" ]
10919e95205Sopenharmony_ci
11019e95205Sopenharmony_ci  deps = []
11119e95205Sopenharmony_ci
11219e95205Sopenharmony_ci  external_deps = [
11319e95205Sopenharmony_ci    "access_token:libaccesstoken_sdk",
11419e95205Sopenharmony_ci    "bluetooth:btcommon",
11519e95205Sopenharmony_ci    "c_utils:utils",
11619e95205Sopenharmony_ci    "hilog:libhilog",
11719e95205Sopenharmony_ci    "ipc:ipc_core",
11819e95205Sopenharmony_ci  ]
11919e95205Sopenharmony_ci
12019e95205Sopenharmony_ci  subsystem_name = "communication"
12119e95205Sopenharmony_ci  part_name = "bluetooth_service"
12219e95205Sopenharmony_ci}
12319e95205Sopenharmony_ci
12419e95205Sopenharmony_ci# Only temporary used in drivers_peripheral\bluetooth\audio
12519e95205Sopenharmony_ci
12619e95205Sopenharmony_ciconfig("btipc_static_public_config") {
12719e95205Sopenharmony_ci  visibility = [ "*" ]
12819e95205Sopenharmony_ci  include_dirs = [
12919e95205Sopenharmony_ci    "$SUBSYSTEM_DIR/bluetooth/interfaces/inner_api/include",
13019e95205Sopenharmony_ci    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/include",
13119e95205Sopenharmony_ci    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/common",
13219e95205Sopenharmony_ci    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/include",
13319e95205Sopenharmony_ci    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/interface",
13419e95205Sopenharmony_ci    "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/parcel",
13519e95205Sopenharmony_ci    "//foundation/communication/bluetooth_service/services/bluetooth/ipc/include",
13619e95205Sopenharmony_ci    "//foundation/communication/bluetooth_service/services/bluetooth/common",
13719e95205Sopenharmony_ci  ]
13819e95205Sopenharmony_ci}
13919e95205Sopenharmony_ci
14019e95205Sopenharmony_ciohos_static_library("btipc_static") {
14119e95205Sopenharmony_ci  stack_protector_ret = true
14219e95205Sopenharmony_ci  public_configs = [ ":btipc_static_public_config" ]
14319e95205Sopenharmony_ci
14419e95205Sopenharmony_ci  include_dirs = [ "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/include" ]
14519e95205Sopenharmony_ci
14619e95205Sopenharmony_ci  sources = [ "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/src/bluetooth_host_proxy.cpp" ]
14719e95205Sopenharmony_ci
14819e95205Sopenharmony_ci  if (bluetooth_service_a2dp_source_feature) {
14919e95205Sopenharmony_ci    sources += [ "$SUBSYSTEM_DIR/bluetooth/frameworks/inner/ipc/src/bluetooth_a2dp_src_proxy.cpp" ]
15019e95205Sopenharmony_ci  }
15119e95205Sopenharmony_ci
15219e95205Sopenharmony_ci  deps = []
15319e95205Sopenharmony_ci
15419e95205Sopenharmony_ci  external_deps = [
15519e95205Sopenharmony_ci    "bluetooth:btcommon",
15619e95205Sopenharmony_ci    "c_utils:utils",
15719e95205Sopenharmony_ci    "hilog:libhilog",
15819e95205Sopenharmony_ci    "hisysevent:libhisysevent",
15919e95205Sopenharmony_ci    "ipc:ipc_core",
16019e95205Sopenharmony_ci    "samgr:samgr_proxy",
16119e95205Sopenharmony_ci  ]
16219e95205Sopenharmony_ci
16319e95205Sopenharmony_ci  subsystem_name = "communication"
16419e95205Sopenharmony_ci  part_name = "bluetooth_service"
16519e95205Sopenharmony_ci}
166