Awa LWM2M C API (0.2.5)  
types.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_TYPES_H
29 #define AWA_TYPES_H
30 
31 // @cond
32 #include <stdbool.h>
33 #include <stdint.h>
34 #include <stdlib.h>
35 // @endcond
36 
37 #include "error.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 typedef int AwaObjectID;
44 typedef int AwaObjectInstanceID;
45 typedef int AwaResourceID;
47 
51 #define AWA_INVALID_ID (-1)
52 
56 #define AWA_MAX_ID (65535)
57 
61 typedef int64_t AwaInteger;
62 
66 typedef double AwaFloat;
67 
71 typedef bool AwaBoolean;
72 
76 typedef int64_t AwaTime;
77 
81 typedef struct AwaOpaque
82 {
83  void * Data;
84  size_t Size;
85 } AwaOpaque;
86 
90 typedef struct AwaObjectLink
91 {
92  AwaObjectID ObjectID;
93  AwaObjectInstanceID ObjectInstanceID;
95 
96 // AwaString reserved for future use (UTF-8)
97 
101 typedef enum
102 {
114  // arrays (for multiple resource instances) are their own type
123  // sentinel, do not remove
129 
133 typedef enum
134 {
143  // sentinel, do not remove
146 
150 typedef enum
151 {
157 } AwaLogLevel;
158 
162 typedef enum
163 {
168 
169 
170 typedef enum
171 {
173  AwaContentType_ApplicationPlainText = 0, // The new standard suggests to use PlainText
174  AwaContentType_ApplicationLinkFormat = 40, // Object link format
175  AwaContentType_ApplicationOctetStream = 42, // The new standard uses OctetStream, rather than omg.lwm2m+opaque
176  AwaContentType_ApplicationJson = 50, // The new standard uses Json, rather than omg.lwm2m+json
177  AwaContentType_ApplicationOmaLwm2mText = 1541, // application/vnd.oma.lwm2m+text (leshan uses 1541)
178  AwaContentType_ApplicationOmaLwm2mTLV_Old = 1542, // Previously used by Leshan
179  AwaContentType_ApplicationOmaLwm2mJson_Old = 1543, // Previously used by Leshan
181  AwaContentType_ApplicationOmaLwm2mTLV = 11542, // application/vnd.oma.lwm2m+tlv
184 
185 typedef enum
186 {
195 
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif // AWA_TYPES_H
201 
indicates a resource capable of holding a LWM2M Opaque value
Definition: types.h:110
indicates a resource capable of holding a LWM2M Float value
Definition: types.h:108
Low-level information is reported, in addition to Verbose.
Definition: types.h:156
indicates the resource is write-only to a management server
Definition: types.h:139
Not set.
Definition: types.h:164
bootstrap failed
Definition: types.h:189
indicates the resource can be read and written by a management server
Definition: types.h:140
Warnings are reported, in addition to Error.
Definition: types.h:154
indicates a multiple-instance resource capable of holding a number of LWM2M Boolean values ...
Definition: types.h:118
size_t Size
size of opaque data block
Definition: types.h:84
int AwaResourceInstanceID
Definition: types.h:46
indicates the resource is read-only to a management server
Definition: types.h:138
Reserved value.
Definition: types.h:124
AwaClientRegistrationStatus
Definition: types.h:185
indicates a multiple-instance resource capable of holding a number of LWM2M ObjectLink values ...
Definition: types.h:121
indicates a resource with no type
Definition: types.h:105
indicates the resource can be executed by a management server
Definition: types.h:141
bool AwaBoolean
Corresponds to the LWM2M Boolean type.
Definition: types.h:71
indicates a resource capable of holding an ASCII string (UTF-8 is not supported)
Definition: types.h:106
AwaContentType
Definition: types.h:170
not registered (to any server)
Definition: types.h:190
Reserved value.
Definition: types.h:144
indicates a resource capable of holding a LWM2M Boolean value
Definition: types.h:109
bootstrap in progress
Definition: types.h:188
Only errors are reported.
Definition: types.h:153
Provides definitions for Awa LWM2M Client and Server API error codes and error function declarations...
register failed (and not registered on another server)
Definition: types.h:193
A utility struct used to convey data pointer and size of an opaque data block.
Definition: types.h:81
indicates a multiple-instance resource capable of holding a number of ASCII string values ...
Definition: types.h:115
indicates a resource capable of holding a LWM2M ObjectLink value
Definition: types.h:112
int AwaObjectInstanceID
Definition: types.h:44
register in progress (and not registered or failed on another server)
Definition: types.h:191
AwaResourceOperations
Supported resource operations for management servers.
Definition: types.h:133
indicates no operations are permitted to a management server
Definition: types.h:137
indicates a resource capable of holding a LWM2M Time value
Definition: types.h:111
struct AwaOpaque AwaOpaque
A utility struct used to convey data pointer and size of an opaque data block.
indicates a resource capable of holding a LWM2M Integer value
Definition: types.h:107
indicates a multiple-instance resource capable of holding a number of LWM2M Float values ...
Definition: types.h:117
Reserved value.
Definition: types.h:127
indicates a multiple-instance resource capable of holding a number of LWM2M Opaque values ...
Definition: types.h:119
indicates an invalid resource operation
Definition: types.h:135
Definition: types.h:176
Raw ASN1 sequence.
Definition: types.h:165
No log information is reported.
Definition: types.h:152
double AwaFloat
Corresponds to the LWM2M Float type.
Definition: types.h:66
int AwaObjectID
Definition: types.h:43
AwaLogLevel
Supported log levels for a log command.
Definition: types.h:150
int AwaResourceID
Definition: types.h:45
register complete (to at least one server)
Definition: types.h:192
struct AwaObjectLink AwaObjectLink
A utility struct used to convey object link data.
indicates a multiple-instance resource capable of holding a number of LWM2M Time values ...
Definition: types.h:120
void * Data
pointer to opaque data
Definition: types.h:83
int64_t AwaInteger
Corresponds to the LWM2M 64-bit Integer type.
Definition: types.h:61
invalid client reference
Definition: types.h:187
PEM format.
Definition: types.h:166
High-level information is reported, in addition to Warning.
Definition: types.h:155
Definition: types.h:172
AwaResourceType
Supported resource types.
Definition: types.h:101
indicates an invalid resource type
Definition: types.h:103
int64_t AwaTime
Corresponds to the LWM2M Time type.
Definition: types.h:76
indicates a multiple-instance resource capable of holding a number of LWM2M Integer values ...
Definition: types.h:116
AwaCertificateFormat
Supported Certificate formats.
Definition: types.h:162
Reserved value.
Definition: types.h:126