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("//foundation/communication/dsoftbus/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/adapter/single", 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_command_manager.c", 39 "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_decision_center.c", 40 "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_initiator.c", 41 "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_manager.c", 42 "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_ip_manager.c", 43 "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_negotiator.c", 44 "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_role_negotiator.c", 45 "$dsoftbus_root_path/core/connection/wifi_direct/channel/default_negotiate_channel.c", 46 "$dsoftbus_root_path/core/connection/wifi_direct/channel/fast_connect_negotiate_channel.c", 47 "$dsoftbus_root_path/core/connection/wifi_direct/data/info_container.c", 48 "$dsoftbus_root_path/core/connection/wifi_direct/data/inner_link.c", 49 "$dsoftbus_root_path/core/connection/wifi_direct/data/wifi_config_info.c", 50 "$dsoftbus_root_path/core/connection/wifi_direct/data/interface_info.c", 51 "$dsoftbus_root_path/core/connection/wifi_direct/data/link_info.c", 52 "$dsoftbus_root_path/core/connection/wifi_direct/data/link_manager.c", 53 "$dsoftbus_root_path/core/connection/wifi_direct/data/negotiate_message.c", 54 "$dsoftbus_root_path/core/connection/wifi_direct/data/resource_manager.c", 55 "$dsoftbus_root_path/core/connection/wifi_direct/data/wifi_direct_intent.c", 56 "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_entity.c", 57 "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_entity_state.c", 58 "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_available_state.c", 59 "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_unavailable_state.c", 60 "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_group_connecting_state.c", 61 "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_group_creating_state.c", 62 "$dsoftbus_root_path/core/connection/wifi_direct/entity/p2p_entity/p2p_group_removing_state.c", 63 "$dsoftbus_root_path/core/connection/wifi_direct/negotiate_state/available_state.c", 64 "$dsoftbus_root_path/core/connection/wifi_direct/negotiate_state/processing_state.c", 65 "$dsoftbus_root_path/core/connection/wifi_direct/negotiate_state/waiting_connect_request_state.c", 66 "$dsoftbus_root_path/core/connection/wifi_direct/negotiate_state/waiting_connect_response_state.c", 67 "$dsoftbus_root_path/core/connection/wifi_direct/processor/p2p_v1_processor.c", 68 "$dsoftbus_root_path/core/connection/wifi_direct/processor/p2p_v2_processor.c", 69 "$dsoftbus_root_path/core/connection/wifi_direct/protocol/json_protocol.c", 70 "$dsoftbus_root_path/core/connection/wifi_direct/protocol/tlv_protocol.c", 71 "$dsoftbus_root_path/core/connection/wifi_direct/protocol/wifi_direct_protocol_factory.c", 72 "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_ipv4_info.c", 73 "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_network_utils.c", 74 "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_timer_list.c", 75 "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_work_queue.c", 76 "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_utils.c", 77 "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_anonymous.c", 78 "$dsoftbus_root_path/core/connection/wifi_direct/utils/wifi_direct_perf_recorder.c", 79 "$dsoftbus_root_path/core/connection/wifi_direct/processor/wifi_direct_processor_factory.c", 80 "$dsoftbus_root_path/core/connection/wifi_direct/entity/wifi_direct_entity_factory.c", 81 "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/broadcast_handler.c", 82 "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/broadcast_receiver.c", 83 "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/link_manager_broadcast_handler.c", 84 "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/p2p_entity_broadcast_handler.c", 85 "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/resource_manager_broadcast_handler.c", 86 "$dsoftbus_root_path/core/connection/wifi_direct/adapter/single/wifi_direct_p2p_adapter.c", 87 ] 88 89 if (enhanced_wifi_direct) { 90 import( 91 "//foundation/communication/dsoftbus/dsoftbus_enhance/core/connection/wifi_direct/wifi_direct.gni") 92 93 wifi_direct_connection_inc += wifi_direct_connection_enhance_inc 94 wifi_direct_connection_src += wifi_direct_connection_enhance_src 95 } else { 96 wifi_direct_connection_src += [] 97 } 98 99 wifi_direct_connection_external_deps += [ "wifi:wifi_sdk" ] 100} else { 101 wifi_direct_connection_src += [ 102 "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_initiator_virtual.c", 103 "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_manager_virtual.c", 104 "$dsoftbus_root_path/core/connection/wifi_direct/channel/default_negotiate_channel_virtual.c", 105 "$dsoftbus_root_path/core/connection/wifi_direct/channel/fast_connect_negotiate_channel_virtual.c", 106 ] 107} 108