TencentCloud / tencentcloud-iot-explorer-sdk-embedded-c

SDK for embedded system connect and comunicate with Tencent Cloud IoT Explorer Platform
Other
113 stars 52 forks source link

MQTT 无法连接 #7

Closed shchen-Lab closed 3 years ago

shchen-Lab commented 3 years ago

各位大牛:

我的自己配网成功无法连接mqtt 请看:

`static int _mqtt_connect(Qcloud_IoT_Client pClient, MQTTConnectParams options) { IOT_FUNC_ENTRY;

Timer    connect_timer;
int      connack_rc = QCLOUD_ERR_FAILURE, rc = QCLOUD_ERR_FAILURE;
uint8_t  sessionPresent = 0;
uint32_t len            = 0;

InitTimer(&connect_timer);
countdown_ms(&connect_timer, pClient->command_timeout_ms);

if (NULL != options) {
    _copy_connect_params(&(pClient->options), options);
}

// TCP or TLS network connect
rc = pClient->network_stack.connect(&(pClient->network_stack));
if (QCLOUD_RET_SUCCESS != rc) {
    printf("pClient->network_stack.connect error\n");
    IOT_FUNC_EXIT_RC(rc);

}`

1611654463(1)