mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-23 16:59:54 +00:00
not find GetWifiDirectManager
https://gitee.com/openharmony/communication_dsoftbus/issues/I9L1HQ Signed-off-by: liwenqiang <liwenqiang45@huawei.com>
This commit is contained in:
parent
aa088d2489
commit
4e9dc2fdf8
@ -783,7 +783,7 @@ int32_t AuthStartListeningForWifiDirect(AuthLinkType type, const char *ip, int32
|
||||
if (type == AUTH_LINK_TYPE_P2P) {
|
||||
local.socketOption.moduleId = AUTH_P2P;
|
||||
} else if (type == AUTH_LINK_TYPE_ENHANCED_P2P) {
|
||||
local.socketOption.moduleId = GetWifiDirectManager()->allocateListenerModuleId();
|
||||
local.socketOption.moduleId = (ListenerModule)(GetWifiDirectManager()->allocateListenerModuleId());
|
||||
AUTH_CHECK_AND_RETURN_RET_LOGE(local.socketOption.moduleId < UNUSE_BUTT, SOFTBUS_ERR, AUTH_CONN,
|
||||
"alloc listener module id failed");
|
||||
} else {
|
||||
|
@ -20,12 +20,6 @@ ohos_static_library("wifi_direct") {
|
||||
defines += [ "ASAN_BUILD" ]
|
||||
}
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
|
||||
wifi_direct_path = "$dsoftbus_root_path/core/connection/wifi_direct_cpp"
|
||||
wifi_direct_connection_src = []
|
||||
|
||||
@ -60,6 +54,12 @@ ohos_static_library("wifi_direct") {
|
||||
|
||||
if (dsoftbus_feature_conn_p2p == true &&
|
||||
softbus_communication_wifi_feature == true) {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
|
||||
wifi_direct_connection_src += [
|
||||
"$wifi_direct_path/adapter/p2p_adapter.cpp",
|
||||
"$wifi_direct_path/channel/auth_negotiate_channel.cpp",
|
||||
@ -122,26 +122,25 @@ ohos_static_library("wifi_direct") {
|
||||
"netmanager_base:net_conn_manager_if",
|
||||
"wifi:wifi_sdk",
|
||||
]
|
||||
|
||||
remove_configs = [
|
||||
"//build/config/compiler:no_rtti",
|
||||
"//build/config/compiler:no_exceptions",
|
||||
]
|
||||
|
||||
configs = [
|
||||
"//build/config/compiler:rtti",
|
||||
"//build/config/compiler:exceptions",
|
||||
]
|
||||
} else {
|
||||
wifi_direct_connection_src +=
|
||||
[ "$wifi_direct_path/wifi_direct_manager_virtual.c" ]
|
||||
wifi_direct_connection_external_deps += [ "hilog:libhilog" ]
|
||||
}
|
||||
|
||||
include_dirs = wifi_direct_connection_inc
|
||||
sources = wifi_direct_connection_src
|
||||
external_deps = wifi_direct_connection_external_deps
|
||||
|
||||
remove_configs = [
|
||||
"//build/config/compiler:no_rtti",
|
||||
"//build/config/compiler:no_exceptions",
|
||||
]
|
||||
|
||||
configs = [
|
||||
"//build/config/compiler:rtti",
|
||||
"//build/config/compiler:exceptions",
|
||||
]
|
||||
|
||||
part_name = "dsoftbus"
|
||||
subsystem_name = "communication"
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ static void SetElementType(struct WifiDirectConnectInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
static ListenerModule AllocateListenerModuleId()
|
||||
static int32_t AllocateListenerModuleId()
|
||||
{
|
||||
std::lock_guard lock(g_listenerModuleIdLock);
|
||||
ListenerModule moduleId = UNUSE_BUTT;
|
||||
@ -83,12 +83,12 @@ static ListenerModule AllocateListenerModuleId()
|
||||
return moduleId;
|
||||
}
|
||||
|
||||
static bool IsEnhanceP2pModuleId(ListenerModule moduleId)
|
||||
static bool IsEnhanceP2pModuleId(int32_t moduleId)
|
||||
{
|
||||
return moduleId >= AUTH_ENHANCED_P2P_START && moduleId <= AUTH_ENHANCED_P2P_END;
|
||||
}
|
||||
|
||||
static void FreeListenerModuleId(ListenerModule moduleId)
|
||||
static void FreeListenerModuleId(int32_t moduleId)
|
||||
{
|
||||
std::lock_guard lock(g_listenerModuleIdLock);
|
||||
if (IsEnhanceP2pModuleId(moduleId)) {
|
||||
|
@ -16,7 +16,6 @@
|
||||
#define WIFI_DIRECT_MANAGER_H
|
||||
|
||||
#include "common_list.h"
|
||||
#include "softbus_base_listener.h"
|
||||
#include "wifi_direct_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -35,8 +34,8 @@ struct WifiDirectStatusListener {
|
||||
|
||||
struct WifiDirectManager {
|
||||
uint32_t (*getRequestId)(void);
|
||||
ListenerModule (*allocateListenerModuleId)(void);
|
||||
void (*freeListenerModuleId)(ListenerModule moduleId);
|
||||
int32_t (*allocateListenerModuleId)(void);
|
||||
void (*freeListenerModuleId)(int32_t moduleId);
|
||||
|
||||
int32_t (*connectDevice)(struct WifiDirectConnectInfo *info, struct WifiDirectConnectCallback *callback);
|
||||
int32_t (*disconnectDevice)(struct WifiDirectDisconnectInfo *info, struct WifiDirectDisconnectCallback *callback);
|
||||
|
@ -13,8 +13,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "wifi_direct_manager.h"
|
||||
|
||||
#include "conn_log.h"
|
||||
#include "softbus_error_code.h"
|
||||
|
||||
static uint32_t GetRequestId()
|
||||
@ -22,12 +20,12 @@ static uint32_t GetRequestId()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ListenerModule AllocateListenerModuleId(void)
|
||||
static int32_t AllocateListenerModuleId(void)
|
||||
{
|
||||
return UNUSE_BUTT;
|
||||
return SOFTBUS_NOT_IMPLEMENT;
|
||||
}
|
||||
|
||||
static void FreeListenerModuleId(ListenerModule moduleId)
|
||||
static void FreeListenerModuleId(int32_t moduleId)
|
||||
{
|
||||
(void)moduleId;
|
||||
}
|
||||
|
@ -85,6 +85,7 @@ if (defined(ohos_lite)) {
|
||||
"$dsoftbus_root_path/adapter:softbus_adapter",
|
||||
"$dsoftbus_root_path/core/common:softbus_utils",
|
||||
"$dsoftbus_root_path/core/common/dfx/hidumper_adapter:softbus_dfx_dump",
|
||||
"$dsoftbus_root_path/core/connection/wifi_direct_cpp:wifi_direct",
|
||||
"//build/lite/config/component/cJSON:cjson_static",
|
||||
]
|
||||
external_deps = [ "device_auth:deviceauth_sdk" ]
|
||||
@ -141,6 +142,7 @@ if (defined(ohos_lite)) {
|
||||
"$dsoftbus_root_path/adapter:softbus_adapter",
|
||||
"$dsoftbus_root_path/core/common:softbus_utils",
|
||||
"$dsoftbus_root_path/core/common/dfx/hidumper_adapter:softbus_dfx_dump",
|
||||
"$dsoftbus_root_path/core/connection/wifi_direct_cpp:wifi_direct",
|
||||
"//build/lite/config/component/cJSON:cjson_shared",
|
||||
"//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
|
||||
"//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
|
||||
|
Loading…
Reference in New Issue
Block a user