From 780e716b05c3d24ea40d3f4db2392a172f3e1717 Mon Sep 17 00:00:00 2001 From: songzhengteng Date: Wed, 24 Jan 2024 21:06:09 +0800 Subject: [PATCH] notify new client join interface support return statue code Signed-off-by: songzhengteng Change-Id: I01865f964c6793489326e3128cdcd69e03feefd5 --- core/connection/wifi_direct/entity/p2p_entity/p2p_entity.c | 5 +++-- core/connection/wifi_direct/entity/wifi_direct_entity.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/connection/wifi_direct/entity/p2p_entity/p2p_entity.c b/core/connection/wifi_direct/entity/p2p_entity/p2p_entity.c index 17fda24f0..8fe0508df 100644 --- a/core/connection/wifi_direct/entity/p2p_entity/p2p_entity.c +++ b/core/connection/wifi_direct/entity/p2p_entity/p2p_entity.c @@ -106,12 +106,12 @@ static int32_t DestroyServer(struct WifiDirectConnectParams *params) return self->currentState->destroyServer(self->currentState, params); } -static void NotifyNewClientJoining(struct WifiDirectConnectParams *params) +static int32_t NotifyNewClientJoining(struct WifiDirectConnectParams *params) { CONN_LOGI(CONN_WIFI_DIRECT, "remoteMac=%{public}s", WifiDirectAnonymizeMac(params->remoteMac)); struct P2pEntity *self = GetP2pEntity(); struct P2pEntityConnectingClient *client = SoftBusCalloc(sizeof(*client)); - CONN_CHECK_AND_RETURN_LOGE(client, CONN_WIFI_DIRECT, "malloc connecting client failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(client, SOFTBUS_MALLOC_ERR, CONN_WIFI_DIRECT, "malloc connecting client failed"); ListInit(&client->node); int32_t ret = strcpy_s(client->remoteMac, sizeof(client->remoteMac), params->remoteMac); if (ret != EOK) { @@ -123,6 +123,7 @@ static void NotifyNewClientJoining(struct WifiDirectConnectParams *params) client->timerId = GetWifiDirectTimerList()->startTimer( OnClientJoinTimeout, TIMEOUT_WAIT_CLIENT_JOIN_MS, TIMER_FLAG_ONE_SHOOT, client); + return SOFTBUS_OK; } static void CancelNewClientJoining(struct WifiDirectConnectParams *params) diff --git a/core/connection/wifi_direct/entity/wifi_direct_entity.h b/core/connection/wifi_direct/entity/wifi_direct_entity.h index f85eb849c..e888ef924 100755 --- a/core/connection/wifi_direct/entity/wifi_direct_entity.h +++ b/core/connection/wifi_direct/entity/wifi_direct_entity.h @@ -77,7 +77,7 @@ struct EntityListener { int32_t (*disconnect)(struct WifiDirectConnectParams *params); \ int32_t (*destroyServer)(struct WifiDirectConnectParams *params); \ int32_t (*switchNotify)(struct WifiDirectConnectParams *params); \ - void (*notifyNewClientJoining)(struct WifiDirectConnectParams *params); \ + int32_t (*notifyNewClientJoining)(struct WifiDirectConnectParams *params); \ void (*notifyNewClientJoinFail)(struct WifiDirectConnectParams *params); \ void (*cancelNewClientJoining)(struct WifiDirectConnectParams *params); \ void (*registerListener)(struct EntityListener *listener); \