mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-23 16:59:54 +00:00
!5157 notify new client join interface support return statue code
Merge pull request !5157 from waibozie/master
This commit is contained in:
commit
0992283f47
@ -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)
|
||||
|
@ -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); \
|
||||
|
Loading…
Reference in New Issue
Block a user