Delete data only from the specified class that has been transmitted and acknowledged by the peer.
MCO_RET mco_iot_replicator_clear_class(mco_iot_replicator_h repl,
mco_iot_agent_id_t agent_id,
uint2 class_code);
repl
agent_id
The device_id to clear or one of the following constants:
MCO_IOT_ALL_AGENTS — Synchronize all connected devices.MCO_IOT_SERVER_AGENT_ID — Denotes the server node.MCO_IOT_ALL_UP_AGENTS — All directly or indirectly connected nodes with a lower level value.MCO_IOT_ALL_DOWN_AGENTS — All directly or indirectly connected nodes with a higher level value.class_code
<database_name>.h header file).The function deletes data only from the specified class that has been
transmitted and acknowledged by the peer; where agent_id is the id of a
specific agent or MCO_IOT_ALL_AGENTS.
MCO_S_OK
MCO_E_IOT_INVALID_HANDLE
repl.MCO_E_IOT_NOT_INITIALIZED
MCO_E_IOT_WRONG_AGENT_ID
agent_id is not valid.MCO_E_ILLEGAL_PARAM
MCO_IOT_SERVER_AGENT_ID cannot be used on the server, or an invalid class_code was used).MCO_E_SESLIMIT
connect() errors if the function can't create a database connection.mco_trans_start() errorsmco_trans_commit() errors
void Clear_Classes(mco_iot_replicator_h iot_replicator)
{
uint2 TempSensor_code = 1;
uint2 WindSensor_code = 2;
rc = mco_iot_replicator_sync(iot_replicator, MCO_IOT_ALL_AGENTS, MCO_IOT_SYNC_BOTH | MCO_IOT_SYNC_WAIT);
CHECK(mco_iot_replicator_clear_class(iot_replicator, MCO_IOT_SERVER_AGENT_ID, TempSensor_code));
CHECK(mco_iot_replicator_clear_class(iot_replicator, MCO_IOT_SERVER_AGENT_ID, WindSensor_code));
}