Common error codes

Updated at:

This topic describes common errors that occur when you configure the device connection feature of the C Link software development kit (SDK).

You can check the internal running status of a device to identify the cause of a connection failure in two ways:

  • Return value

  • The SDK calls your log callback function.

The following table lists common error codes. For a complete list of error codes, see aiot_state_api.h.

MQTT connection

Error code

Value

Description

STATE_MQTT_CONNACK_RCODE_SERVER_UNAVAILABLE

-0x0303

The MQTT server rejected the connection. The service is unavailable. Retry later or submit a ticket.

STATE_MQTT_CONNACK_RCODE_BAD_USERNAME_PASSWORD

-0x0304

The username or password for the connection is invalid. Submit a ticket.

STATE_MQTT_CONNACK_RCODE_NOT_AUTHORIZED

-0x0305

The MQTT server failed to perform identity verification for the connection. The logon password is incorrect. Check whether the device authentication information is correct.

Network layer

Error code

Value

Description

STATE_PORT_NETWORK_DNS_FAILED

-0x0F05

TCP domain name resolution failed. Check whether the domain name or IP address is correct.

STATE_PORT_NETWORK_CONNECT_FAILED

-0x0F0C

Failed to establish a TCP connection. Submit a ticket.

STATE_PORT_TLS_INVALID_MAX_FRAGMENT

-0x0F0B

The maximum length of a TLS message is set to 0. This setting is invalid. Check the setting and try again.

STATE_PORT_TLS_INVALID_SERVER_CERT

-0x0F14

The TLS server-side certificate is incorrectly configured. Check whether the server-side certificate is correct.

STATE_PORT_TLS_INVALID_CLIENT_CERT

-0x0F15

The TLS device-side certificate is incorrectly configured. Check whether the client certificate is correct.

STATE_PORT_TLS_INVALID_CLIENT_KEY

-0x0F16

The TLS client key is incorrectly configured. Check whether the client key is correct.

STATE_PORT_TLS_DNS_FAILED

-0x0F17

TLS domain name resolution failed. Check whether the domain name or IP address is correctly configured.

STATE_PORT_TLS_SOCKET_CREATE_FAILED

-0x0F18

Failed to create a TLS socket. Submit a ticket.

STATE_PORT_TLS_SOCKET_CONNECT_FAILED

-0x0F19

Failed to connect to the TLS socket. Submit a ticket.

STATE_PORT_TLS_INVALID_RECORD

-0x0F1A

An error occurred in the received SSL packet. Check whether the length of the TLS frame data is too small.