#define THREAD_SRP_SERVER_STOP_CMD "srp server disable"
#define THREAD_SRP_SERVER_SERVICE_CMD "srp server service"
#define THREAD_SRP_CLIENT_REGISTER_SERVICE_CMD "srp client service add"
+#define THREAD_SRP_CLIENT_REMOVE_SERVICE_CMD "srp client service remove"
#define THREAD_SRP_CLIENT_SET_HOST_ADDRESS_CMD "srp client host address"
#define THREAD_SRP_CLIENT_SET_HOST_NAME_CMD "srp client host name"
#define THREAD_SRP_CLIENT_REMOVE_HOST_CMD "srp client host remove"
/**
* @ingroup CAPI_NETWORK_THREAD_SRP_MODULE
+ * @brief Remove Service from SRP server
+ * @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().
+ * @see thread_srp_client_start()
+ * @see thread_srp_client_set_host_address()
+ * @see thread_srp_client_register_service()
+ */
+int thread_srp_client_remove_service(thread_instance_h instance,
+ const char *service_name, const char *service_type);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_SRP_MODULE
* @brief Start SRP Server
* @since_tizen 7.0
*
return ret;
}
+int thread_srp_client_remove_service(thread_instance_h instance,
+ const char *service_name, const char *service_type)
+{
+ FUNC_ENTRY;
+ THREAD_CHECK_SUPPORTED_FEATURE(THREAD_FEATURE_COMMON);
+ THREAD_VALIDATE_INPUT_PARAMETER(service_name);
+ THREAD_CHECK_INIT_STATUS();
+ THREAD_VALIDATE_INPUT_PARAMETER(instance);
+ int ret = THREAD_ERROR_NONE;
+
+ /* Remove SRP service */
+ const char *msg = THREAD_SRP_CLIENT_REMOVE_SERVICE_CMD;
+
+ char buffer[THREAD_MAX_BUFFER_SIZE] = {0};
+ snprintf(buffer, sizeof(buffer), "%s %s %s", msg,
+ service_name, service_type);
+ ret = _thread_socket_client_execute(_thread_get_socket_fd(),
+ buffer, strlen(buffer));
+ if (ret != THREAD_ERROR_NONE && ret != THREAD_ERROR_ALREADY_DONE) {
+ THREAD_DBG("socket srp_client_remove_service execute failed");
+ return ret;
+ }
+ THREAD_DBG("socket srp_client_remove_service execute successful");
+
+ FUNC_EXIT;
+ return ret;
+}
+
int thread_srp_server_start(thread_instance_h instance)
{
FUNC_ENTRY;