int wifi_aware_session_unset_message_received_cb(wifi_aware_session_h session);
/**
+ * @brief
+ * @since_tizen 6.0
+ * @param[out] cloned
+ * @param[in] origin
+ * @return 0 on success, otherwise a negative error value
+ * @retval #WIFI_AWARE_ERROR_NONE
+ */
+int wifi_aware_peer_clone(wifi_aware_peer_h *cloned, wifi_aware_peer_h origin);
+
+/**
+ * @brief
+ * @since_tizen 6.0
+ * @param[in] peer
+ * @return 0 on success, otherwise a negative error value
+ * @retval #WIFI_AWARE_ERROR_NONE
+ */
+int wifi_aware_peer_destroy(wifi_aware_peer_h peer);
+
+/**
* @brief Get the MAC address (NAN Management Interface) of Wi-Fi Aware peer.
* @remarks @a mac should be freed using free().
* @since_tizen 6.0
#define WIFI_AWARE_MAC_ADDRESS_LEN 6
int _wifi_aware_peer_create(wifi_aware_peer_h *peer, unsigned int peer_id);
void _wifi_aware_peer_destroy(wifi_aware_peer_h peer);
+int _wifi_aware_peer_clone(wifi_aware_peer_h *cloned, wifi_aware_peer_h origin);
int _wifi_aware_peer_add(GHashTable *peer_map, wifi_aware_peer_h peer);
int _wifi_aware_peer_remove(GHashTable *peer_map, wifi_aware_peer_h peer);
wifi_aware_peer_h _wifi_aware_get_peer(GHashTable *peer_map, unsigned int peer_id);
g_free((wifi_aware_peer_s *)peer);
}
+int _wifi_aware_peer_clone(wifi_aware_peer_h *cloned, wifi_aware_peer_h origin)
+{
+ wifi_aware_peer_s *cloned_handle = (wifi_aware_peer_s *)g_try_malloc0(sizeof(wifi_aware_peer_s));
+ RET_VAL_IF(cloned_handle == NULL, WIFI_AWARE_ERROR_OUT_OF_MEMORY, "g_try_malloc0 failed");
+
+ memcpy(cloned_handle, origin, sizeof(wifi_aware_peer_s));
+ *cloned = cloned_handle;
+ return WIFI_AWARE_ERROR_NONE;
+}
+
int _wifi_aware_peer_add(GHashTable *peer_map, wifi_aware_peer_h peer)
{
wifi_aware_peer_s *peer_handle = (wifi_aware_peer_s *)peer;
return WIFI_AWARE_ERROR_NONE;
}
+API int wifi_aware_peer_clone(wifi_aware_peer_h *cloned, wifi_aware_peer_h origin)
+{
+ __WIFI_AWARE_FUNC_ENTER__;
+ CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+ RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
+ RET_VAL_IF(cloned == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "cloned is NULL");
+ RET_VAL_IF(origin == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "origin is NULL");
+
+ return _wifi_aware_peer_clone(cloned, origin);
+}
+
+API int wifi_aware_peer_destroy(wifi_aware_peer_h peer)
+{
+ __WIFI_AWARE_FUNC_ENTER__;
+ CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+ RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
+ RET_VAL_IF(peer == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "Peer is NULL");
+
+ _wifi_aware_peer_destroy(peer);
+ return WIFI_AWARE_ERROR_NONE;
+}
+
API int wifi_aware_peer_get_mac(wifi_aware_peer_h peer, unsigned char **mac)
{
__WIFI_AWARE_FUNC_ENTER__;