Awa LWM2M C API (0.2.5)  
error.h
Go to the documentation of this file.
1 /************************************************************************************************************************
2  Copyright (c) 2016, Imagination Technologies Limited and/or its affiliated group companies.
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
6  following conditions are met:
7  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
8  following disclaimer.
9  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
10  following disclaimer in the documentation and/or other materials provided with the distribution.
11  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
12  products derived from this software without specific prior written permission.
13 
14  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
15  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
18  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
19  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
20  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 ************************************************************************************************************************/
22 
28 #ifndef AWA_ERROR_H
29 #define AWA_ERROR_H
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 typedef enum
39 {
40  // These enums must align with src/error.c:ErrorStrings
41 
48  // 5
55  // 10
62  // 15
69  // 20
76  // 25
83  // 30
91 } AwaError;
92 
93 typedef enum
94 {
95  // These enums must align with src/error.c:ServerErrorStrings
96 
106 } AwaLWM2MError;
107 
113 const char * AwaError_ToString(AwaError error);
114 
120 AwaError AwaError_FromString(const char * errorString);
121 
127 const char * AwaLWM2MError_ToString(AwaLWM2MError error);
128 
134 AwaLWM2MError AwaLWM2MError_FromString(const char * errorString);
135 
136 #ifdef __cplusplus
137 }
138 #endif
139 
140 #endif // AWA_ERROR_H
141 
Indicates a LWM2M error has occurred.
Definition: error.h:79
AwaError
API Error Codes.
Definition: error.h:38
Indicates a LWM2M 4.01 Unauthorized error was encountered.
Definition: error.h:100
Indicates an invalid ID or ID pointer was provided.
Definition: error.h:63
Indicates an attempt to subscribe to a resource, object instance or object more than once...
Definition: error.h:70
Indicates an operation failed to allocate memory.
Definition: error.h:46
Indicates an operation on an invalid array range.
Definition: error.h:84
AwaLWM2MError AwaLWM2MError_FromString(const char *errorString)
Get an error code from a descriptive name of an error.
const char * AwaError_ToString(AwaError error)
Get a descriptive name for the specified error code.
Indicates an attempt to use an invalid object/resource definition instance.
Definition: error.h:67
Indicates an object or resource has already been defined.
Definition: error.h:52
Indicates an operation was attempted on an invalid operation.
Definition: error.h:53
Indicates an operation has overrun the supplied buffer.
Definition: error.h:60
Indicates a client ID is invalid.
Definition: error.h:77
Indicates no server occurred.
Definition: error.h:97
Indicates an operation was attempted in the context of an invalid Static Client.
Definition: error.h:85
Indicates an operation response has errors.
Definition: error.h:81
Indicates a Static Client was not initialized.
Definition: error.h:87
Indicates an attempt to use an invalid observation instance.
Definition: error.h:72
Indicates an attempt to use an invalid subscription instance.
Definition: error.h:71
Indicates an operation was attempted in the context of a valid session that is not connected to IPC...
Definition: error.h:50
Indicates a LWM2M 4.06 Not Acceptable error was encountered.
Definition: error.h:103
Indicates a specified path is invalid in the context of the operation.
Definition: error.h:56
Reserved value.
Definition: error.h:90
Indicates an internal error has occurred.
Definition: error.h:45
const char * AwaLWM2MError_ToString(AwaLWM2MError error)
Get a descriptive name for the specified error code.
Indicates a general IPC error occurred.
Definition: error.h:73
Used as a default error value.
Definition: error.h:98
Indicates an incorrect or malformed Add operation was attempted.
Definition: error.h:64
Indicates an attempt to create something that can't be created.
Definition: error.h:65
Indicates a LWM2M 4.04 Not Found error was encountered.
Definition: error.h:101
Indicates a LWM2M 4.00 Bad Request error was encountered.
Definition: error.h:99
Indicates an attempt to delete something that can't be deleted.
Definition: error.h:66
Indicates a valid path is not found during an operation.
Definition: error.h:57
Indicates an operation has timed out.
Definition: error.h:59
Indicates an invalid iterator was used.
Definition: error.h:80
Indicates a CoAP 5.04 Gateway timeout error was encountered.
Definition: error.h:104
Indicates an operation was attempted in the context of an invalid session.
Definition: error.h:49
Indicates a Static Client was initialised without being configured.
Definition: error.h:86
Indicates a LWM2M 4.05 Not Allowed error was encountered.
Definition: error.h:102
Indicates a client with a matching ID was not found.
Definition: error.h:78
Reserved value.
Definition: error.h:105
Indicates an API function or value is not supported.
Definition: error.h:44
Indicates an operation was successful.
Definition: error.h:42
Indicates an attempt to set an unknown log level.
Definition: error.h:88
Indicates an attempt to get or use an invalid response.
Definition: error.h:74
Indicates an operation was attempted on an object or resource that is not defined in the session...
Definition: error.h:51
AwaError AwaError_FromString(const char *errorString)
Get an error code from a descriptive name of an error.
Indicates a type mismatch between data and function.
Definition: error.h:58
Used as a default error value.
Definition: error.h:43
AwaLWM2MError
Definition: error.h:93