int wifi_aware_gdbus_open_ndp(wifi_aware_data_path_h data_path,
int client_id, uint16_t pub_sub_id, unsigned int peer_id,
- wifi_aware_data_path_role_e role, int port,
- GAsyncReadyCallback cb);
+ const char *service_name,
+ wifi_aware_data_path_role_e role, int port);
int wifi_aware_gdbus_open_ndp_psk(wifi_aware_data_path_h data_path,
int client_id, uint16_t pub_sub_id, unsigned int peer_id,
+ const char *service_name,
wifi_aware_data_path_role_e role, int port,
- const char *psk, GAsyncReadyCallback cb);
+ const char *psk);
int wifi_aware_gdbus_open_ndp_pmk(wifi_aware_data_path_h data_path,
int client_id, uint16_t pub_sub_id, unsigned int peer_id,
+ const char *service_name,
wifi_aware_data_path_role_e role, int port,
- const unsigned char *pmk,
- GAsyncReadyCallback cb);
+ const unsigned char *pmk);
int wifi_aware_gdbus_ndp_close(wifi_aware_data_path_h data_path,
int client_id, unsigned int ndp_id, uint16_t pub_sub_id, unsigned int peer_id);
#ifdef __cplusplus
_wifi_aware_get_client_id(),
_wifi_aware_session_get_pub_sub_id(ndp->session),
_wifi_aware_peer_get_id(ndp->peer),
+ _wifi_aware_session_get_service_name(ndp->session),
ndp->role,
- ndp->port,
- __data_path_open_reply);
+ ndp->port);
+ break;
case WIFI_AWARE_SECURITY_TYPE_PSK:
- return wifi_aware_gdbus_open_ndp_psk(data_path,
+ ret = wifi_aware_gdbus_open_ndp_psk(data_path,
_wifi_aware_get_client_id(),
_wifi_aware_session_get_pub_sub_id(ndp->session),
_wifi_aware_peer_get_id(ndp->peer),
+ _wifi_aware_session_get_service_name(ndp->session),
ndp->role,
ndp->port,
- ndp->psk,
- __data_path_open_reply);
+ ndp->psk);
+ break;
case WIFI_AWARE_SECURITY_TYPE_PMK:
- return wifi_aware_gdbus_open_ndp_pmk(data_path,
+ ret = wifi_aware_gdbus_open_ndp_pmk(data_path,
_wifi_aware_get_client_id(),
_wifi_aware_session_get_pub_sub_id(ndp->session),
_wifi_aware_peer_get_id(ndp->peer),
+ _wifi_aware_session_get_service_name(ndp->session),
ndp->role,
ndp->port,
- ndp->pmk,
- __data_path_open_reply);
+ ndp->pmk);
+ break;
+ default:
+ ret = WIFI_AWARE_ERROR_INVALID_PARAMETER;
}
- WIFI_AWARE_LOGE("Invalid security type");
- __data_path_set_open_cb(data_path, NULL, NULL);
- return WIFI_AWARE_ERROR_INVALID_PARAMETER;
+ if (ret != WIFI_AWARE_ERROR_NONE) {
+ WIFI_AWARE_LOGE("Invalid security type");
+ __data_path_set_open_cb(data_path, NULL, NULL);
+ __data_path_unset_data_path_confirmed_cb(data_path);
+ }
+ return ret;
}
int _wifi_aware_data_path_close(wifi_aware_data_path_h data_path)
return ret;
}
+ static int __handle_ndp_open_reply(GVariant *reply)
+ {
+ int error;
+ g_variant_get(reply, "(i)", &error);
+ WIFI_AWARE_LOGI("Reply for Open Data Path %d", error);
+ return error;
+ }
+
int wifi_aware_gdbus_open_ndp(wifi_aware_data_path_h data_path,
int client_id, uint16_t pub_sub_id, unsigned int peer_id,
- wifi_aware_data_path_role_e role, int port,
- GAsyncReadyCallback cb)
+ const char *service_name,
+ wifi_aware_data_path_role_e role, int port)
{
__WIFI_AWARE_FUNC_ENTER__;
GVariant *params = NULL;
+ GVariant *reply = NULL;
int ret = WIFI_AWARE_ERROR_NONE;
- params = __create_ndp_open_request_param(client_id, pub_sub_id, peer_id, role, port);
+ params = __create_ndp_open_request_param(client_id, pub_sub_id, peer_id,
+ service_name, role, port);
WIFI_AWARE_LOGD("created parameters");
DBUS_DEBUG_VARIANT(params);
int wifi_aware_gdbus_open_ndp_psk(wifi_aware_data_path_h data_path,
int client_id, uint16_t pub_sub_id, unsigned int peer_id,
- wifi_aware_data_path_role_e role, int port, const char *psk,
- GAsyncReadyCallback cb)
+ const char *service_name,
+ wifi_aware_data_path_role_e role, int port, const char *psk)
{
__WIFI_AWARE_FUNC_ENTER__;
GVariant *params = NULL;
GVariant *params_psk = NULL;
+ GVariant *reply = NULL;
int ret = WIFI_AWARE_ERROR_NONE;
- params = __create_ndp_open_request_param(client_id, pub_sub_id, peer_id, role, port);
+ params = __create_ndp_open_request_param(client_id, pub_sub_id, peer_id,
+ service_name, role, port);
params_psk = __append_param_psk(params, psk);
g_variant_unref(params);
WIFI_AWARE_LOGD("created parameters");
int wifi_aware_gdbus_open_ndp_pmk(wifi_aware_data_path_h data_path,
int client_id, uint16_t pub_sub_id, unsigned int peer_id,
- wifi_aware_data_path_role_e role, int port, const unsigned char *pmk,
- GAsyncReadyCallback cb)
+ const char *service_name,
+ wifi_aware_data_path_role_e role, int port, const unsigned char *pmk)
{
__WIFI_AWARE_FUNC_ENTER__;
GVariant *params = NULL;
GVariant *params_pmk = NULL;
+ GVariant *reply = NULL;
int ret = WIFI_AWARE_ERROR_NONE;
- params = __create_ndp_open_request_param(client_id, pub_sub_id, peer_id, role, port);
+ params = __create_ndp_open_request_param(client_id, pub_sub_id, peer_id,
+ service_name, role, port);
params_pmk = __append_param_pmk(params, pmk);
g_variant_unref(params);
WIFI_AWARE_LOGD("created parameters");