Add some APIs to handle network 28/273128/1
authorhyunuk.tak <hyunuk.tak@samsung.com>
Tue, 29 Mar 2022 08:57:58 +0000 (17:57 +0900)
committerhyunuk.tak <hyunuk.tak@samsung.com>
Thu, 31 Mar 2022 00:58:53 +0000 (09:58 +0900)
Change-Id: I727275cc182dd01ee84bbe49c84d8d4dea874732
Signed-off-by: hyunuk.tak <hyunuk.tak@samsung.com>
include/thread.h

index 8a763c4..7489465 100644 (file)
@@ -566,6 +566,156 @@ int thread_br_remove_onmesh_prefix(thread_instance_h instance, thread_onmesh_pre
 
 /**
  * @ingroup CAPI_NETWORK_THREAD_NETWORK_MODULE
+ * @brief Create thread network
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE  Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ */
+int thread_network_create(thread_network_h *network);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_NETWORK_MODULE
+ * @brief Destroy thread network
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE  Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ */
+int thread_network_destroy(thread_network_h network);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_NETWORK_MODULE
+ * @brief Set the thread network name
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE  Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ */
+int thread_network_set_name(thread_network_h network, const char *name);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_NETWORK_MODULE
+ * @brief Set the thread network key
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE  Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ */
+int thread_network_set_key(thread_network_h network, const char *key);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_NETWORK_MODULE
+ * @brief Set the thread network pskc
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE  Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ */
+int thread_network_set_pskc(thread_network_h network, const char *pskc);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_NETWORK_MODULE
+ * @brief Set the thread network channel
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE  Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ */
+int thread_network_set_channel(thread_network_h network, uint32_t channel);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_NETWORK_MODULE
+ * @brief Set the thread network extended pan id
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE  Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ */
+int thread_network_set_extended_panid(thread_network_h network, uint64_t extended_panid);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_NETWORK_MODULE
+ * @brief Set the thread network pan id
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE  Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ */
+int thread_network_set_panid(thread_network_h network, uint64_t panid);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_NETWORK_MODULE
+ * @brief Set the thread network to instance
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE  Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ */
+int thread_set_operational_network(thread_instance_h instance, thread_network_h network);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_NETWORK_MODULE
+ * @brief Unset the thread network from instance
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE  Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ */
+int thread_unset_operational_network(thread_instance_h instance);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_NETWORK_MODULE
  * @brief Form an operational Thread Network
  * @since_tizen 7.0
  *