!5157 notify new client join interface support return statue code

Merge pull request !5157 from waibozie/master
This commit is contained in:
openharmony_ci 2024-01-25 14:06:40 +00:00 committed by Gitee
commit 0992283f47
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
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); \