[Edge] Remove unnecessary functions. accepted/tizen/unified/20220825.053127 submit/tizen/20220825.022456
authorgichan <gichan2.jang@samsung.com>
Wed, 24 Aug 2022 07:38:12 +0000 (16:38 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Wed, 24 Aug 2022 09:29:16 +0000 (18:29 +0900)
Remove unnecessary functions (sub, unsub).
@todo: nns_edge_publish will be renamed.

Signed-off-by: gichan <gichan2.jang@samsung.com>
include/nnstreamer-edge.h
src/libnnstreamer-edge/nnstreamer-edge-internal.c
tests/unittest_nnstreamer-edge.cc

index eada0e687027053b4bda420b7715db2868843a98..da471887142d5cf721fdbebea4049d14f1c9ef6a 100644 (file)
@@ -129,16 +129,6 @@ int nns_edge_disconnect (nns_edge_h edge_h);
  */
 int nns_edge_publish (nns_edge_h edge_h, nns_edge_data_h data_h);
 
-/**
- * @brief Subscribe a message from broker.
- */
-int nns_edge_subscribe (nns_edge_h edge_h);
-
-/**
- * @brief Unsubscribe a message.
- */
-int nns_edge_unsubscribe (nns_edge_h edge_h);
-
 /**
  * @brief Set nnstreamer edge info.
  * @note The param key is case-insensitive. If same key string already exists, it will replace the old value.
index d55639cbebdfc241171c291bf6e12b960e226425..bcd34cdc6cab2b56f37eb5d8b838cef31dbfc55a 100644 (file)
@@ -1423,90 +1423,6 @@ nns_edge_publish (nns_edge_h edge_h, nns_edge_data_h data_h)
   return ret;
 }
 
-/**
- * @brief Subscribe a message from broker.
- */
-int
-nns_edge_subscribe (nns_edge_h edge_h)
-{
-  nns_edge_handle_s *eh;
-  int ret = NNS_EDGE_ERROR_NONE;
-
-  eh = (nns_edge_handle_s *) edge_h;
-  if (!eh) {
-    nns_edge_loge ("Invalid param, given edge handle is null.");
-    return NNS_EDGE_ERROR_INVALID_PARAMETER;
-  }
-
-  nns_edge_lock (eh);
-
-  if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
-    nns_edge_loge ("Invalid param, given edge handle is invalid.");
-    ret = NNS_EDGE_ERROR_INVALID_PARAMETER;
-    goto done;
-  }
-
-  if (eh->connect_type != NNS_EDGE_CONNECT_TYPE_MQTT) {
-    nns_edge_loge ("Invalid connect type, cannot subscribe a message.");
-    ret = NNS_EDGE_ERROR_INVALID_PARAMETER;
-    goto done;
-  }
-
-  if (!STR_IS_VALID (eh->topic)) {
-    nns_edge_loge ("Invalid topic, cannot subscribe a message.");
-    ret = NNS_EDGE_ERROR_INVALID_PARAMETER;
-    goto done;
-  }
-
-  /** @todo update code (subscribe) */
-
-done:
-  nns_edge_unlock (eh);
-  return ret;
-}
-
-/**
- * @brief Unsubscribe a message.
- */
-int
-nns_edge_unsubscribe (nns_edge_h edge_h)
-{
-  nns_edge_handle_s *eh;
-  int ret = NNS_EDGE_ERROR_NONE;
-
-  eh = (nns_edge_handle_s *) edge_h;
-  if (!eh) {
-    nns_edge_loge ("Invalid param, given edge handle is null.");
-    return NNS_EDGE_ERROR_INVALID_PARAMETER;
-  }
-
-  nns_edge_lock (eh);
-
-  if (!NNS_EDGE_MAGIC_IS_VALID (eh)) {
-    nns_edge_loge ("Invalid param, given edge handle is invalid.");
-    ret = NNS_EDGE_ERROR_INVALID_PARAMETER;
-    goto done;
-  }
-
-  if (eh->connect_type != NNS_EDGE_CONNECT_TYPE_MQTT) {
-    nns_edge_loge ("Invalid connect type, cannot subscribe a message.");
-    ret = NNS_EDGE_ERROR_INVALID_PARAMETER;
-    goto done;
-  }
-
-  if (!STR_IS_VALID (eh->topic)) {
-    nns_edge_loge ("Invalid topic, cannot subscribe a message.");
-    ret = NNS_EDGE_ERROR_INVALID_PARAMETER;
-    goto done;
-  }
-
-  /** @todo update code (unsubscribe) */
-
-done:
-  nns_edge_unlock (eh);
-  return ret;
-}
-
 /**
  * @brief Set nnstreamer edge info.
  */
