Return the connection found by agentId.
iot_connection_h mco_iot_comm_find_conn(mco_iot_comm_h comm,
mco_iot_agent_id_t agent_id);
comm
agent_id
device_id to find.This function returns the connection found by agentId. Note
that the mco_iot_comm_find_conn() and mco_iot_comm_next_conn()
APIs "lock/pin" the connection handle to protect the handle from being
destroyed. When the handle is no longer needed, the "pin" should be
removed by calling mco_iot_conn_release().
The safer way to enumerate active connections (from the "pin/unpin"
standpoint) is to use the mco_iot_replicator_enum_agents() API.
mco_iot_connection_h
agent_id or NULL if none found.
{
...
mco_iot_connection_h conn = mco_iot_comm_find_conn(comm, agent_id);
if (conn)
{
// Do something with connection conn
mco_iot_conn_release(conn);
}
}