Awa LWM2M C API (0.2.5)  
common.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_COMMON_H
29 #define AWA_COMMON_H
30 
31 // @cond
32 #include <stdbool.h>
33 #include <stdint.h>
34 #include <stdlib.h>
35 // @endcond
36 
37 #include "types.h"
38 #include "error.h"
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /**************************************************************************************************
45  * Public Types and Enumerations
46  *************************************************************************************************/
47 
51 typedef enum
52 {
66 
70 typedef int AwaTimeout;
71 
75 typedef enum
76 {
81 
82 /**************************************************************************************************
83  * Array Management for Resources
84  *************************************************************************************************/
85 
89 typedef size_t AwaArrayIndex;
90 
94 typedef size_t AwaArrayLength;
95 
96 // Public array types
97 typedef struct _AwaStringArray AwaStringArray;
98 typedef struct _AwaIntegerArray AwaIntegerArray;
99 typedef struct _AwaFloatArray AwaFloatArray;
100 typedef struct _AwaBooleanArray AwaBooleanArray;
101 typedef struct _AwaOpaqueArray AwaOpaqueArray;
102 typedef struct _AwaTimeArray AwaTimeArray;
103 typedef struct _AwaObjectLinkArray AwaObjectLinkArray;
104 
105 // Public Array Iterator types
106 typedef struct _AwaCStringArrayIterator AwaCStringArrayIterator;
107 typedef struct _AwaIntegerArrayIterator AwaIntegerArrayIterator;
108 typedef struct _AwaFloatArrayIterator AwaFloatArrayIterator;
109 typedef struct _AwaBooleanArrayIterator AwaBooleanArrayIterator;
110 typedef struct _AwaOpaqueArrayIterator AwaOpaqueArrayIterator;
111 typedef struct _AwaTimeArrayIterator AwaTimeArrayIterator;
112 typedef struct _AwaObjectLinkArrayIterator AwaObjectLinkArrayIterator;
113 
141 void AwaStringArray_Free (AwaStringArray ** array);
142 void AwaIntegerArray_Free (AwaIntegerArray ** array);
143 void AwaFloatArray_Free (AwaFloatArray ** array);
144 void AwaBooleanArray_Free (AwaBooleanArray ** array);
145 void AwaOpaqueArray_Free (AwaOpaqueArray ** array);
146 void AwaTimeArray_Free (AwaTimeArray ** array);
159 // RESERVED for UTF8 support:
160 //void AwaStringArray_SetValue (AwaStringArray * array, AwaArrayIndex index, AwaString value);
161 void AwaStringArray_SetValueAsCString(AwaStringArray * array, AwaArrayIndex index, const char * value);
162 void AwaIntegerArray_SetValue (AwaIntegerArray * array, AwaArrayIndex index, AwaInteger value);
163 void AwaFloatArray_SetValue (AwaFloatArray * array, AwaArrayIndex index, AwaFloat value);
164 void AwaBooleanArray_SetValue (AwaBooleanArray * array, AwaArrayIndex index, AwaBoolean value);
165 void AwaOpaqueArray_SetValue (AwaOpaqueArray * array, AwaArrayIndex index, AwaOpaque value);
166 void AwaTimeArray_SetValue (AwaTimeArray * array, AwaArrayIndex index, AwaTime value);
167 void AwaObjectLinkArray_SetValue (AwaObjectLinkArray * array, AwaArrayIndex index, AwaObjectLink value);
178 void AwaStringArray_DeleteValue (AwaStringArray * array, AwaArrayIndex index);
179 void AwaIntegerArray_DeleteValue (AwaIntegerArray * array, AwaArrayIndex index);
180 void AwaFloatArray_DeleteValue (AwaFloatArray * array, AwaArrayIndex index);
181 void AwaBooleanArray_DeleteValue (AwaBooleanArray * array, AwaArrayIndex index);
182 void AwaOpaqueArray_DeleteValue (AwaOpaqueArray * array, AwaArrayIndex index);
183 void AwaTimeArray_DeleteValue (AwaTimeArray * array, AwaArrayIndex index);
184 void AwaObjectLinkArray_DeleteValue(AwaObjectLinkArray * array, AwaArrayIndex index);
197 // RESERVED for UTF8 support:
198 //AwaString AwaStringArray_GetValue (const AwaStringArray * array, AwaArrayIndex index);
199 const char * AwaStringArray_GetValueAsCString(const AwaStringArray * array, AwaArrayIndex index);
200 AwaInteger AwaIntegerArray_GetValue (const AwaIntegerArray * array, AwaArrayIndex index);
201 AwaFloat AwaFloatArray_GetValue (const AwaFloatArray * array, AwaArrayIndex index);
202 AwaBoolean AwaBooleanArray_GetValue (const AwaBooleanArray * array, AwaArrayIndex index);
203 AwaOpaque AwaOpaqueArray_GetValue (const AwaOpaqueArray * array, AwaArrayIndex index);
204 AwaTime AwaTimeArray_GetValue (const AwaTimeArray * array, AwaArrayIndex index);
205 AwaObjectLink AwaObjectLinkArray_GetValue (const AwaObjectLinkArray * array, AwaArrayIndex index);
217 size_t AwaStringArray_GetValueCount (const AwaStringArray * array);
218 size_t AwaIntegerArray_GetValueCount (const AwaIntegerArray * array);
219 size_t AwaFloatArray_GetValueCount (const AwaFloatArray * array);
220 size_t AwaBooleanArray_GetValueCount (const AwaBooleanArray * array);
221 size_t AwaOpaqueArray_GetValueCount (const AwaOpaqueArray * array);
222 size_t AwaTimeArray_GetValueCount (const AwaTimeArray * array);
257 bool AwaStringArray_IsValid (const AwaStringArray * array, AwaArrayIndex index);
258 bool AwaIntegerArray_IsValid (const AwaIntegerArray * array, AwaArrayIndex index);
259 bool AwaFloatArray_IsValid (const AwaFloatArray * array, AwaArrayIndex index);
260 bool AwaBooleanArray_IsValid (const AwaBooleanArray * array, AwaArrayIndex index);
261 bool AwaOpaqueArray_IsValid (const AwaOpaqueArray * array, AwaArrayIndex index);
262 bool AwaTimeArray_IsValid (const AwaTimeArray * array, AwaArrayIndex index);
263 bool AwaObjectLinkArray_IsValid(const AwaObjectLinkArray * array, AwaArrayIndex index);
266 // TODO: Array appending can be handled by the high-level API
267 
296 AwaArrayIndex AwaCStringArrayIterator_GetIndex (const AwaCStringArrayIterator * iterator);
297 AwaArrayIndex AwaIntegerArrayIterator_GetIndex (const AwaIntegerArrayIterator * iterator);
298 AwaArrayIndex AwaFloatArrayIterator_GetIndex (const AwaFloatArrayIterator * iterator);
299 AwaArrayIndex AwaBooleanArrayIterator_GetIndex (const AwaBooleanArrayIterator * iterator);
300 AwaArrayIndex AwaOpaqueArrayIterator_GetIndex (const AwaOpaqueArrayIterator * iterator);
301 AwaArrayIndex AwaTimeArrayIterator_GetIndex (const AwaTimeArrayIterator * iterator);
314 // RESERVED for UTF8 support:
315 //AwaString AwaStringArrayIterator_GetValue (const AwaStringArrayIterator * iterator);
342 /**************************************************************************************************
343  * Definition Functions common to Server and Client
344  *************************************************************************************************/
345 
346 typedef struct _ObjectDefinition AwaObjectDefinition;
347 typedef struct _ResourceDefinition AwaResourceDefinition;
348 typedef struct _AwaObjectDefinitionIterator AwaObjectDefinitionIterator;
349 typedef struct _AwaResourceDefinitionIterator AwaResourceDefinitionIterator;
350 
360 AwaObjectDefinition * AwaObjectDefinition_New(AwaObjectID objectID, const char * objectName, int minimumInstances, int maximumInstances);
361 
367 void AwaObjectDefinition_Free(AwaObjectDefinition ** objectDefinition);
368 
384 AwaError AwaObjectDefinition_AddResourceDefinitionAsNoType(AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, bool isMandatory, AwaResourceOperations operations);
385 
406 AwaError AwaObjectDefinition_AddResourceDefinitionAsString (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, bool isMandatory, AwaResourceOperations operations, const char * defaultValue);
407 AwaError AwaObjectDefinition_AddResourceDefinitionAsInteger (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, bool isMandatory, AwaResourceOperations operations, AwaInteger defaultValue);
408 AwaError AwaObjectDefinition_AddResourceDefinitionAsFloat (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, bool isMandatory, AwaResourceOperations operations, AwaFloat defaultValue);
409 AwaError AwaObjectDefinition_AddResourceDefinitionAsBoolean (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, bool isMandatory, AwaResourceOperations operations, AwaBoolean defaultValue);
410 AwaError AwaObjectDefinition_AddResourceDefinitionAsOpaque (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, bool isMandatory, AwaResourceOperations operations, AwaOpaque defaultValue);
411 AwaError AwaObjectDefinition_AddResourceDefinitionAsTime (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, bool isMandatory, AwaResourceOperations operations, AwaTime defaultValue);
412 AwaError AwaObjectDefinition_AddResourceDefinitionAsObjectLink(AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, bool isMandatory, AwaResourceOperations operations, AwaObjectLink defaultValue);
437 AwaError AwaObjectDefinition_AddResourceDefinitionAsStringArray (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaStringArray * defaultArray);
438 AwaError AwaObjectDefinition_AddResourceDefinitionAsIntegerArray (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaIntegerArray * defaultArray);
439 AwaError AwaObjectDefinition_AddResourceDefinitionAsFloatArray (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaFloatArray * defaultArray);
440 AwaError AwaObjectDefinition_AddResourceDefinitionAsBooleanArray (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaBooleanArray * defaultArray);
441 AwaError AwaObjectDefinition_AddResourceDefinitionAsTimeArray (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaTimeArray * defaultArray);
442 AwaError AwaObjectDefinition_AddResourceDefinitionAsOpaqueArray (AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaOpaqueArray * defaultArray);
443 AwaError AwaObjectDefinition_AddResourceDefinitionAsObjectLinkArray(AwaObjectDefinition * objectDefinition, AwaResourceID resourceID, const char * resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaObjectLinkArray * defaultArray);
453 
460 const char * AwaObjectDefinition_GetName (const AwaObjectDefinition * objectDefinition);
461 
468 int AwaObjectDefinition_GetMinimumInstances (const AwaObjectDefinition * objectDefinition);
469 
476 int AwaObjectDefinition_GetMaximumInstances (const AwaObjectDefinition * objectDefinition);
477 
485 bool AwaObjectDefinition_IsResourceDefined (const AwaObjectDefinition * objectDefinition, AwaResourceID resourceID);
486 
496 
505 
513 
520 
528 
536 
543 const char * AwaResourceDefinition_GetName(const AwaResourceDefinition * resourceDefinition);
544 
552 
560 
568 
575 bool AwaResourceDefinition_IsMandatory(const AwaResourceDefinition * resourceDefinition);
576 
586 
595 
603 
610 
611 
612 /**************************************************************************************************
613  * Utility Functions
614  *************************************************************************************************/
615 
616 // Path Iterator
617 typedef struct _AwaPathIterator AwaPathIterator;
618 
626 bool AwaPathIterator_Next(AwaPathIterator * iterator);
627 
635 const char * AwaPathIterator_Get(const AwaPathIterator * iterator);
636 
642 void AwaPathIterator_Free(AwaPathIterator ** iterator);
643 
653 AwaError AwaAPI_MakeObjectPath(char * path, size_t pathSize, AwaObjectID objectID);
654 
665 AwaError AwaAPI_MakeObjectInstancePath(char * path, size_t pathSize, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID);
666 
678 AwaError AwaAPI_MakeResourcePath(char * path, size_t pathSize, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID, AwaResourceID resourceID);
679 
691 AwaError AwaAPI_MakePath(char * path, size_t pathSize, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID, AwaResourceID resourceID);
692 
699 bool AwaAPI_IsPathValid(const char * path);
700 
701 
702 // Encapsulates Execute arguments
704 
705 
706 /**************************************************************************************************
707  * Response Functions
708  *************************************************************************************************/
709 
710 typedef struct _AwaPathResult AwaPathResult;
711 
720 
728 
729 
730 /**************************************************************************************************
731  * ChangeSet Functions for Change Subscriptions and Observations
732  *************************************************************************************************/
733 
734 typedef struct _AwaChangeSet AwaChangeSet;
735 
746 
754 AwaChangeType AwaChangeSet_GetChangeType(const AwaChangeSet * changeSet, const char * path);
755 
765 bool AwaChangeSet_HasValue(const AwaChangeSet * changeSet, const char * path);
766 
775 bool AwaChangeSet_ContainsPath(const AwaChangeSet * changeSet, const char * path);
776 
784 AwaResourceType AwaChangeSet_GetResourceType(const AwaChangeSet * changeSet, const char * path);
785 
803 AwaError AwaChangeSet_GetValueAsCStringPointer (const AwaChangeSet * changeSet, const char * path, const char ** value);
804 AwaError AwaChangeSet_GetValueAsIntegerPointer (const AwaChangeSet * changeSet, const char * path, const AwaInteger ** value);
805 AwaError AwaChangeSet_GetValueAsFloatPointer (const AwaChangeSet * changeSet, const char * path, const AwaFloat ** value);
806 AwaError AwaChangeSet_GetValueAsBooleanPointer (const AwaChangeSet * changeSet, const char * path, const AwaBoolean ** value);
807 AwaError AwaChangeSet_GetValueAsTimePointer (const AwaChangeSet * changeSet, const char * path, const AwaTime ** value);
808 AwaError AwaChangeSet_GetValueAsObjectLinkPointer(const AwaChangeSet * changeSet, const char * path, const AwaObjectLink ** value);
809 AwaError AwaChangeSet_GetValueAsOpaquePointer (const AwaChangeSet * changeSet, const char * path, const AwaOpaque ** value);
829 AwaError AwaChangeSet_GetValueAsOpaque (const AwaChangeSet * changeSet, const char * path, AwaOpaque * value);
830 
845 AwaError AwaChangeSet_GetValueAsObjectLink (const AwaChangeSet * changeSet, const char * path, AwaObjectLink * value);
846 
865 AwaError AwaChangeSet_GetValuesAsStringArrayPointer (const AwaChangeSet * changeSet, const char * path, const AwaStringArray ** valueArray);
866 AwaError AwaChangeSet_GetValuesAsIntegerArrayPointer (const AwaChangeSet * changeSet, const char * path, const AwaIntegerArray ** valueArray);
867 AwaError AwaChangeSet_GetValuesAsFloatArrayPointer (const AwaChangeSet * changeSet, const char * path, const AwaFloatArray ** valueArray);
868 AwaError AwaChangeSet_GetValuesAsBooleanArrayPointer (const AwaChangeSet * changeSet, const char * path, const AwaBooleanArray ** valueArray);
869 AwaError AwaChangeSet_GetValuesAsTimeArrayPointer (const AwaChangeSet * changeSet, const char * path, const AwaTimeArray ** valueArray);
870 AwaError AwaChangeSet_GetValuesAsOpaqueArrayPointer (const AwaChangeSet * changeSet, const char * path, const AwaOpaqueArray ** valueArray);
871 AwaError AwaChangeSet_GetValuesAsObjectLinkArrayPointer(const AwaChangeSet * changeSet, const char * path, const AwaObjectLinkArray ** valueArray);
875 /**************************************************************************************************
876  * Logging
877  *************************************************************************************************/
878 
885 
886 
887 #ifdef __cplusplus
888 }
889 #endif
890 
891 #endif // AWA_COMMON_H
892 
struct _AwaOpaqueArrayIterator AwaOpaqueArrayIterator
Definition: common.h:110
AwaError
API Error Codes.
Definition: error.h:38
AwaOpaqueArray * AwaOpaqueArray_New(void)
struct _AwaPathResult AwaPathResult
Definition: common.h:710
AwaResourceType AwaResourceDefinition_GetType(const AwaResourceDefinition *resourceDefinition)
Retrieve the resource type of a Resource Definition.
void AwaObjectLinkArrayIterator_Free(AwaObjectLinkArrayIterator **iterator)
AwaObjectID AwaObjectDefinition_GetID(const AwaObjectDefinition *objectDefinition)
Retrieve the unique ID of an Object Definition.
bool AwaTimeArray_IsValid(const AwaTimeArray *array, AwaArrayIndex index)
struct _AwaBooleanArrayIterator AwaBooleanArrayIterator
Definition: common.h:109
Provides definitions for types and enums used by Awa LWM2M API and Static API.
AwaError AwaObjectDefinition_AddResourceDefinitionAsFloatArray(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaFloatArray *defaultArray)
void AwaIntegerArray_SetValue(AwaIntegerArray *array, AwaArrayIndex index, AwaInteger value)
void AwaObjectDefinition_Free(AwaObjectDefinition **objectDefinition)
Clean up an Object Definition, freeing all allocated resources.
AwaError AwaChangeSet_GetValueAsObjectLink(const AwaChangeSet *changeSet, const char *path, AwaObjectLink *value)
Retrieve an object link resource&#39;s value from a ChangeSet.
AwaBooleanArrayIterator * AwaBooleanArray_NewBooleanArrayIterator(const AwaBooleanArray *array)
AwaError AwaAPI_MakeObjectPath(char *path, size_t pathSize, AwaObjectID objectID)
Construct a path from an object ID.
AwaError AwaObjectDefinition_AddResourceDefinitionAsTimeArray(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaTimeArray *defaultArray)
int AwaTimeout
Represents a timeout value, in milliseconds.
Definition: common.h:70
AwaBooleanArray * AwaBooleanArray_New(void)
AwaError AwaAPI_MakeResourcePath(char *path, size_t pathSize, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID, AwaResourceID resourceID)
Construct a path from an object, object instance, and resource ID.
AwaError AwaObjectDefinition_AddResourceDefinitionAsObjectLinkArray(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaObjectLinkArray *defaultArray)
AwaInteger AwaIntegerArrayIterator_GetValue(const AwaIntegerArrayIterator *iterator)
struct _AwaBooleanArray AwaBooleanArray
Definition: common.h:100
bool AwaOpaqueArray_IsValid(const AwaOpaqueArray *array, AwaArrayIndex index)
AwaError AwaObjectDefinition_AddResourceDefinitionAsInteger(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaInteger defaultValue)
void AwaTimeArrayIterator_Free(AwaTimeArrayIterator **iterator)
size_t AwaOpaqueArray_GetValueCount(const AwaOpaqueArray *array)
bool AwaIntegerArrayIterator_Next(AwaIntegerArrayIterator *iterator)
AwaCStringArrayIterator * AwaStringArray_NewCStringArrayIterator(const AwaStringArray *array)
indicates a resource was modified on the specified path
Definition: common.h:56
bool AwaOpaqueArrayIterator_Next(AwaOpaqueArrayIterator *iterator)
struct _AwaIntegerArray AwaIntegerArray
Definition: common.h:98
void AwaOpaqueArray_DeleteValue(AwaOpaqueArray *array, AwaArrayIndex index)
const char * AwaPathIterator_Get(const AwaPathIterator *iterator)
Retrieve the current path from a Path Iterator.
const char * AwaObjectDefinition_GetName(const AwaObjectDefinition *objectDefinition)
Retrieve the name of an Object Definition.
indicates a resource was created on the specified path
Definition: common.h:55
AwaFloat AwaFloatArrayIterator_GetValue(const AwaFloatArrayIterator *iterator)
Definition: common.h:79
size_t AwaArrayLength
Represents a multiple-instance array length value.
Definition: common.h:94
AwaError AwaObjectDefinition_AddResourceDefinitionAsOpaque(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaOpaque defaultValue)
bool AwaResourceDefinition_IsMandatory(const AwaResourceDefinition *resourceDefinition)
Determine whether or not a Resource Definition is mandatory.
AwaError AwaChangeSet_GetValueAsOpaque(const AwaChangeSet *changeSet, const char *path, AwaOpaque *value)
Retrieve an opaque resource&#39;s value from a ChangeSet.
AwaBoolean AwaBooleanArrayIterator_GetValue(const AwaBooleanArrayIterator *iterator)
struct _AwaFloatArray AwaFloatArray
Definition: common.h:99
bool AwaPathIterator_Next(AwaPathIterator *iterator)
Determine whether the Path Iterator has not reached the end of a set of paths.
AwaArrayIndex AwaIntegerArrayIterator_GetIndex(const AwaIntegerArrayIterator *iterator)
AwaOpaque AwaOpaqueArrayIterator_GetValue(const AwaOpaqueArrayIterator *iterator)
size_t AwaObjectLinkArray_GetValueCount(const AwaObjectLinkArray *array)
const char * AwaResourceDefinition_GetName(const AwaResourceDefinition *resourceDefinition)
Retrieve the name of a Resource Definition.
AwaError AwaObjectDefinition_AddResourceDefinitionAsFloat(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaFloat defaultValue)
AwaArrayIndex AwaOpaqueArrayIterator_GetIndex(const AwaOpaqueArrayIterator *iterator)
struct _AwaOpaqueArray AwaOpaqueArray
Definition: common.h:101
AwaInteger AwaIntegerArray_GetValue(const AwaIntegerArray *array, AwaArrayIndex index)
AwaError AwaChangeSet_GetValuesAsBooleanArrayPointer(const AwaChangeSet *changeSet, const char *path, const AwaBooleanArray **valueArray)
indicates an object instance was created on the specified path
Definition: common.h:59
indicates a resource was deleted on the specified path
Definition: common.h:57
indicates an object instance was deleted on the specified path
Definition: common.h:61
AwaLogLevel AwaLog_SetLevel(AwaLogLevel level)
Set the current API log level.
struct _AwaIntegerArrayIterator AwaIntegerArrayIterator
Definition: common.h:107
bool AwaStringArray_IsValid(const AwaStringArray *array, AwaArrayIndex index)
AwaError AwaChangeSet_GetValueAsCStringPointer(const AwaChangeSet *changeSet, const char *path, const char **value)
void AwaIntegerArray_Free(AwaIntegerArray **array)
AwaArrayIndex AwaFloatArrayIterator_GetIndex(const AwaFloatArrayIterator *iterator)
bool AwaBoolean
Corresponds to the LWM2M Boolean type.
Definition: types.h:71
void AwaObjectDefinitionIterator_Free(AwaObjectDefinitionIterator **iterator)
Clean up an Object Definition iterator, freeing all allocated resources.
AwaError AwaObjectDefinition_AddResourceDefinitionAsObjectLink(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaObjectLink defaultValue)
void AwaIntegerArray_DeleteValue(AwaIntegerArray *array, AwaArrayIndex index)
AwaTime AwaTimeArray_GetValue(const AwaTimeArray *array, AwaArrayIndex index)
AwaTime AwaTimeArrayIterator_GetValue(const AwaTimeArrayIterator *iterator)
AwaObjectLinkArrayIterator * AwaObjectLinkArray_NewObjectLinkArrayIterator(const AwaObjectLinkArray *array)
bool AwaObjectDefinition_IsResourceDefined(const AwaObjectDefinition *objectDefinition, AwaResourceID resourceID)
Determine whether a Resource Definition exists within an Object Definition for the specified ID...
void AwaObjectLinkArray_DeleteValue(AwaObjectLinkArray *array, AwaArrayIndex index)
void AwaBooleanArrayIterator_Free(AwaBooleanArrayIterator **iterator)
AwaFloatArray * AwaFloatArray_New(void)
void AwaFloatArray_DeleteValue(AwaFloatArray *array, AwaArrayIndex index)
Provides definitions for Awa LWM2M Client and Server API error codes and error function declarations...
AwaError AwaAPI_MakeObjectInstancePath(char *path, size_t pathSize, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID)
Construct a path from an object and object instance ID.
void AwaFloatArray_Free(AwaFloatArray **array)
AwaError AwaChangeSet_GetValuesAsTimeArrayPointer(const AwaChangeSet *changeSet, const char *path, const AwaTimeArray **valueArray)
void AwaTimeArray_Free(AwaTimeArray **array)
void AwaBooleanArray_SetValue(AwaBooleanArray *array, AwaArrayIndex index, AwaBoolean value)
AwaError AwaPathResult_GetError(const AwaPathResult *result)
Retrieve an error from a Path Result.
A utility struct used to convey data pointer and size of an opaque data block.
Definition: types.h:81
bool AwaBooleanArray_IsValid(const AwaBooleanArray *array, AwaArrayIndex index)
void AwaCStringArrayIterator_Free(AwaCStringArrayIterator **iterator)
void AwaStringArray_DeleteValue(AwaStringArray *array, AwaArrayIndex index)
const char * AwaStringArray_GetValueAsCString(const AwaStringArray *array, AwaArrayIndex index)
AwaResourceType AwaChangeSet_GetResourceType(const AwaChangeSet *changeSet, const char *path)
Get the resource type for the specified change.
AwaError AwaChangeSet_GetValueAsObjectLinkPointer(const AwaChangeSet *changeSet, const char *path, const AwaObjectLink **value)
AwaObjectLinkArray * AwaObjectLinkArray_New(void)
void AwaResourceDefinitionIterator_Free(AwaResourceDefinitionIterator **iterator)
Clean up an Resource Definition iterator, freeing all allocated resources.
struct _AwaTimeArray AwaTimeArray
Definition: common.h:102
AwaStringArray * AwaStringArray_New(void)
int AwaObjectInstanceID
Definition: types.h:44
size_t AwaArrayIndex
Represents a multiple-instance array index value.
Definition: common.h:89
struct _AwaTimeArrayIterator AwaTimeArrayIterator
Definition: common.h:111
AwaError AwaObjectDefinition_AddResourceDefinitionAsOpaqueArray(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaOpaqueArray *defaultArray)
AwaChangeType
Supported change types for a change subscription.
Definition: common.h:51
bool AwaObjectLinkArrayIterator_Next(AwaObjectLinkArrayIterator *iterator)
struct _AwaChangeSet AwaChangeSet
Definition: common.h:734
struct _AwaResourceDefinitionIterator AwaResourceDefinitionIterator
Definition: common.h:349
AwaResourceOperations
Supported resource operations for management servers.
Definition: types.h:133
bool AwaBooleanArrayIterator_Next(AwaBooleanArrayIterator *iterator)
AwaArrayIndex AwaBooleanArrayIterator_GetIndex(const AwaBooleanArrayIterator *iterator)
bool AwaChangeSet_HasValue(const AwaChangeSet *changeSet, const char *path)
Test if the ChangeSet has a value for the specified resource path.
void AwaBooleanArray_Free(AwaBooleanArray **array)
void AwaStringArray_Free(AwaStringArray **array)
AwaError AwaChangeSet_GetValuesAsOpaqueArrayPointer(const AwaChangeSet *changeSet, const char *path, const AwaOpaqueArray **valueArray)
AwaIntegerArray * AwaIntegerArray_New(void)
size_t AwaStringArray_GetValueCount(const AwaStringArray *array)
AwaChangeType AwaChangeSet_GetChangeType(const AwaChangeSet *changeSet, const char *path)
Retrieve the change type for a specified path in a ChangeSet.
const char * AwaCStringArrayIterator_GetValueAsCString(const AwaCStringArrayIterator *iterator)
size_t AwaIntegerArray_GetValueCount(const AwaIntegerArray *array)
bool AwaResourceDefinitionIterator_Next(AwaResourceDefinitionIterator *iterator)
Determine whether the Resource Definition iterator has not reached the end of a set of Resource Defin...
AwaTimeArray * AwaTimeArray_New(void)
AwaError AwaObjectDefinition_AddResourceDefinitionAsBoolean(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaBoolean defaultValue)
AwaFloat AwaFloatArray_GetValue(const AwaFloatArray *array, AwaArrayIndex index)
Definition: common.h:77
struct _AwaObjectDefinitionIterator AwaObjectDefinitionIterator
Definition: common.h:348
AwaError AwaChangeSet_GetValuesAsObjectLinkArrayPointer(const AwaChangeSet *changeSet, const char *path, const AwaObjectLinkArray **valueArray)
AwaIntegerArrayIterator * AwaIntegerArray_NewIntegerArrayIterator(const AwaIntegerArray *array)
AwaObjectDefinition * AwaObjectDefinition_New(AwaObjectID objectID, const char *objectName, int minimumInstances, int maximumInstances)
Define object metadata against an Object ID.
AwaError AwaObjectDefinition_AddResourceDefinitionAsBooleanArray(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaBooleanArray *defaultArray)
AwaResourceDefinitionIterator * AwaObjectDefinition_NewResourceDefinitionIterator(const AwaObjectDefinition *objectDefinition)
Retrieves a new Resource Definition iterator that can be used to iterate through the set of defined r...
void AwaOpaqueArray_Free(AwaOpaqueArray **array)
AwaError AwaChangeSet_GetValuesAsStringArrayPointer(const AwaChangeSet *changeSet, const char *path, const AwaStringArray **valueArray)
AwaError AwaChangeSet_GetValuesAsIntegerArrayPointer(const AwaChangeSet *changeSet, const char *path, const AwaIntegerArray **valueArray)
size_t AwaBooleanArray_GetValueCount(const AwaBooleanArray *array)
AwaPathIterator * AwaChangeSet_NewPathIterator(const AwaChangeSet *changeSet)
Create a new Path Iterator for a ChangeSet, used to iterate through the list of resource paths retrie...
void AwaBooleanArray_DeleteValue(AwaBooleanArray *array, AwaArrayIndex index)
indicates an object instance was modified on the specified path
Definition: common.h:60
void AwaPathIterator_Free(AwaPathIterator **iterator)
Clean up a Path Iterator, freeing all allocated resources.
TODO: indicates the current value of an object instance or resource on the specified path on subscrip...
Definition: common.h:63
void AwaObjectLinkArray_Free(AwaObjectLinkArray **array)
size_t AwaTimeArray_GetValueCount(const AwaTimeArray *array)
int AwaResourceDefinition_GetMinimumInstances(const AwaResourceDefinition *resourceDefinition)
Retrieve the minimum number of instances which can be created for an Resource Definition.
AwaError AwaChangeSet_GetValueAsTimePointer(const AwaChangeSet *changeSet, const char *path, const AwaTime **value)
AwaOpaque AwaExecuteArguments
Definition: common.h:703
void AwaFloatArray_SetValue(AwaFloatArray *array, AwaArrayIndex index, AwaFloat value)
double AwaFloat
Corresponds to the LWM2M Float type.
Definition: types.h:66
AwaOpaque AwaOpaqueArray_GetValue(const AwaOpaqueArray *array, AwaArrayIndex index)
AwaBoolean AwaBooleanArray_GetValue(const AwaBooleanArray *array, AwaArrayIndex index)
int AwaObjectDefinition_GetMinimumInstances(const AwaObjectDefinition *objectDefinition)
Retrieve the minimum number of instances which can be created for an Object Definition.
struct _ObjectDefinition AwaObjectDefinition
Definition: common.h:346
AwaObjectLink AwaObjectLinkArrayIterator_GetValue(const AwaObjectLinkArrayIterator *iterator)
void AwaStringArray_SetValueAsCString(AwaStringArray *array, AwaArrayIndex index, const char *value)
struct _AwaStringArray AwaStringArray
Definition: common.h:97
int AwaObjectID
Definition: types.h:43
int AwaResourceDefinition_GetMaximumInstances(const AwaResourceDefinition *resourceDefinition)
Retrieve the maximum number of instances which can be created for an Resource Definition.
AwaError AwaObjectDefinition_AddResourceDefinitionAsNoType(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations)
Add a Resource Definition to an existing Object Definition.
bool AwaTimeArrayIterator_Next(AwaTimeArrayIterator *iterator)
const AwaObjectDefinition * AwaObjectDefinitionIterator_Get(const AwaObjectDefinitionIterator *iterator)
Retrieve the current Object Definition from an Object Definition iterator.
AwaOpaqueArrayIterator * AwaOpaqueArray_NewOpaqueArrayIterator(const AwaOpaqueArray *array)
AwaArrayIndex AwaTimeArrayIterator_GetIndex(const AwaTimeArrayIterator *iterator)
AwaError AwaObjectDefinition_AddResourceDefinitionAsTime(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaTime defaultValue)
void AwaOpaqueArray_SetValue(AwaOpaqueArray *array, AwaArrayIndex index, AwaOpaque value)
struct _AwaCStringArrayIterator AwaCStringArrayIterator
Definition: common.h:106
AwaLogLevel
Supported log levels for a log command.
Definition: types.h:150
void AwaObjectLinkArray_SetValue(AwaObjectLinkArray *array, AwaArrayIndex index, AwaObjectLink value)
int AwaResourceID
Definition: types.h:45
AwaResourceOperations AwaResourceDefinition_GetSupportedOperations(const AwaResourceDefinition *resourceDefinition)
Retrieve the supported operations for an Resource Definition.
AwaTimeArrayIterator * AwaTimeArray_NewTimeArrayIterator(const AwaTimeArray *array)
bool AwaCStringArrayIterator_Next(AwaCStringArrayIterator *iterator)
indicates an invalid change type for the specified path
Definition: common.h:53
bool AwaAPI_IsPathValid(const char *path)
Check if a path string conforms to the valid path syntax.
bool AwaIntegerArray_IsValid(const AwaIntegerArray *array, AwaArrayIndex index)
AwaSubscribeType
Supported subscribe types.
Definition: common.h:75
bool AwaFloatArrayIterator_Next(AwaFloatArrayIterator *iterator)
AwaError AwaChangeSet_GetValueAsIntegerPointer(const AwaChangeSet *changeSet, const char *path, const AwaInteger **value)
AwaObjectLink AwaObjectLinkArray_GetValue(const AwaObjectLinkArray *array, AwaArrayIndex index)
const AwaResourceDefinition * AwaObjectDefinition_GetResourceDefinition(const AwaObjectDefinition *objectDefinition, AwaResourceID resourceID)
Retrieve a Resource Definition from an Object Definition using a resource ID.
bool AwaObjectLinkArray_IsValid(const AwaObjectLinkArray *array, AwaArrayIndex index)
int64_t AwaInteger
Corresponds to the LWM2M 64-bit Integer type.
Definition: types.h:61
AwaError AwaObjectDefinition_AddResourceDefinitionAsIntegerArray(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaIntegerArray *defaultArray)
bool AwaChangeSet_ContainsPath(const AwaChangeSet *changeSet, const char *path)
Test if the ChangeSet has the specified path (resource, object instance or object) present...
struct _AwaObjectLinkArray AwaObjectLinkArray
Definition: common.h:103
size_t AwaFloatArray_GetValueCount(const AwaFloatArray *array)
void AwaTimeArray_DeleteValue(AwaTimeArray *array, AwaArrayIndex index)
bool AwaObjectDefinitionIterator_Next(AwaObjectDefinitionIterator *iterator)
Determine whether the Object Definition iterator has not reached the end of a set of Object Definitio...
AwaResourceType
Supported resource types.
Definition: types.h:101
AwaError AwaChangeSet_GetValueAsOpaquePointer(const AwaChangeSet *changeSet, const char *path, const AwaOpaque **value)
AwaError AwaObjectDefinition_AddResourceDefinitionAsStringArray(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaStringArray *defaultArray)
const AwaResourceDefinition * AwaResourceDefinitionIterator_Get(const AwaResourceDefinitionIterator *iterator)
Retrieve the current Resource Definition from an Resource Definition iterator.
AwaArrayIndex AwaCStringArrayIterator_GetIndex(const AwaCStringArrayIterator *iterator)
AwaLWM2MError AwaPathResult_GetLWM2MError(const AwaPathResult *result)
Retrieve a LWM2M error from a Path Result.
void AwaTimeArray_SetValue(AwaTimeArray *array, AwaArrayIndex index, AwaTime value)
AwaResourceID AwaResourceDefinition_GetID(const AwaResourceDefinition *resourceDefinition)
Retrieve the unique ID of a Resource Definition.
int64_t AwaTime
Corresponds to the LWM2M Time type.
Definition: types.h:76
AwaError AwaChangeSet_GetValueAsFloatPointer(const AwaChangeSet *changeSet, const char *path, const AwaFloat **value)
struct _AwaFloatArrayIterator AwaFloatArrayIterator
Definition: common.h:108
struct _AwaObjectLinkArrayIterator AwaObjectLinkArrayIterator
Definition: common.h:112
AwaArrayIndex AwaObjectLinkArrayIterator_GetIndex(const AwaObjectLinkArrayIterator *iterator)
AwaFloatArrayIterator * AwaFloatArray_NewFloatArrayIterator(const AwaFloatArray *array)
AwaError AwaChangeSet_GetValuesAsFloatArrayPointer(const AwaChangeSet *changeSet, const char *path, const AwaFloatArray **valueArray)
AwaError AwaChangeSet_GetValueAsBooleanPointer(const AwaChangeSet *changeSet, const char *path, const AwaBoolean **value)
void AwaFloatArrayIterator_Free(AwaFloatArrayIterator **iterator)
struct _AwaPathIterator AwaPathIterator
Definition: common.h:617
bool AwaFloatArray_IsValid(const AwaFloatArray *array, AwaArrayIndex index)
AwaLWM2MError
Definition: error.h:93
void AwaIntegerArrayIterator_Free(AwaIntegerArrayIterator **iterator)
AwaError AwaAPI_MakePath(char *path, size_t pathSize, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID, AwaResourceID resourceID)
Construct a path from an object, object instance, and resource ID.
AwaError AwaObjectDefinition_AddResourceDefinitionAsString(AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, const char *defaultValue)
Definition: common.h:78
int AwaObjectDefinition_GetMaximumInstances(const AwaObjectDefinition *objectDefinition)
Retrieve the maximum number of instances which can be created for an Object Definition.
void AwaOpaqueArrayIterator_Free(AwaOpaqueArrayIterator **iterator)
struct _ResourceDefinition AwaResourceDefinition
Definition: common.h:347