AWS IoT Embedded C Device SDK
Macros | Enumerations
aws_iot_error.h File Reference

Definition of error types for the SDK. More...

Go to the source code of this file.

Macros

#define IOT_UNUSED(x)   (void)(x)
 

Enumerations

enum  IoT_Error_t {
  NETWORK_PHYSICAL_LAYER_CONNECTED = 6, NETWORK_MANUALLY_DISCONNECTED = 5, NETWORK_ATTEMPTING_RECONNECT = 4, NETWORK_RECONNECTED = 3,
  MQTT_NOTHING_TO_READ = 2, MQTT_CONNACK_CONNECTION_ACCEPTED = 1, SUCCESS = 0, FAILURE = -1,
  NULL_VALUE_ERROR = -2, TCP_CONNECTION_ERROR = -3, SSL_CONNECTION_ERROR = -4, TCP_SETUP_ERROR = -5,
  NETWORK_SSL_CONNECT_TIMEOUT_ERROR = -6, NETWORK_SSL_WRITE_ERROR = -7, NETWORK_SSL_INIT_ERROR = -8, NETWORK_SSL_CERT_ERROR = -9,
  NETWORK_SSL_WRITE_TIMEOUT_ERROR = -10, NETWORK_SSL_READ_TIMEOUT_ERROR = -11, NETWORK_SSL_READ_ERROR = -12, NETWORK_DISCONNECTED_ERROR = -13,
  NETWORK_RECONNECT_TIMED_OUT_ERROR = -14, NETWORK_ALREADY_CONNECTED_ERROR = -15, NETWORK_MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED = -16, NETWORK_SSL_UNKNOWN_ERROR = -17,
  NETWORK_PHYSICAL_LAYER_DISCONNECTED = -18, NETWORK_X509_ROOT_CRT_PARSE_ERROR = -19, NETWORK_X509_DEVICE_CRT_PARSE_ERROR = -20, NETWORK_PK_PRIVATE_KEY_PARSE_ERROR = -21,
  NETWORK_ERR_NET_SOCKET_FAILED = -22, NETWORK_ERR_NET_UNKNOWN_HOST = -23, NETWORK_ERR_NET_CONNECT_FAILED = -24, NETWORK_SSL_NOTHING_TO_READ = -25,
  MQTT_CONNECTION_ERROR = -26, MQTT_CONNECT_TIMEOUT_ERROR = -27, MQTT_REQUEST_TIMEOUT_ERROR = -28, MQTT_UNEXPECTED_CLIENT_STATE_ERROR = -29,
  MQTT_CLIENT_NOT_IDLE_ERROR = -30, MQTT_RX_MESSAGE_PACKET_TYPE_INVALID_ERROR = -31, MQTT_RX_BUFFER_TOO_SHORT_ERROR = -32, MQTT_TX_BUFFER_TOO_SHORT_ERROR = -33,
  MQTT_MAX_SUBSCRIPTIONS_REACHED_ERROR = -34, MQTT_DECODE_REMAINING_LENGTH_ERROR = -35, MQTT_CONNACK_UNKNOWN_ERROR = -36, MQTT_CONNACK_UNACCEPTABLE_PROTOCOL_VERSION_ERROR = -37,
  MQTT_CONNACK_IDENTIFIER_REJECTED_ERROR = -38, MQTT_CONNACK_SERVER_UNAVAILABLE_ERROR = -39, MQTT_CONNACK_BAD_USERDATA_ERROR = -40, MQTT_CONNACK_NOT_AUTHORIZED_ERROR = -41,
  JSON_PARSE_ERROR = -42, SHADOW_WAIT_FOR_PUBLISH = -43, SHADOW_JSON_BUFFER_TRUNCATED = -44, SHADOW_JSON_ERROR = -45,
  MUTEX_INIT_ERROR = -46, MUTEX_LOCK_ERROR = -47, MUTEX_UNLOCK_ERROR = -48, MUTEX_DESTROY_ERROR = -49
}
 IoT Error enum. More...
 

Enumeration Type Documentation

Enumeration of return values from the IoT_* functions within the SDK. Values less than -1 are specific error codes Value of -1 is a generic failure response Value of 0 is a generic success response Values greater than 0 are specific non-error return codes

Enumerator
NETWORK_PHYSICAL_LAYER_CONNECTED 

Returned when the Network physical layer is connected

NETWORK_MANUALLY_DISCONNECTED 

Returned when the Network is manually disconnected

NETWORK_ATTEMPTING_RECONNECT 

Returned when the Network is disconnected and the reconnect attempt is in progress

NETWORK_RECONNECTED 

Return value of yield function to indicate auto-reconnect was successful

MQTT_NOTHING_TO_READ 

Returned when a read attempt is made on the TLS buffer and it is empty

MQTT_CONNACK_CONNECTION_ACCEPTED 

Returned when a connection request is successful and packet response is connection accepted

SUCCESS 

Success return value - no error occurred

FAILURE 

A generic error. Not enough information for a specific error code

NULL_VALUE_ERROR 

