Lists common error codes returned by the C Link SDK when device connections fail, covering MQTT, HTTPS, and network layer errors.
When a connection fails, the Link SDK reports its internal status in two ways:
-
The API returns a status code, which is a non-positive integer of type
int32_t. A value of0indicates success and other values indicate the runtime status.Use the
retval = aiot_xxx_yyy()format to retrieve the return value.Each return value corresponds to a unique internal execution branch. For more information, see
aiot_state_api.horaiot_xxx_api.h.The return value ranges for all components do not overlap. They are distributed within the range of 0x0000 to
0xFFFF.
-
The SDK calls your log callback function.
The following tables list common error codes. All codes are defined in aiot_state_api.h.
MQTT access
|
Error code |
Description |
|
MQTT server denied the connection. Service unavailable. Retry later. |
|
|
Invalid username or password. |
|
|
MQTT server identity verification failed. Incorrect password. Verify the device authentication information. |
HTTPS access
|
Error code |
Description |
|
Invalid status line in the HTTPS response. The |
|
|
HTTPS message body fully received, but no further data is available. |
|
|
HTTPS authentication returned a non-200 status code. Verify the authentication signature. |
|
|
Incomplete HTTPS authentication response. Authentication failed. |
|
|
Failed to parse the token from the HTTPS authentication response. |
Network layer
|
Error code |
Description |
|
TCP DNS resolution failed. Verify the domain name or IP address. |
|
|
Failed to establish a TCP connection. |
|
|
TLS maximum message length is set to 0, which is invalid. Reset the value. |
|
|
Invalid TLS server certificate configuration. Verify the server certificate. |
|
|
Invalid TLS client certificate configuration. Verify the client certificate. |
|
|
Invalid TLS client key configuration. Verify the client key. |
|
|
TLS DNS resolution failed. Verify the domain name or IP address. |
|
|
Failed to create the TLS socket. |
|
|
Failed to connect the TLS socket. |
|
|
Invalid SSL packet received. Check whether the TLS frame data length is too small. |