rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2008-2014 Travis Geiselbrecht |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining |
| 5 | * a copy of this software and associated documentation files |
| 6 | * (the "Software"), to deal in the Software without restriction, |
| 7 | * including without limitation the rights to use, copy, modify, merge, |
| 8 | * publish, distribute, sublicense, and/or sell copies of the Software, |
| 9 | * and to permit persons to whom the Software is furnished to do so, |
| 10 | * subject to the following conditions: |
| 11 | * |
| 12 | * The above copyright notice and this permission notice shall be |
| 13 | * included in all copies or substantial portions of the Software. |
| 14 | * |
| 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 22 | */ |
| 23 | #ifndef __ERR_H |
| 24 | #define __ERR_H |
| 25 | |
| 26 | #ifndef ASSEMBLY |
| 27 | #include <sys/types.h> // for status_t |
| 28 | #endif |
| 29 | |
| 30 | #define NO_ERROR (0) |
| 31 | #define ERR_GENERIC (-1) |
| 32 | #define ERR_NOT_FOUND (-2) |
| 33 | #define ERR_NOT_READY (-3) |
| 34 | #define ERR_NO_MSG (-4) |
| 35 | #define ERR_NO_MEMORY (-5) |
| 36 | #define ERR_ALREADY_STARTED (-6) |
| 37 | #define ERR_NOT_VALID (-7) |
| 38 | #define ERR_INVALID_ARGS (-8) |
| 39 | #define ERR_NOT_ENOUGH_BUFFER (-9) |
| 40 | #define ERR_NOT_SUSPENDED (-10) |
| 41 | #define ERR_OBJECT_DESTROYED (-11) |
| 42 | #define ERR_NOT_BLOCKED (-12) |
| 43 | #define ERR_TIMED_OUT (-13) |
| 44 | #define ERR_ALREADY_EXISTS (-14) |
| 45 | #define ERR_CHANNEL_CLOSED (-15) |
| 46 | #define ERR_OFFLINE (-16) |
| 47 | #define ERR_NOT_ALLOWED (-17) |
| 48 | #define ERR_BAD_PATH (-18) |
| 49 | #define ERR_ALREADY_MOUNTED (-19) |
| 50 | #define ERR_IO (-20) |
| 51 | #define ERR_NOT_DIR (-21) |
| 52 | #define ERR_NOT_FILE (-22) |
| 53 | #define ERR_RECURSE_TOO_DEEP (-23) |
| 54 | #define ERR_NOT_SUPPORTED (-24) |
| 55 | #define ERR_TOO_BIG (-25) |
| 56 | #define ERR_CANCELLED (-26) |
| 57 | #define ERR_NOT_IMPLEMENTED (-27) |
| 58 | #define ERR_CHECKSUM_FAIL (-28) |
| 59 | #define ERR_CRC_FAIL (-29) |
| 60 | #define ERR_CMD_UNKNOWN (-30) |
| 61 | #define ERR_BAD_STATE (-31) |
| 62 | #define ERR_BAD_LEN (-32) |
| 63 | #define ERR_BUSY (-33) |
| 64 | #define ERR_THREAD_DETACHED (-34) |
| 65 | #define ERR_I2C_NACK (-35) |
| 66 | #define ERR_ALREADY_EXPIRED (-36) |
| 67 | #define ERR_OUT_OF_RANGE (-37) |
| 68 | #define ERR_NOT_CONFIGURED (-38) |
| 69 | #define ERR_NOT_MOUNTED (-39) |
| 70 | #define ERR_FAULT (-40) |
| 71 | #define ERR_NO_RESOURCES (-41) |
| 72 | #define ERR_BAD_HANDLE (-42) |
| 73 | #define ERR_ACCESS_DENIED (-43) |
| 74 | #define ERR_PARTIAL_WRITE (-44) |
| 75 | |
| 76 | #define ERR_USER_BASE (-16384) |
| 77 | |
| 78 | #endif |