} nns_edge_handle_s;
/**
- * @brief Validate edge handle.
+ * @brief Check network connection.
*/
bool
-nns_edge_handle_is_valid (nns_edge_h edge_h)
+nns_edge_is_connected (nns_edge_h edge_h)
{
nns_edge_handle_s *eh;
eh = (nns_edge_handle_s *) edge_h;
- if (!NNS_EDGE_MAGIC_IS_VALID (eh))
- return false;
-
- return true;
-}
-
-/**
- * @brief Check network connection.
- */
-bool
-nns_edge_is_connected (nns_edge_h edge_h)
-{
- if (!nns_edge_handle_is_valid (edge_h)) {
+ if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
nns_edge_loge ("Invalid param, given edge handle is invalid.");
return false;
}
eh = (nns_edge_handle_s *) edge_h;
- if (!nns_edge_handle_is_valid (edge_h)) {
+ if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
nns_edge_loge ("Invalid param, given edge handle is invalid.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
eh = (nns_edge_handle_s *) edge_h;
- if (!nns_edge_handle_is_valid (edge_h)) {
+ if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
nns_edge_loge ("Invalid param, given edge handle is invalid.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
eh = (nns_edge_handle_s *) edge_h;
- if (!nns_edge_handle_is_valid (edge_h)) {
+ if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
nns_edge_loge ("Invalid param, given edge handle is invalid.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
int
nns_edge_disconnect (nns_edge_h edge_h)
{
- if (!nns_edge_handle_is_valid (edge_h)) {
+ nns_edge_handle_s *eh;
+
+ eh = (nns_edge_handle_s *) edge_h;
+
+ if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
nns_edge_loge ("Invalid param, given edge handle is invalid.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
int
nns_edge_publish (nns_edge_h edge_h, nns_edge_data_h data_h)
{
- if (!nns_edge_handle_is_valid (edge_h)) {
+ nns_edge_handle_s *eh;
+ nns_edge_data_s *ed;
+
+ eh = (nns_edge_handle_s *) edge_h;
+ ed = (nns_edge_data_s *) data_h;
+
+ if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
nns_edge_loge ("Invalid param, given edge handle is invalid.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
- if (!nns_edge_data_is_valid (data_h)) {
+ if (!NNS_EDGE_MAGIC_IS_VALID (ed)) {
nns_edge_loge ("Invalid param, given edge data is invalid.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
int
nns_edge_request (nns_edge_h edge_h, nns_edge_data_h data_h, void *user_data)
{
+ nns_edge_handle_s *eh;
+ nns_edge_data_s *ed;
+
UNUSED (user_data);
+ eh = (nns_edge_handle_s *) edge_h;
+ ed = (nns_edge_data_s *) data_h;
- if (!nns_edge_handle_is_valid (edge_h)) {
+ if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
nns_edge_loge ("Invalid param, given edge handle is invalid.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
- if (!nns_edge_data_is_valid (data_h)) {
+ if (!NNS_EDGE_MAGIC_IS_VALID (ed)) {
nns_edge_loge ("Invalid param, given edge data is invalid.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
int
nns_edge_subscribe (nns_edge_h edge_h, nns_edge_data_h data_h, void *user_data)
{
+ nns_edge_handle_s *eh;
+
UNUSED (data_h);
UNUSED (user_data);
+ eh = (nns_edge_handle_s *) edge_h;
- if (!nns_edge_handle_is_valid (edge_h)) {
+ if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
nns_edge_loge ("Invalid param, given edge handle is invalid.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
int
nns_edge_unsubscribe (nns_edge_h edge_h)
{
- if (!nns_edge_handle_is_valid (edge_h)) {
+ nns_edge_handle_s *eh;
+
+ eh = (nns_edge_handle_s *) edge_h;
+
+ if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
nns_edge_loge ("Invalid param, given edge handle is invalid.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
eh = (nns_edge_handle_s *) edge_h;
- if (!nns_edge_handle_is_valid (edge_h)) {
+ if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
nns_edge_loge ("Invalid param, given edge handle is invalid.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}