# mco_iot_conn_get_agent_id

Return the connection `agent_id`.

### For an overview see page ARF Applications in C

### Prototype

        mco_iot_agent_id_t  mco_iot_conn_get_agent_id(const iot_connection_h iotc);

### Arguments

iotc | The connection handle (`iot_connection_h`)

### Description

This function returns the remote node `agent_id`.

### Return Codes

mco_iot_agent_id_t | The remote node `agent_id`

### Example

        // onConnect callback
        int iot_on_connect(mco_iot_connection_h iotc, void *context)
        {
            mco_iot_agent_id_t agent_id = mco_iot_conn_get_agent_id(iotc);
            ...
            return IOT_CALLBACK_OK;
        }

### Files

Header file:
mcoiot.h
Source file:
mcoiotcomm.c
Library:
libmcoiotcomm.a