1# Copyright (c) 2021 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("../../../../dsoftbus.gni")
15import("../../../common/dfx/dsoftbus_dfx.gni")
16
17core_lane_hub_path = "$dsoftbus_root_path/core/bus_center/lnn/lane_hub"
18
19native_source_path = rebase_path("$dsoftbus_root_path")
20dep_dir = "dsoftbus_enhance/core/bus_center/lnn/lane_hub"
21enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
22                       [
23                         "$native_source_path",
24                         "$dep_dir",
25                       ],
26                       "value")
27
28bus_center_hub_inc = [
29  "$core_lane_hub_path/common/include",
30  "$core_lane_hub_path/lane_manager/include",
31  "$core_lane_hub_path/time_sync/include",
32  "$core_lane_hub_path/heartbeat/include",
33  "$core_lane_hub_path/lane_qos/include",
34  "$dsoftbus_root_path/core/common/dfx/hisysevent_adapter/include",
35  "$dsoftbus_root_path/core/common/dfx/interface/include",
36]
37bus_center_hub_deps =
38    [ "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log" ]
39
40if (dsoftbus_feature_lnn_net) {
41  bus_center_hub_src = [
42    "$core_lane_hub_path/common/src/lnn_lane_hub.c",
43    "$core_lane_hub_path/lane_manager/src/lnn_ctrl_lane.c",
44    "$core_lane_hub_path/lane_manager/src/lnn_lane_link.c",
45    "$core_lane_hub_path/lane_manager/src/lnn_lane_link_conflict.c",
46    "$core_lane_hub_path/lane_manager/src/lnn_lane_link_wifi_direct.c",
47    "$core_lane_hub_path/lane_manager/src/lnn_lane.c",
48    "$core_lane_hub_path/lane_manager/src/lnn_lane_common.c",
49    "$core_lane_hub_path/lane_manager/src/lnn_lane_model.c",
50    "$core_lane_hub_path/lane_manager/src/lnn_lane_select.c",
51    "$core_lane_hub_path/lane_manager/src/lnn_lane_query.c",
52    "$core_lane_hub_path/lane_manager/src/lnn_select_rule.c",
53    "$core_lane_hub_path/lane_manager/src/lnn_trans_lane.c",
54    "$core_lane_hub_path/lane_manager/src/lnn_lane_reliability.c",
55    "$core_lane_hub_path/lane_manager/src/lnn_lane_listener.c",
56    "$core_lane_hub_path/lane_qos/lnn_lane_qos_virtual.c",
57    "$core_lane_hub_path/time_sync/src/lnn_time_sync_manager_virtual.c",
58    "$dsoftbus_root_path/core/common/dfx/statistics/trans_network_statistics.c",
59  ]
60
61  if (dsoftbus_feature_conn_p2p && softbus_communication_wifi_feature) {
62    bus_center_hub_src +=
63        [ "$core_lane_hub_path/lane_manager/src/lnn_lane_link_p2p.c" ]
64  } else {
65    bus_center_hub_src +=
66        [ "$core_lane_hub_path/lane_manager/src/lnn_lane_link_p2p_virtual.c" ]
67  }
68
69  if (enhanced) {
70    lane_src_enhance_path =
71        "$dsoftbus_root_path/dsoftbus_enhance/core/bus_center/lnn/lane_hub"
72  } else {
73    bus_center_hub_src += [
74      "$core_lane_hub_path/lane_manager/src/lnn_lane_score_virtual.c",
75      "$core_lane_hub_path/lane_manager/src/lnn_lane_vap_info_virtual.c",
76      "$core_lane_hub_path/lane_manager/src/lnn_lane_power_control_virtual.c",
77      "$core_lane_hub_path/lane_manager/src/lnn_parameter_utils_virtual.c",
78    ]
79  }
80  if (dsoftbus_feature_lnn_heartbeat) {
81    bus_center_hub_inc += [
82      "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
83      "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface",
84      "$dsoftbus_core_path/bus_center/lnn/net_ledger/local_ledger/include",
85      "$dsoftbus_core_path/core/adapter/bus_center/include",
86      "$dsoftbus_core_path/core/authentication/interface",
87      "$dsoftbus_core_path/connection/p2p/interface",
88      "$dsoftbus_core_path/core/common/include",
89    ]
90    bus_center_hub_src += [
91      "$core_lane_hub_path/heartbeat/src/lnn_heartbeat_fsm.c",
92      "$core_lane_hub_path/heartbeat/src/lnn_heartbeat_medium_mgr.c",
93      "$core_lane_hub_path/heartbeat/src/lnn_heartbeat_strategy.c",
94      "$core_lane_hub_path/heartbeat/src/lnn_heartbeat_utils.c",
95    ]
96    if (!enhanced) {
97      bus_center_hub_src += [
98        "$core_lane_hub_path/heartbeat/src/lnn_heartbeat_ctrl_virtual.c",
99        "$core_lane_hub_path/heartbeat/src/lnn_ble_heartbeat_virtual.c",
100        "$core_lane_hub_path/heartbeat/src/lnn_ble_lpdevice_virtual.c",
101      ]
102    } else {
103      bus_center_hub_src +=
104          [ "$core_lane_hub_path/heartbeat/src/lnn_heartbeat_ctrl.c" ]
105    }
106  } else {
107    bus_center_hub_src += [
108      "$core_lane_hub_path/heartbeat/src/lnn_heartbeat_ctrl_virtual.c",
109      "$core_lane_hub_path/heartbeat/src/lnn_ble_lpdevice_virtual.c",
110      "$core_lane_hub_path/heartbeat/src/lnn_heartbeat_utils_virtual.c",
111      "$core_lane_hub_path/heartbeat/src/lnn_heartbeat_strategy_virtual.c",
112    ]
113  }
114  bus_center_hub_inc += [ "$dsoftbus_core_path/connection/wifi_direct_cpp" ]
115} else {
116  bus_center_hub_src = [
117    "$core_lane_hub_path/common/src/lnn_lane_hub_virtual.c",
118    "$core_lane_hub_path/time_sync/src/lnn_time_sync_manager_virtual.c",
119    "$core_lane_hub_path/heartbeat/src/lnn_heartbeat_ctrl_virtual.c",
120  ]
121}
122
123if (dsoftbus_feature_lnn_net && dsoftbus_feature_lnn_heartbeat && enhanced) {
124  bus_center_hub_deps += [
125    "$dsoftbus_root_path/dsoftbus_enhance/core/bus_center/lnn/lane_hub/heartbeat:dsoftbus_ble_heartbeat",
126    "$dsoftbus_root_path/dsoftbus_enhance/core/bus_center/lnn/lane_hub/heartbeat:dsoftbus_ble_lpdevice",
127  ]
128}
129
130if (enhanced) {
131  lane_channel_rating_src_path = "$dsoftbus_root_path/dsoftbus_enhance/core/bus_center/lnn/lane_hub/lane_channel_rating"
132  bus_center_hub_inc += [
133    "$lane_channel_rating_src_path/include",
134    "$dsoftbus_root_path/dsoftbus_enhance/adapter/common/mlps/interface",
135  ]
136  bus_center_hub_src += [
137    "$lane_channel_rating_src_path/src/lnn_rating_manager.c",
138    "$lane_channel_rating_src_path/src/wlan_channel_collector.c",
139    "$lane_channel_rating_src_path/src/wlan_channel_sync.c",
140  ]
141}
142