A required parameter was passed as null

TCP_CONNECTION_ERROR 

The TCP socket could not be established

SSL_CONNECTION_ERROR 

The TLS handshake failed

TCP_SETUP_ERROR 

Error associated with setting up the parameters of a Socket

NETWORK_SSL_CONNECT_TIMEOUT_ERROR 

A timeout occurred while waiting for the TLS handshake to complete.

NETWORK_SSL_WRITE_ERROR 

A Generic write error based on the platform used

NETWORK_SSL_INIT_ERROR 

SSL initialization error at the TLS layer

NETWORK_SSL_CERT_ERROR 

An error occurred when loading the certificates. The certificates could not be located or are incorrectly formatted.

NETWORK_SSL_WRITE_TIMEOUT_ERROR 

SSL Write times out

NETWORK_SSL_READ_TIMEOUT_ERROR 

SSL Read times out

NETWORK_SSL_READ_ERROR 

A Generic error based on the platform used

NETWORK_DISCONNECTED_ERROR 

Returned when the Network is disconnected and reconnect is either disabled or physical layer is disconnected

NETWORK_RECONNECT_TIMED_OUT_ERROR 

Returned when the Network is disconnected and the reconnect attempt has timed out

NETWORK_ALREADY_CONNECTED_ERROR 

Returned when the Network is already connected and a connection attempt is made

NETWORK_MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED 

Network layer Error Codes Network layer Random number generator seeding failed

NETWORK_SSL_UNKNOWN_ERROR 

A generic error code for Network layer errors

NETWORK_PHYSICAL_LAYER_DISCONNECTED 

Returned when the physical layer is disconnected

NETWORK_X509_ROOT_CRT_PARSE_ERROR 

Returned when the root certificate is invalid

NETWORK_X509_DEVICE_CRT_PARSE_ERROR 

Returned when the device certificate is invalid

NETWORK_PK_PRIVATE_KEY_PARSE_ERROR 

Returned when the private key failed to parse

NETWORK_ERR_NET_SOCKET_FAILED 

Returned when the network layer failed to open a socket

NETWORK_ERR_NET_UNKNOWN_HOST 

Returned when the server is unknown

NETWORK_ERR_NET_CONNECT_FAILED 

Returned when connect request failed

NETWORK_SSL_NOTHING_TO_READ 

Returned when there is nothing to read in the TLS read buffer

MQTT_CONNECTION_ERROR 

A connection could not be established.

MQTT_CONNECT_TIMEOUT_ERROR 

A timeout occurred while waiting for the TLS handshake to complete

MQTT_REQUEST_TIMEOUT_ERROR 

A timeout occurred while waiting for the TLS request complete

MQTT_UNEXPECTED_CLIENT_STATE_ERROR 

The current client state does not match the expected value

MQTT_CLIENT_NOT_IDLE_ERROR 

The client state is not idle when request is being made

MQTT_RX_MESSAGE_PACKET_TYPE_INVALID_ERROR 

The MQTT RX buffer received corrupt or unexpected message

MQTT_RX_BUFFER_TOO_SHORT_ERROR 

The MQTT RX buffer received a bigger message. The message will be dropped

MQTT_TX_BUFFER_TOO_SHORT_ERROR 

The MQTT TX buffer is too short for the outgoing message. Request will fail

MQTT_MAX_SUBSCRIPTIONS_REACHED_ERROR 

The client is subscribed to the maximum possible number of subscriptions

MQTT_DECODE_REMAINING_LENGTH_ERROR 

Failed to decode the remaining packet length on incoming packet

MQTT_CONNACK_UNKNOWN_ERROR 

Connect request failed with the server returning an unknown error

MQTT_CONNACK_UNACCEPTABLE_PROTOCOL_VERSION_ERROR 

Connect request failed with the server returning an unacceptable protocol version error

MQTT_CONNACK_IDENTIFIER_REJECTED_ERROR 

Connect request failed with the server returning an identifier rejected error

MQTT_CONNACK_SERVER_UNAVAILABLE_ERROR 

Connect request failed with the server returning an unavailable error

MQTT_CONNACK_BAD_USERDATA_ERROR 

Connect request failed with the server returning a bad userdata error

MQTT_CONNACK_NOT_AUTHORIZED_ERROR 

Connect request failed with the server failing to authenticate the request

JSON_PARSE_ERROR 

An error occurred while parsing the JSON string. Usually malformed JSON.

SHADOW_WAIT_FOR_PUBLISH 

Shadow: The response Ack table is currently full waiting for previously published updates

SHADOW_JSON_BUFFER_TRUNCATED 

Any time an snprintf writes more than size value, this error will be returned

SHADOW_JSON_ERROR 

Any time an snprintf encounters an encoding error or not enough space in the given buffer

MUTEX_INIT_ERROR 

Mutex initialization failed

MUTEX_LOCK_ERROR 

Mutex lock request failed

MUTEX_UNLOCK_ERROR 

Mutex unlock request failed

MUTEX_DESTROY_ERROR 

Mutex destroy failed