int _wifi_aware_session_handle_create(wifi_aware_session_type_e session_type,
wifi_aware_session_h *session_handle)
{
+ RET_VAL_IF(!session_handle, WIFI_AWARE_ERROR_INVALID_PARAMETER, "Invalid Parameter");
+ RET_VAL_IF(session_type != WIFI_AWARE_SESSION_PUBLISH && session_type != WIFI_AWARE_SESSION_SUBSCRIBE,
+ WIFI_AWARE_ERROR_INVALID_PARAMETER, "Invalid Parameter");
wifi_aware_session_s *session =
(wifi_aware_session_s *)g_try_malloc0(sizeof(wifi_aware_session_s));
RET_VAL_IF(session == NULL, WIFI_AWARE_ERROR_OUT_OF_MEMORY, "Out of memory");
int _wifi_aware_publish_handle_create(wifi_aware_publish_h *publish)
{
+ RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "Invalid Parameter");
+
wifi_aware_publish_request_s *req =
(wifi_aware_publish_request_s *)g_try_malloc0(sizeof(wifi_aware_publish_request_s));
RET_VAL_IF(req == NULL, WIFI_AWARE_ERROR_OUT_OF_MEMORY, "Out of memory");
RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_publish_h is NULL");
RET_VAL_IF(!_wifi_aware_session_is_publish_type(session), WIFI_AWARE_ERROR_INVALID_OPERATION,
"This session is not for Publish");
+ RET_VAL_IF(_wifi_aware_session_get_service_name(session) == NULL,
+ WIFI_AWARE_ERROR_INVALID_OPERATION, "Service name is NULL");
RET_VAL_IF(__session_is_requested(session), WIFI_AWARE_ERROR_NOW_IN_PROGRESS,
"There is a pending request");
int _wifi_aware_subscribe_handle_create(wifi_aware_subscribe_h *subscribe)
{
+ RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "Invalid Parameter");
+
wifi_aware_subscribe_request_s *req =
(wifi_aware_subscribe_request_s *)g_try_malloc0(sizeof(wifi_aware_subscribe_request_s));
RET_VAL_IF(req == NULL, WIFI_AWARE_ERROR_OUT_OF_MEMORY, "Out of memory");
RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
RET_VAL_IF(!_wifi_aware_session_is_subscribe_type(session), WIFI_AWARE_ERROR_INVALID_OPERATION,
"This session is not for Subscribe");
+ RET_VAL_IF(_wifi_aware_session_get_service_name(session) == NULL,
+ WIFI_AWARE_ERROR_INVALID_OPERATION, "Service name is NULL");
RET_VAL_IF(!__is_subscribed(session), WIFI_AWARE_ERROR_INVALID_OPERATION,
"The subscribe is not done yet");
RET_VAL_IF(__session_is_requested(session), WIFI_AWARE_ERROR_NOW_IN_PROGRESS,