Myriota Flex SDK 2.5.0
Loading...
Searching...
No Matches
flex_errors.h
1
2// Copyright (c) 2024, Myriota Pty Ltd, All Rights Reserved
3// SPDX-License-Identifier: BSD-3-Clause-Attribution
4//
5// This file is licensed under the BSD with attribution (the "License"); you
6// may not use these files except in compliance with the License.
7//
8// You may obtain a copy of the License here:
9// LICENSE-BSD-3-Clause-Attribution.txt and at
10// https://spdx.org/licenses/BSD-3-Clause-Attribution.html
11//
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef FLEX_ERRORS_H
16#define FLEX_ERRORS_H
17
18enum FLEX_ERROR_VALUES {
19 FLEX_SUCCESS = 0,
20
21 // Standard error codes
22 FLEX_ERROR_EPERM = 1, // Operation not permitted
23 FLEX_ERROR_EIO = 5, // Input/output error
24 FLEX_ERROR_ENXIO = 6, // No such device or address
25 FLEX_ERROR_EAGAIN = 11, // Resource temporarily unavailable
26 FLEX_ERROR_ENOMEM = 12, // Cannot allocate memory
27 FLEX_ERROR_EACCES = 13, // Permission denied
28 FLEX_ERROR_EFAULT = 14, // Bad address
29 FLEX_ERROR_EBUSY = 16, // Device or resource busy
30 FLEX_ERROR_ENODEV = 19, // No such device
31 FLEX_ERROR_EINVAL = 22, // Invalid argument
32 FLEX_ERROR_ENOSPC = 28, // No space left on device
33 FLEX_ERROR_EPIPE = 32, // Broken pipe
34 FLEX_ERROR_ERANGE = 34, // Numerical result out of range
35 FLEX_ERROR_ENOSYS = 38, // Function not implemented
36 FLEX_ERROR_EWOULDBLOCK = 11, // Resource temporarily unavailable
37 FLEX_ERROR_ENODATA = 61, // No data available
38 FLEX_ERROR_ETIME = 62, // Timer expired
39 FLEX_ERROR_ECOMM = 70, // Communication error
40 FLEX_ERROR_EPROTO = 71, // Protocol error
41 FLEX_ERROR_EBADMSG = 74, // Bad message
42 FLEX_ERROR_EOVERFLOW = 75, // Value too large for defined data type
43 FLEX_ERROR_EMSGSIZE = 90, // Message too long
44 FLEX_ERROR_EOPNOTSUPP = 95, // Operation not supported
45 FLEX_ERROR_ENOBUFS = 105, // No buffer space available
46 FLEX_ERROR_ETIMEDOUT = 110, // Timed out
47 FLEX_ERROR_EALREADY = 114, // Operation already in progress, device already initialised
48 FLEX_ERROR_ECANCELED = 125, // Operation cancelled
49 FLEX_ERROR_ENOTRECOVERABLE = 131, // State not recoverable
50
51 // Flex device errors
52 FLEX_ERROR_SUB_SYSTEM = 160, // Unspecified error in internal system
53 FLEX_ERROR_I2C = 161, // I2C bus interface error
54 FLEX_ERROR_IO_EXPANDER = 162, // GPIO expander device error
55 FLEX_ERROR_POWER_OUT = 163, // Enable/Disable power to a device or an interface error
56 FLEX_ERROR_PWM = 164, // PWM device error
57 FLEX_ERROR_GPIO = 165, // GPIO device error
58 FLEX_ERROR_SERIAL = 166, // UART/Serial device error
59 FLEX_ERROR_GNSS = 167, // GNSS device error
60 FLEX_ERROR_BUTTON = 168, // Push button device error
61 FLEX_ERROR_LED = 169, // LED device error
62 FLEX_ERROR_TEMP = 169, // Temperature device error
63
64 // Flex specific error cases
65 FLEX_ERROR_READ_FAIL = 192, // Failed to read data from device
66 FLEX_ERROR_NOT_INIT = 193, // Device not initialised
67
68 // Error codes equal to or above this value can be found in a specific
69 // set given below, these are context dependent and the numbers are
70 // overloaded, so ensure to check them based on the context/functionality
71 FLEX_EXTENDED_ERROR = 224,
72};
73
74enum FLEX_ANALOG_ERROR {
75 FLEX_ERROR_ANALOG_INPUT_MODE = FLEX_EXTENDED_ERROR, // Device in wrong input mode
76};
77
78#endif