notify new client join interface support return statue code

Signed-off-by: songzhengteng <songzhengteng@huawei.com>
Change-Id: I01865f964c6793489326e3128cdcd69e03feefd5
This commit is contained in:
songzhengteng 2024-01-24 21:06:09 +08:00
parent 236eddd4f5
commit 780e716b05
2 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -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); \