1# Copyright (C) 2022 HiHope Open Source Organization .
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("//build/ohos/ndk/ndk.gni")
15
16config("bt_warnings") {
17  cflags = [
18    "-Wall",
19    "-Werror",
20    "-Wno-switch",
21    "-Wno-unused-function",
22    "-Wno-unused-parameter",
23    "-Wno-unused-variable",
24    "-Wno-implicit-function-declaration",
25    "-Wno-incompatible-pointer-types",
26  ]
27}
28
29ohos_prebuilt_etc("BCM4362A2.hcd") {
30  source = "//vendor/${product_company}/${product_name}/bluetooth/BCM4362A2.hcd"
31  install_images = [ chipset_base_dir ]
32  relative_install_dir = "firmware"
33  part_name = "device_rk3588"
34  install_enable = true
35}
36
37ohos_shared_library("libbt_vendor") {
38  output_name = "libbt_vendor"
39  sources = [
40    "src/bt_vendor_brcm.c",
41    "src/conf.c",
42    "src/hardware.c",
43    "src/upio.c",
44    "src/userial_vendor.c",
45  ]
46
47  include_dirs = [
48    "include",
49    "//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
50    "//foundation/communication/bluetooth/services/bluetooth/hardware/include",
51  ]
52
53  cflags = [
54    "-DUSE_CONTROLLER_BDADDR=TRUE",
55    "-DFW_AUTO_DETECTION=TRUE",
56    "-DBT_WAKE_VIA_PROC=FALSE",
57    "-DSCO_PCM_ROUTING=0",
58    "-DSCO_PCM_IF_CLOCK_RATE=1",
59    "-DSCO_PCM_IF_FRAME_TYPE=0",
60    "-DSCO_PCM_IF_SYNC_MODE=0",
61    "-DSCO_PCM_IF_CLOCK_MODE=0",
62    "-DPCM_DATA_FMT_SHIFT_MODE=0",
63    "-DPCM_DATA_FMT_FILL_BITS=0x03",
64    "-DPCM_DATA_FMT_FILL_METHOD=0",
65    "-DPCM_DATA_FMT_FILL_NUM=0",
66    "-DPCM_DATA_FMT_JUSTIFY_MODE=0",
67  ]
68
69  configs = [ ":bt_warnings" ]
70
71  external_deps = [
72    "c_utils:utils",
73    "hilog:libhilog",
74  ]
75
76  install_enable = true
77  install_images = [ chipset_base_dir ]
78
79  part_name = "device_rk3588"
80  subsystem_name = "device_rk3588"
81}
82