From: hyunuk.tak Date: Tue, 29 Mar 2022 08:57:58 +0000 (+0900) Subject: Add some APIs to handle network X-Git-Tag: accepted/tizen/unified/20220914.164046~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62ffc40a1976b5d2487b9d2b01144f07acf225e4;p=platform%2Fcore%2Fapi%2Fthread.git Add some APIs to handle network Change-Id: I727275cc182dd01ee84bbe49c84d8d4dea874732 Signed-off-by: hyunuk.tak --- diff --git a/include/thread.h b/include/thread.h index 8a763c4..7489465 100644 --- a/include/thread.h +++ b/include/thread.h @@ -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 *