mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-23 16:59:54 +00:00
notify new client join interface support return statue code
Signed-off-by: songzhengteng <songzhengteng@huawei.com> Change-Id: I01865f964c6793489326e3128cdcd69e03feefd5
This commit is contained in:
parent
236eddd4f5
commit
780e716b05
@ -106,12 +106,12 @@ static int32_t DestroyServer(struct WifiDirectConnectParams *params)
|
|||||||
return self->currentState->destroyServer(self->currentState, 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));
|
CONN_LOGI(CONN_WIFI_DIRECT, "remoteMac=%{public}s", WifiDirectAnonymizeMac(params->remoteMac));
|
||||||
struct P2pEntity *self = GetP2pEntity();
|
struct P2pEntity *self = GetP2pEntity();
|
||||||
struct P2pEntityConnectingClient *client = SoftBusCalloc(sizeof(*client));
|
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);
|
ListInit(&client->node);
|
||||||
int32_t ret = strcpy_s(client->remoteMac, sizeof(client->remoteMac), params->remoteMac);
|
int32_t ret = strcpy_s(client->remoteMac, sizeof(client->remoteMac), params->remoteMac);
|
||||||
if (ret != EOK) {
|
if (ret != EOK) {
|
||||||
@ -123,6 +123,7 @@ static void NotifyNewClientJoining(struct WifiDirectConnectParams *params)
|
|||||||
|
|
||||||
client->timerId = GetWifiDirectTimerList()->startTimer(
|
client->timerId = GetWifiDirectTimerList()->startTimer(
|
||||||
OnClientJoinTimeout, TIMEOUT_WAIT_CLIENT_JOIN_MS, TIMER_FLAG_ONE_SHOOT, client);
|
OnClientJoinTimeout, TIMEOUT_WAIT_CLIENT_JOIN_MS, TIMER_FLAG_ONE_SHOOT, client);
|
||||||
|
return SOFTBUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CancelNewClientJoining(struct WifiDirectConnectParams *params)
|
static void CancelNewClientJoining(struct WifiDirectConnectParams *params)
|
||||||
|
@ -77,7 +77,7 @@ struct EntityListener {
|
|||||||
int32_t (*disconnect)(struct WifiDirectConnectParams *params); \
|
int32_t (*disconnect)(struct WifiDirectConnectParams *params); \
|
||||||
int32_t (*destroyServer)(struct WifiDirectConnectParams *params); \
|
int32_t (*destroyServer)(struct WifiDirectConnectParams *params); \
|
||||||
int32_t (*switchNotify)(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 (*notifyNewClientJoinFail)(struct WifiDirectConnectParams *params); \
|
||||||
void (*cancelNewClientJoining)(struct WifiDirectConnectParams *params); \
|
void (*cancelNewClientJoining)(struct WifiDirectConnectParams *params); \
|
||||||
void (*registerListener)(struct EntityListener *listener); \
|
void (*registerListener)(struct EntityListener *listener); \
|
||||||
|
Loading…
Reference in New Issue
Block a user