• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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")
15
16native_source_path = rebase_path("$dsoftbus_root_path")
17wifi_direct_enhance_dir = "dsoftbus_enhance/core/connection/wifi_direct"
18enhanced_wifi_direct = exec_script("$dsoftbus_root_path/check_sub_module.py",
19                                   [
20                                     "$native_source_path",
21                                     "$wifi_direct_enhance_dir",
22                                   ],
23                                   "value")
24
25wifi_direct_connection_src = []
26wifi_direct_connection_external_deps = []
27
28wifi_direct_connection_inc = [
29  "$dsoftbus_root_path/core/connection/wifi_direct",
30  "//foundation/communication/wifi/wifi/interfaces/kits/c",
31  "$dsoftbus_root_path/core/connection/wifi_direct/utils",
32]
33
34if (dsoftbus_feature_conn_p2p == true &&
35    softbus_communication_wifi_feature == true) {
36  wifi_direct_connection_src += [
37    "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_coexist_rule.c",
38    "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_manager.c",
39    "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_ip_manager.cpp",
40    "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_negotiator.c",
41    "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_role_negotiator.c",
42    "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_role_option.c",
43    "$dsoftbus_root_path/core/connection/wifi_direct/channel/default_negotiate_channel.c",
44    "$dsoftbus_root_path/core/connection/wifi_direct/channel/fast_connect_negotiate_channel.c",
45    "$dsoftbus_root_path/core/connection/wifi_direct/command/wifi_direct_command_manager.cpp",
46    "$dsoftbus_root_path/core/connection/wifi_direct/command/wifi_direct_connect_command.c",
47    "$dsoftbus_root_path/core/connection/wifi_direct/command/wifi_direct_disconnect_command.c",
48    "$dsoftbus_root_path/core/connection/wifi_direct/command/wifi_direct_negotiate_command.c",
49    "$dsoftbus_root_path/core/connection/wifi_direct/data/info_container.c",
50    "$dsoftbus_root_path/core/connection/wifi_direct/data/inner_link.c",
51    "$dsoftbus_root_path/core/connection/wifi_direct/data/wifi_config_info.c",
52    "$dsoftbus_root_path/core/connection/wifi_direct/data/interface_info.c",
53    "$dsoftbus_root_path/core/connection/wifi_direct/data/link_info.c",
54    "$dsoftbus_root_path/core/connection/wifi_direct/data/link_manager.c",
55    "$dsoftbus_root_path/core/connection/wifi_direct/data/negotiate_message.c",
56    "$dsoftbus_root_path/core/connection/wifi_direct/data/resource_manager.c",
57    "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_entity.c",
58    "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_entity_state.c",
59    "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_available_state.c",
60    "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_unavailable_state.c",
61    "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_group_connecting_state.c",
62    "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_group_creating_state.c",
63    "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_group_removing_state.c",
64    "$dsoftbus_root_path/core/connection/wifi_direct/processor/p2p_v1_processor.c",
65    "$dsoftbus_root_path/core/connection/wifi_direct/protocol/json_protocol.c",
66    "$dsoftbus_root_path/core/connection/wifi_direct/protocol/tlv_protocol.c",
67    "$dsoftbus_root_path/core/connection/wifi_direct/protocol/wifi_direct_protocol_factory.c",
68    "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_ipv4_info.c",
69    "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_network_utils.c",
70    "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_timer_list.c",
71    "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_work_queue.c",
72    "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_utils.cpp",
73    "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_anonymous.c",
74    "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_perf_recorder.c",
75    "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_statistic.cpp",
76  ]
77
78  if (enhanced_wifi_direct) {
79    import(
80        "../../../dsoftbus_enhance/core/connection/wifi_direct/wifi_direct.gni")
81
82    wifi_direct_connection_inc += wifi_direct_connection_enhance_inc
83    wifi_direct_connection_src += wifi_direct_connection_enhance_src
84    wifi_direct_connection_external_deps += wifi_direct_connection_enhance_deps
85  } else {
86    wifi_direct_connection_inc +=
87        [ "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single" ]
88    wifi_direct_connection_src += [
89      "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_initiator.c",
90      "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_decision_center.c",
91      "$dsoftbus_root_path/core/connection/wifi_direct/processor/wifi_direct_processor_factory.c",
92      "$dsoftbus_root_path/core/connection/wifi_direct/entity/wifi_direct_entity_factory.c",
93      "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/broadcast_handler.c",
94      "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/p2p_entity_broadcast_handler.c",
95      "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/link_manager_broadcast_handler.c",
96      "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/resource_manager_broadcast_handler.c",
97      "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/broadcast_receiver.c",
98      "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/net_manager_adapter.cpp",
99      "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/wifi_direct_p2p_adapter.c",
100    ]
101  }
102
103  wifi_direct_connection_external_deps += [
104    "init:libbegetutil",
105    "wifi:wifi_sdk",
106  ]
107} else {
108  wifi_direct_connection_src += [
109    "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_initiator_virtual.c",
110    "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_manager_virtual.c",
111    "$dsoftbus_root_path/core/connection/wifi_direct/channel/default_negotiate_channel_virtual.c",
112    "$dsoftbus_root_path/core/connection/wifi_direct/channel/fast_connect_negotiate_channel_virtual.c",
113    "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_utils_virtual.c",
114    "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/net_manager_adapter.cpp",
115    "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/wifi_direct_p2p_adapter_virtual.c",
116  ]
117}
118
119wifi_direct_connection_common_deps = []
120enhanced_coap_connection_dir = "dsoftbus_enhance/core/connection/coap"
121enhanced_coap_connection =
122    exec_script("$dsoftbus_root_path/check_sub_module.py",
123                [
124                  "$native_source_path",
125                  "$enhanced_coap_connection_dir",
126                ],
127                "value")
128if (enhanced_coap_connection == true) {
129  import("../../../dsoftbus_enhance/core/connection/coap/conn_coap.gni")
130  wifi_direct_connection_inc += conn_coap_inc
131  wifi_direct_connection_src += conn_coap_src
132  wifi_direct_connection_common_deps += conn_coap_common_deps
133  wifi_direct_connection_external_deps += conn_coap_external_deps
134}
135
136enhanced_legacy_connection_dir = "dsoftbus_enhance/core/connection/legacy"
137enhanced_legacy_connection =
138    exec_script("$dsoftbus_root_path/check_sub_module.py",
139                [
140                  "$native_source_path",
141                  "$enhanced_legacy_connection_dir",
142                ],
143                "value")
144if (enhanced_legacy_connection == true) {
145  import("../../../dsoftbus_enhance/core/connection/legacy/legacy.gni")
146  wifi_direct_connection_inc += legacy_connection_inc
147  wifi_direct_connection_src += legacy_connection_src
148  wifi_direct_connection_common_deps += legacy_connection_common_deps
149  wifi_direct_connection_external_deps += legacy_connection_external_deps
150} else {
151  wifi_direct_connection_inc +=
152      [ "$dsoftbus_root_path/core/connection/ble/channel" ]
153  wifi_direct_connection_src += [
154    "$dsoftbus_root_path/core/connection/ble/channel/legacy_ble_channel_virtual.c",
155    "$dsoftbus_root_path/adapter/common/net/bluetooth/ble/softbus_adapter_ble_conflict_virtual.c",
156  ]
157}
158