return NNS_EDGE_ERROR_NONE;
}
+/**
+ * @brief Internal wrapper function of the nns_edge_data_destory() to avoid build warning of the incompatibe type casting. (See nns_edge_data_destroy_cb())
+ */
+void
+nns_edge_data_release_handle (void *data)
+{
+ nns_edge_data_h data_h = (nns_edge_data_h) data;
+
+ if (data_h) {
+ if (NNS_EDGE_ERROR_NONE != nns_edge_data_destroy (data_h))
+ nns_edge_logw ("Failed to destory the nns-edge data handle.");
+ }
+}
+
/**
* @brief Validate edge data handle.
*/
nns_size_t meta_len;
} nns_edge_data_header_s;
+/**
+ * @brief Internal wrapper function of the nns_edge_data_destory() to avoid build warning of the incompatibe type casting. (See nns_edge_data_destroy_cb())
+ */
+void nns_edge_data_release_handle (void *data);
+
/**
* @brief Validate edge data handle.
* @note This is internal function, DO NOT export this.
return false;
}
-/**
- * @brief internal wrapper function of the nns_edge_data_destory () to avoid build warning of the incompatibe type casting.
- */
-void
-_nns_edge_data_destroy (nns_edge_data_h data_h)
-{
- if (data_h) {
- if (NNS_EDGE_ERROR_NONE != nns_edge_data_destroy (data_h))
- nns_edge_logw ("Failed to destory the nns-edge data handle.");
- }
-}
-
/**
* @brief Send data to desination (broker or connected node), asynchronously.
*/
/* Create new data handle and push it into send-queue. */
nns_edge_data_copy (data_h, &new_data_h);
- if (!nns_edge_queue_push (eh->send_queue, new_data_h, _nns_edge_data_destroy)) {
+ if (!nns_edge_queue_push (eh->send_queue, new_data_h,
+ nns_edge_data_release_handle)) {
nns_edge_loge ("Failed to send data, cannot push data into queue.");
nns_edge_unlock (eh);
return NNS_EDGE_ERROR_IO;