thincloud.h
IoT_Error_t tc_connect(AWS_IoT_Client *client, char *clientId, bool autoReconnect)
{
    IoT_Client_Connect_Params params = iotClientConnectParamsDefault;

    params.keepAliveIntervalInSec = 600;
    params.isCleanSession = true;
    params.MQTTVersion = MQTT_3_1_1;
    params.pClientID = clientId;
    params.clientIDLen = (uint16_t)strlen(clientId);
    params.isWillMsgPresent = false;

    IoT_Error_t rc = aws_iot_mqtt_connect(client, &params);
    if (rc != SUCCESS)
    {
        FUNC_EXIT_RC(rc);
    }

    if (autoReconnect)
    {
        rc = aws_iot_mqtt_autoreconnect_set_status(client, true);
        if (rc != SUCCESS)
        {
            FUNC_EXIT_RC(rc);
        }
    }

    FUNC_EXIT_RC(SUCCESS);
}
/**
 * @brief Start MQTT connection to ThinCloud host
 * 
 * Initialize an MQTT conenction to a thincloud host.
 * 
 * @param[in]  client         AWS IoT MQTT Client instance.
 * @param[in]  clientId       An unique ID for the client instance.
 * @param[in]  autoReconnect  Signals if the MQTT client should attempt to auto-reconnect
 *                            after connection failures.
 * 
 * @return Zero on success, negative value otherwise 
 */
@brief Start MQTT connection to ThinCloud host

Initialize an MQTT conenction to a thincloud host.

@param[in]  client         AWS IoT MQTT Client instance.
@param[in]  clientId       An unique ID for the client instance.
@param[in]  autoReconnect  Signals if the MQTT client should attempt to auto-reconnect
after connection failures.

@return Zero on success, negative value otherwise
@brief Start MQTT connection to ThinCloud host Initialize an MQTT conenction to a thincloud host . @param [ in ] client AWS IoT MQTT Client instance . @param [ in ] clientId An unique ID for the client instance . @param [ in ] autoReconnect Signals if the MQTT client should attempt to auto - reconnect after connection failures . @return Zero on success negative value otherwise
IoT_Error_t tc_connect(AWS_IoT_Client *client, char *clientId, bool autoReconnect)
{
    IoT_Client_Connect_Params params = iotClientConnectParamsDefault;
    params.keepAliveIntervalInSec = 600;
    params.isCleanSession = true;
    params.MQTTVersion = MQTT_3_1_1;
    params.pClientID = clientId;
    params.clientIDLen = (uint16_t)strlen(clientId);
    params.isWillMsgPresent = false;
    IoT_Error_t rc = aws_iot_mqtt_connect(client, &params);
    if (rc != SUCCESS)
    {
        FUNC_EXIT_RC(rc);
    }
    if (autoReconnect)
    {
        rc = aws_iot_mqtt_autoreconnect_set_status(client, true);
        if (rc != SUCCESS)
        {
            FUNC_EXIT_RC(rc);
        }
    }
    FUNC_EXIT_RC(SUCCESS);
}
IoT_Error_t tc_connect ( AWS_IoT_Client * client , char * clientId , bool autoReconnect ) { IoT_Client_Connect_Params params = iotClientConnectParamsDefault ; params . keepAliveIntervalInSec = 600 ; params . isCleanSession = true ; params . MQTTVersion = MQTT_3_1_1 ; params . pClientID = clientId ; params . clientIDLen = ( uint16_t ) strlen ( clientId ) ; params . isWillMsgPresent = false ; IoT_Error_t rc = aws_iot_mqtt_connect ( client , & params ) ; if ( rc != SUCCESS ) { FUNC_EXIT_RC ( rc ) ; } if ( autoReconnect ) { rc = aws_iot_mqtt_autoreconnect_set_status ( client , true ) ; if ( rc != SUCCESS ) { FUNC_EXIT_RC ( rc ) ; } } FUNC_EXIT_RC ( SUCCESS ) ; }
@brief Start MQTT connection to ThinCloud host
@brief Start MQTT connection to ThinCloud host