Cette rubrique répertorie les codes d'erreur courants renvoyés par le C Link SDK en cas d'échec de connexion des appareils. Elle couvre les erreurs MQTT, HTTPS et celles liées au réseau.
En cas d'échec de connexion, le Link SDK signale son état interne de deux manières :
-
L'API renvoie un code d'état, entier non positif de type
int32_t. La valeur0indique un succès ; toute autre valeur indique l'état d'exécution.Récupérez la valeur de retour avec le format
retval = aiot_xxx_yyy().Chaque valeur de retour correspond à une branche d'exécution interne unique. Pour plus d'informations, consultez les fichiers
aiot_state_api.houaiot_xxx_api.h.Les plages de valeurs de retour de tous les composants sont disjointes. Elles s'étendent de 0x0000 à
0xFFFF.
Le SDK appelle votre fonction de rappel de journalisation.
Les tableaux suivants répertorient les codes d'erreur courants. Tous ces codes sont définis dans aiot_state_api.h.
Accès MQTT
|**Code d'erreur**
|
**Description**
| | --- | --- | |
[STATE_MQTT_CONNACK_RCODE_SERVER_UNAVAILABLE](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a9b91df476086fe57733751b4bd0846b4)
|
Le serveur MQTT a refusé la connexion. Service indisponible. Réessayez ultérieurement.
| |
[STATE_MQTT_CONNACK_RCODE_BAD_USERNAME_PASSWORD](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#aca297f1342d9e8411a649296a3929d83)
|
Nom d'utilisateur ou mot de passe incorrect.
| |
[STATE_MQTT_CONNACK_RCODE_NOT_AUTHORIZED](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a9e8c02ab8e8ed5c91a61bb94d913bc5d)
|
Échec de la vérification de l'identité du serveur MQTT. Mot de passe incorrect. Vérifiez les informations d'authentification de l'appareil.
|
Accès HTTPS
|**Code d'erreur**
|
**Description**
| | --- | --- | |
[STATE_HTTP_STATUS_LINE_INVALID](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#adb02f0ac9c88ab811dba65250e250ee7)
|
Ligne d'état incorrecte dans la réponse HTTPS. Impossible de récupérer le `StatusCode`.
| |
[STATE_HTTP_READ_BODY_FINISHED](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a56eff6e12e2ddc6159853be8337f5d04)
|
Corps du message HTTPS entièrement reçu, mais aucune donnée supplémentaire n'est disponible.
| |
[STATE_HTTP_AUTH_CODE_FAILED](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a875b6e77568d6fc3d6a560e3b89913b3)
|
L'authentification HTTPS a renvoyé un code d'état différent de 200. Vérifiez la signature d'authentification.
| |
[STATE_HTTP_AUTH_NOT_FINISHED](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a4a9de11979fa4d9f598a061a2d89048d)
|
Réponse d'authentification HTTPS incomplète. Échec de l'authentification.
| |
[STATE_HTTP_AUTH_TOKEN_FAILED](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a900fb581d2f1ac1c445b1068243eba3b)
|
Échec de l'analyse du jeton dans la réponse d'authentification HTTPS.
|
Couche réseau
|**Code d'erreur**
|
**Description**
| | --- | --- | |
[STATE_PORT_NETWORK_DNS_FAILED](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a5ca34fdf0da40337984d728bc994704f)
|
Échec de la résolution DNS TCP. Vérifiez le nom de domaine ou l'adresse IP.
| |
[STATE_PORT_NETWORK_CONNECT_FAILED](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#ae554bd1d170cf2d8f4c79b39d753ba1b)
|
Échec de l'établissement d'une connexion TCP.
| |
[STATE_PORT_TLS_INVALID_MAX_FRAGMENT](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a85ca16ec9d5eebd8ee737f0ed226be7f)
|
La longueur maximale du message TLS est définie sur 0, ce qui est incorrect. Réinitialisez la valeur.
| |
[STATE_PORT_TLS_INVALID_SERVER_CERT](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#aa52309160643956c68dd26f000f65f54)
|
Configuration du certificat de serveur TLS incorrecte. Vérifiez le certificat du serveur.
| |
[STATE_PORT_TLS_INVALID_CLIENT_CERT](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a7985731192281972ae68366debd03e04)
|
Configuration du certificat client TLS incorrecte. Vérifiez le certificat client.
| |
[STATE_PORT_TLS_INVALID_CLIENT_KEY](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a78d3dc41dadc98cc1b0eaedee015b39f)
|
Configuration de la clé client TLS incorrecte. Vérifiez la clé client.
| |
[STATE_PORT_TLS_DNS_FAILED](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a0c3aa78a5698bd7baa6aec7236d8c787)
|
Échec de la résolution DNS TLS. Vérifiez le nom de domaine ou l'adresse IP.
| |
[STATE_PORT_TLS_SOCKET_CREATE_FAILED](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a7510a3897dfd4456bf336cedbaed1a2d)
|
Échec de la création du socket TLS.
| |
[STATE_PORT_TLS_SOCKET_CONNECT_FAILED](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#aca598d841a74dad550638d57d0b12523)
|
Échec de la connexion du socket TLS.
| |
[STATE_PORT_TLS_INVALID_RECORD](https://gaic.alicdn.com/ztms/linkkit/html/aiot__state__api_8h.html#a914601c3e05fefc50a0042821c958c96)
|
Réception d'un paquet SSL incorrect. Vérifiez si la longueur des données de trame TLS est trop faible.
|