exos_dataset_delete()

<< 点击显示目录 >>

主页  exOS使用助手 > exOS Automation Help > Development > Programming > exOS Communication API reference (exos_api.h) >

exos_dataset_delete()

释放数据集的所有资源(并断开与数据集消息路由器的连接)

调用语法

EXOS_ERROR_CODE exos_dataset_delete(exos_dataset_handle_t *dataset);

删除(并断开)数据集并释放所有已分配的资源。如果数据集需要重新初始化,或者不再使用,则  应调用exos_dataset_delete()。 如果数据集是连接的(dataset->connection_state == EXOS_STATE_CONNECTED || dataset->connection_state == EXOS_STATE_OPERATIONAL),那么在删除之前,它将被断开连接(exos_dataset_disconnect())。

为了在exos_dataset_delete()之后让已连接的数据集 "重新上线 ",  需要调用exos_dataset_init() 和 exos_dataset_connect() 。

只有在不删除数据模型的情况下专门删除数据集时,才使用该函数。在删除数据模型和所有附加数据集时(例如,在退出程序时),  应使用函数 exos_datamodel_delete()


Release all resources from a dataset (and disconnect from the Dataset Message Router)

Call syntax

EXOS_ERROR_CODE exos_dataset_delete(exos_dataset_handle_t *dataset);

Delete (and disconnect) a dataset and free up all allocated resources. If a dataset needs to be reinitialized, or it should not be used anymore, the exos_dataset_delete() should be called. If the dataset is connected (dataset->connection_state == EXOS_STATE_CONNECTED || dataset->connection_state == EXOS_STATE_OPERATIONAL), it will be disconnected (exos_dataset_disconnect()) before being deleted.

In order to bring a connected dataset "back online" after an exos_dataset_delete(), the exos_dataset_init() and exos_dataset_connect() need to be called.

Only use this function if the dataset should be deleted specifically without deleting the datamodel. When deleting the datamodel and all attached datasets (for example, when exiting a program), the function exos_datamodel_delete() should be used.