index 04ba730322a83685d4c2efb730a38692a94558e4..e49373fef14c6b3c59dbacfa14b6f70dbd9e4412 100644 (file)
@@ -758,78 +758,6 @@ TEST(edge, publishInvalidParam04_n)
   EXPECT_EQ (ret, NNS_EDGE_ERROR_NONE);\r
 }\r
 \r
-/**\r
- * @brief Subscribe - invalid param.\r
- */\r
-TEST(edge, subscribeInvalidParam01_n)\r
-{\r
-  int ret;\r
-\r
-  ret = nns_edge_subscribe (NULL);\r
-  EXPECT_NE (ret, NNS_EDGE_ERROR_NONE);\r
-}\r
-\r
-/**\r
- * @brief Subscribe - invalid param.\r
- */\r
-TEST(edge, subscribeInvalidParam02_n)\r
-{\r
-  nns_edge_h edge_h;\r
-  nns_edge_handle_s *eh;\r
-  int ret;\r
-\r
-  ret = nns_edge_create_handle ("temp-id", NNS_EDGE_CONNECT_TYPE_TCP,\r
-      (NNS_EDGE_FLAG_RECV | NNS_EDGE_FLAG_SEND), &edge_h);\r
-  EXPECT_EQ (ret, NNS_EDGE_ERROR_NONE);\r
-\r
-  eh = (nns_edge_handle_s *) edge_h;\r
-  eh->magic = NNS_EDGE_MAGIC_DEAD;\r
-\r
-  ret = nns_edge_subscribe (edge_h);\r
-  EXPECT_NE (ret, NNS_EDGE_ERROR_NONE);\r
-\r
-  eh->magic = NNS_EDGE_MAGIC;\r
-\r
-  ret = nns_edge_release_handle (edge_h);\r
-  EXPECT_EQ (ret, NNS_EDGE_ERROR_NONE);\r
-}\r
-\r
-/**\r
- * @brief Unsubscribe - invalid param.\r
- */\r
-TEST(edge, unsubscribeInvalidParam01_n)\r
-{\r
-  int ret;\r
-\r
-  ret = nns_edge_unsubscribe (NULL);\r
-  EXPECT_NE (ret, NNS_EDGE_ERROR_NONE);\r
-}\r
-\r
-/**\r
- * @brief Unsubscribe - invalid param.\r
- */\r
-TEST(edge, unsubscribeInvalidParam02_n)\r
-{\r
-  nns_edge_h edge_h;\r
-  nns_edge_handle_s *eh;\r
-  int ret;\r
-\r
-  ret = nns_edge_create_handle ("temp-id", NNS_EDGE_CONNECT_TYPE_TCP,\r
-      (NNS_EDGE_FLAG_RECV | NNS_EDGE_FLAG_SEND), &edge_h);\r
-  EXPECT_EQ (ret, NNS_EDGE_ERROR_NONE);\r
-\r
-  eh = (nns_edge_handle_s *) edge_h;\r
-  eh->magic = NNS_EDGE_MAGIC_DEAD;\r
-\r
-  ret = nns_edge_unsubscribe (edge_h);\r
-  EXPECT_NE (ret, NNS_EDGE_ERROR_NONE);\r
-\r
-  eh->magic = NNS_EDGE_MAGIC;\r
-\r
-  ret = nns_edge_release_handle (edge_h);\r
-  EXPECT_EQ (ret, NNS_EDGE_ERROR_NONE);\r
-}\r
-\r
 /**\r
  * @brief Set info - invalid param.\r
  */\r