Google Cloud IoT device SDK for embedded C  1.0.2
iotc_error.h
Go to the documentation of this file.
1 /* Copyright 2018-2020 Google LLC
2  *
3  * This is part of the Google Cloud IoT Device SDK for Embedded C.
4  * It is licensed under the BSD 3-Clause license; you may not use this file
5  * except in compliance with the License.
6  *
7  * You may obtain a copy of the License at:
8  * https://opensource.org/licenses/BSD-3-Clause
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __IOTC_ERROR_H__
18 #define __IOTC_ERROR_H__
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
32 typedef enum { IOTC_STATE_OK = 0, IOTC_STATE_TIMEOUT, IOTC_STATE_WANT_READ, IOTC_STATE_WANT_WRITE, IOTC_STATE_WRITTEN, IOTC_STATE_FAILED_WRITING, IOTC_BACKOFF_TERMINAL, IOTC_OUT_OF_MEMORY, IOTC_SOCKET_INITIALIZATION_ERROR, IOTC_SOCKET_GETHOSTBYNAME_ERROR, IOTC_SOCKET_GETSOCKOPT_ERROR, IOTC_SOCKET_ERROR, IOTC_SOCKET_CONNECTION_ERROR, IOTC_SOCKET_SHUTDOWN_ERROR, IOTC_SOCKET_WRITE_ERROR, IOTC_SOCKET_READ_ERROR, IOTC_SOCKET_NO_ACTIVE_CONNECTION_ERROR, IOTC_CONNECTION_RESET_BY_PEER_ERROR, IOTC_FD_HANDLER_NOT_FOUND, IOTC_TLS_INITALIZATION_ERROR, IOTC_TLS_FAILED_LOADING_CERTIFICATE, IOTC_TLS_CONNECT_ERROR, IOTC_TLS_WRITE_ERROR, IOTC_TLS_READ_ERROR, IOTC_MQTT_SERIALIZER_ERROR, IOTC_MQTT_PARSER_ERROR, IOTC_MQTT_UNKNOWN_MESSAGE_ID, IOTC_MQTT_LOGIC_UNKNOWN_TASK_ID, IOTC_MQTT_LOGIC_WRONG_SCENARIO_TYPE, IOTC_MQTT_LOGIC_WRONG_MESSAGE_RECEIVED, IOTC_MQTT_UNACCEPTABLE_PROTOCOL_VERSION, IOTC_MQTT_IDENTIFIER_REJECTED, IOTC_MQTT_SERVER_UNAVAILIBLE, IOTC_MQTT_BAD_USERNAME_OR_PASSWORD, IOTC_MQTT_NOT_AUTHORIZED, IOTC_MQTT_CONNECT_UNKNOWN_RETURN_CODE, IOTC_MQTT_MESSAGE_CLASS_UNKNOWN_ERROR, IOTC_MQTT_PAYLOAD_SIZE_TOO_LARGE, IOTC_MQTT_SUBSCRIPTION_FAILED, IOTC_MQTT_SUBSCRIPTION_SUCCESSFULL, IOTC_INTERNAL_ERROR, IOTC_NOT_INITIALIZED, IOTC_FAILED_INITIALIZATION, IOTC_ALREADY_INITIALIZED, IOTC_INVALID_PARAMETER, IOTC_UNSET_HANDLER_ERROR, IOTC_NOT_IMPLEMENTED, IOTC_ELEMENT_NOT_FOUND, IOTC_SERIALIZATION_ERROR, IOTC_TRUNCATION_WARNING, IOTC_BUFFER_OVERFLOW, IOTC_THREAD_ERROR, IOTC_NULL_CONTEXT, IOTC_NULL_WILL_TOPIC, IOTC_NULL_WILL_MESSAGE, IOTC_NO_MORE_RESOURCE_AVAILABLE, IOTC_FS_RESOURCE_NOT_AVAILABLE, IOTC_FS_ERROR, IOTC_NOT_SUPPORTED, IOTC_EVENT_PROCESS_STOPPED, IOTC_STATE_RESEND, IOTC_NULL_HOST, IOTC_TLS_FAILED_CERT_ERROR, IOTC_FS_OPEN_ERROR, IOTC_FS_OPEN_READ_ONLY, IOTC_FS_READ_ERROR, IOTC_FS_WRITE_ERROR, IOTC_FS_CLOSE_ERROR, IOTC_FS_REMOVE_ERROR, IOTC_NULL_PROJECT_ID_ERROR, IOTC_ALG_NOT_SUPPORTED_ERROR, IOTC_JWT_FORMATTION_ERROR, IOTC_JWT_PROJECTID_TOO_LONG_ERROR, IOTC_NULL_DEVICE_PATH_ERROR, IOTC_BUFFER_TOO_SMALL_ERROR, IOTC_NULL_KEY_DATA_ERROR, IOTC_NULL_CLIENT_ID_ERROR, IOTC_ERROR_COUNT /* Add errors above this line; this should always be last line. */
112 } iotc_state_t;
113 
117 #define IOTC_OPT_NO_ERROR_STRINGS 1
118 
124 extern const char* iotc_get_state_string(iotc_state_t e);
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif /* __IOTC_ERR_H__ */
Something went wrong.
Definition: iotc_error.h:73
Can't create a JWT because the cryptography library in the Board Support Package isn't ported to your...
Definition: iotc_error.h:79
The backoff was applied.
Definition: iotc_error.h:39
Can't subscribe to the MQTT topic.
Definition: iotc_error.h:71
A parameter is missing or invalid.
Definition: iotc_error.h:77
The algorithm of the private key for the JWT signature is not supported.
Definition: iotc_error.h:103
The memory limiter module isn't installed.
Definition: iotc_error.h:91
A timeout occurred.
Definition: iotc_error.h:34
The SDK is not initialized.
Definition: iotc_error.h:74
The event processor stopped because the client application shut down the event engine.
Definition: iotc_error.h:92
The MQTT server is not available.
Definition: iotc_error.h:65
iotc_state_t
The state of the client application.
Definition: iotc_error.h:32
The device doesn't have enough memory to fulfull the request.
Definition: iotc_error.h:40
The buffer is too small for the data.
Definition: iotc_error.h:107
The SDK function succeeded.
Definition: iotc_error.h:33
const char * iotc_get_state_string(iotc_state_t e)
Gets the state message associated with a numeric code.
The buffer for storing formatted and signed JWTs is null.
Definition: iotc_error.h:108
The device isn't connected to an MQTT broker.
Definition: iotc_error.h:49
The MQTT username or password is not correct.
Definition: iotc_error.h:66