Return the level of the specified node.
MCO_RET mco_iot_replicator_get_level(mco_iot_replicator_h repl,
uint2 *level);
repl
level
level to be returned.This function returns the level of the specified replicator: 1 for server, 65535 for a device.
MCO_S_OK
level was successfully returned.MCO_E_IOT_INVALID_HANDLE
repl.MCO_E_IOT_NOT_INITIALIZED
MCO_E_ILLEGAL_PARAM
level is NULL.
{
mco_iot_comm_h comm;
mco_iot_replicator_h repl;
mco_iot_comm_params_t comm_params;
mco_iot_replicator_params_t repl_params;
iot_comm_callback_t device_cbs = {&on_connect, 0, 0, &on_disconnect, &on_destroy};
mco_iot_agent_id_t agent_id;
uint2 level;
...
mco_iot_comm_params_init(&comm_params);
CHECK(mco_iot_comm_create(&comm_params, &comm));
CHECK(mco_iot_comm_register_callback(comm, &device_cbs, 0));
mco_iot_replicator_params_init(&repl_params);
CHECK(mco_iot_replicator_create(db, comm, &repl_params, &repl));
CHECK(mco_iot_replicator_get_agent_id(repl, &agent_id));
CHECK(mco_iot_replicator_get_level(repl, &level));
...
}