Awa LWM2M C API (0.2.5)  
Typedefs | Enumerations | Functions
common.h File Reference

Provides declarations and definitions that are common to the Awa LWM2M API and Static API. More...

#include "types.h"
#include "error.h"
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef int AwaTimeout
 Represents a timeout value, in milliseconds. More...
 
typedef size_t AwaArrayIndex
 Represents a multiple-instance array index value. More...
 
typedef size_t AwaArrayLength
 Represents a multiple-instance array length value. More...
 
typedef struct _AwaStringArray AwaStringArray
 
typedef struct _AwaIntegerArray AwaIntegerArray
 
typedef struct _AwaFloatArray AwaFloatArray
 
typedef struct _AwaBooleanArray AwaBooleanArray
 
typedef struct _AwaOpaqueArray AwaOpaqueArray
 
typedef struct _AwaTimeArray AwaTimeArray
 
typedef struct _AwaObjectLinkArray AwaObjectLinkArray
 
typedef struct _AwaCStringArrayIterator AwaCStringArrayIterator
 
typedef struct _AwaIntegerArrayIterator AwaIntegerArrayIterator
 
typedef struct _AwaFloatArrayIterator AwaFloatArrayIterator
 
typedef struct _AwaBooleanArrayIterator AwaBooleanArrayIterator
 
typedef struct _AwaOpaqueArrayIterator AwaOpaqueArrayIterator
 
typedef struct _AwaTimeArrayIterator AwaTimeArrayIterator
 
typedef struct _AwaObjectLinkArrayIterator AwaObjectLinkArrayIterator
 
typedef struct _ObjectDefinition AwaObjectDefinition
 
typedef struct _ResourceDefinition AwaResourceDefinition
 
typedef struct _AwaObjectDefinitionIterator AwaObjectDefinitionIterator
 
typedef struct _AwaResourceDefinitionIterator AwaResourceDefinitionIterator
 
typedef struct _AwaPathIterator AwaPathIterator
 
typedef AwaOpaque AwaExecuteArguments
 
typedef struct _AwaPathResult AwaPathResult
 
typedef struct _AwaChangeSet AwaChangeSet
 

Enumerations

enum  AwaChangeType {
  AwaChangeType_Invalid,
  AwaChangeType_ResourceCreated,
  AwaChangeType_ResourceModified,
  AwaChangeType_ResourceDeleted,
  AwaChangeType_ObjectInstanceCreated,
  AwaChangeType_ObjectInstanceModified,
  AwaChangeType_ObjectInstanceDeleted,
  AwaChangeType_Current
}
 Supported change types for a change subscription. More...
 
enum  AwaSubscribeType {
  AwaSubscribeType_None,
  AwaSubscribeType_Change,
  AwaSubscribeType_Execute
}
 Supported subscribe types. More...
 

Functions

AwaStringArrayAwaStringArray_New (void)
 
AwaIntegerArrayAwaIntegerArray_New (void)
 
AwaFloatArrayAwaFloatArray_New (void)
 
AwaBooleanArrayAwaBooleanArray_New (void)
 
AwaOpaqueArrayAwaOpaqueArray_New (void)
 
AwaTimeArrayAwaTimeArray_New (void)
 
AwaObjectLinkArrayAwaObjectLinkArray_New (void)
 
void AwaStringArray_Free (AwaStringArray **array)
 
void AwaIntegerArray_Free (AwaIntegerArray **array)
 
void AwaFloatArray_Free (AwaFloatArray **array)
 
void AwaBooleanArray_Free (AwaBooleanArray **array)
 
void AwaOpaqueArray_Free (AwaOpaqueArray **array)
 
void AwaTimeArray_Free (AwaTimeArray **array)
 
void AwaObjectLinkArray_Free (AwaObjectLinkArray **array)
 
void AwaStringArray_SetValueAsCString (AwaStringArray *array, AwaArrayIndex index, const char *value)
 
void AwaIntegerArray_SetValue (AwaIntegerArray *array, AwaArrayIndex index, AwaInteger value)
 
void AwaFloatArray_SetValue (AwaFloatArray *array, AwaArrayIndex index, AwaFloat value)
 
void AwaBooleanArray_SetValue (AwaBooleanArray *array, AwaArrayIndex index, AwaBoolean value)
 
void AwaOpaqueArray_SetValue (AwaOpaqueArray *array, AwaArrayIndex index, AwaOpaque value)
 
void AwaTimeArray_SetValue (AwaTimeArray *array, AwaArrayIndex index, AwaTime value)
 
void AwaObjectLinkArray_SetValue (AwaObjectLinkArray *array, AwaArrayIndex index, AwaObjectLink value)
 
void AwaStringArray_DeleteValue (AwaStringArray *array, AwaArrayIndex index)
 
void AwaIntegerArray_DeleteValue (AwaIntegerArray *array, AwaArrayIndex index)
 
void AwaFloatArray_DeleteValue (AwaFloatArray *array, AwaArrayIndex index)
 
void AwaBooleanArray_DeleteValue (AwaBooleanArray *array, AwaArrayIndex index)
 
void AwaOpaqueArray_DeleteValue (AwaOpaqueArray *array, AwaArrayIndex index)
 
void AwaTimeArray_DeleteValue (AwaTimeArray *array, AwaArrayIndex index)
 
void AwaObjectLinkArray_DeleteValue (AwaObjectLinkArray *array, AwaArrayIndex index)
 
const char * AwaStringArray_GetValueAsCString (const AwaStringArray *array, AwaArrayIndex index)
 
AwaInteger AwaIntegerArray_GetValue (const AwaIntegerArray *array, AwaArrayIndex index)
 
AwaFloat AwaFloatArray_GetValue (const AwaFloatArray *array, AwaArrayIndex index)
 
AwaBoolean AwaBooleanArray_GetValue (const AwaBooleanArray *array, AwaArrayIndex index)
 
AwaOpaque AwaOpaqueArray_GetValue (const AwaOpaqueArray *array, AwaArrayIndex index)
 
AwaTime AwaTimeArray_GetValue (const AwaTimeArray *array, AwaArrayIndex index)
 
AwaObjectLink AwaObjectLinkArray_GetValue (const AwaObjectLinkArray *array, AwaArrayIndex index)
 
size_t AwaStringArray_GetValueCount (const AwaStringArray *array)
 
size_t AwaIntegerArray_GetValueCount (const AwaIntegerArray *array)
 
size_t AwaFloatArray_GetValueCount (const AwaFloatArray *array)
 
size_t AwaBooleanArray_GetValueCount (const AwaBooleanArray *array)
 
size_t AwaOpaqueArray_GetValueCount (const AwaOpaqueArray *array)
 
size_t AwaTimeArray_GetValueCount (const AwaTimeArray *array)
 
size_t AwaObjectLinkArray_GetValueCount (const AwaObjectLinkArray *array)
 
AwaCStringArrayIteratorAwaStringArray_NewCStringArrayIterator (const AwaStringArray *array)
 
AwaIntegerArrayIteratorAwaIntegerArray_NewIntegerArrayIterator (const AwaIntegerArray *array)
 
AwaFloatArrayIteratorAwaFloatArray_NewFloatArrayIterator (const AwaFloatArray *array)
 
AwaBooleanArrayIteratorAwaBooleanArray_NewBooleanArrayIterator (const AwaBooleanArray *array)
 
AwaOpaqueArrayIteratorAwaOpaqueArray_NewOpaqueArrayIterator (const AwaOpaqueArray *array)
 
AwaTimeArrayIteratorAwaTimeArray_NewTimeArrayIterator (const AwaTimeArray *array)
 
AwaObjectLinkArrayIteratorAwaObjectLinkArray_NewObjectLinkArrayIterator (const AwaObjectLinkArray *array)
 
bool AwaStringArray_IsValid (const AwaStringArray *array, AwaArrayIndex index)
 
bool AwaIntegerArray_IsValid (const AwaIntegerArray *array, AwaArrayIndex index)
 
bool AwaFloatArray_IsValid (const AwaFloatArray *array, AwaArrayIndex index)
 
bool AwaBooleanArray_IsValid (const AwaBooleanArray *array, AwaArrayIndex index)
 
bool AwaOpaqueArray_IsValid (const AwaOpaqueArray *array, AwaArrayIndex index)
 
bool AwaTimeArray_IsValid (const AwaTimeArray *array, AwaArrayIndex index)
 
bool AwaObjectLinkArray_IsValid (const AwaObjectLinkArray *array, AwaArrayIndex index)
 
bool AwaCStringArrayIterator_Next (AwaCStringArrayIterator *iterator)
 
bool AwaIntegerArrayIterator_Next (AwaIntegerArrayIterator *iterator)
 
bool AwaFloatArrayIterator_Next (AwaFloatArrayIterator *iterator)
 
bool AwaBooleanArrayIterator_Next (AwaBooleanArrayIterator *iterator)
 
bool AwaOpaqueArrayIterator_Next (AwaOpaqueArrayIterator *iterator)
 
bool AwaTimeArrayIterator_Next (AwaTimeArrayIterator *iterator)
 
bool AwaObjectLinkArrayIterator_Next (AwaObjectLinkArrayIterator *iterator)
 
AwaArrayIndex AwaCStringArrayIterator_GetIndex (const AwaCStringArrayIterator *iterator)
 
AwaArrayIndex AwaIntegerArrayIterator_GetIndex (const AwaIntegerArrayIterator *iterator)
 
AwaArrayIndex AwaFloatArrayIterator_GetIndex (const AwaFloatArrayIterator *iterator)
 
AwaArrayIndex AwaBooleanArrayIterator_GetIndex (const AwaBooleanArrayIterator *iterator)
 
AwaArrayIndex AwaOpaqueArrayIterator_GetIndex (const AwaOpaqueArrayIterator *iterator)
 
AwaArrayIndex AwaTimeArrayIterator_GetIndex (const AwaTimeArrayIterator *iterator)
 
AwaArrayIndex AwaObjectLinkArrayIterator_GetIndex (const AwaObjectLinkArrayIterator *iterator)
 
const char * AwaCStringArrayIterator_GetValueAsCString (const AwaCStringArrayIterator *iterator)
 
AwaInteger AwaIntegerArrayIterator_GetValue (const AwaIntegerArrayIterator *iterator)
 
AwaFloat AwaFloatArrayIterator_GetValue (const AwaFloatArrayIterator *iterator)
 
AwaBoolean AwaBooleanArrayIterator_GetValue (const AwaBooleanArrayIterator *iterator)
 
AwaOpaque AwaOpaqueArrayIterator_GetValue (const AwaOpaqueArrayIterator *iterator)
 
AwaTime AwaTimeArrayIterator_GetValue (const AwaTimeArrayIterator *iterator)
 
AwaObjectLink AwaObjectLinkArrayIterator_GetValue (const AwaObjectLinkArrayIterator *iterator)
 
void AwaCStringArrayIterator_Free (AwaCStringArrayIterator **iterator)
 
void AwaIntegerArrayIterator_Free (AwaIntegerArrayIterator **iterator)
 
void AwaFloatArrayIterator_Free (AwaFloatArrayIterator **iterator)
 
void AwaBooleanArrayIterator_Free (AwaBooleanArrayIterator **iterator)
 
void AwaOpaqueArrayIterator_Free (AwaOpaqueArrayIterator **iterator)
 
void AwaTimeArrayIterator_Free (AwaTimeArrayIterator **iterator)
 
void AwaObjectLinkArrayIterator_Free (AwaObjectLinkArrayIterator **iterator)
 
AwaObjectDefinitionAwaObjectDefinition_New (AwaObjectID objectID, const char *objectName, int minimumInstances, int maximumInstances)
 Define object metadata against an Object ID. More...
 
void AwaObjectDefinition_Free (AwaObjectDefinition **objectDefinition)
 Clean up an Object Definition, freeing all allocated resources. More...
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsNoType (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations)
 Add a Resource Definition to an existing Object Definition. More...
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsString (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, const char *defaultValue)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsInteger (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaInteger defaultValue)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsFloat (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaFloat defaultValue)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsBoolean (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaBoolean defaultValue)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsOpaque (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaOpaque defaultValue)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsTime (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaTime defaultValue)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsObjectLink (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, bool isMandatory, AwaResourceOperations operations, AwaObjectLink defaultValue)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsStringArray (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaStringArray *defaultArray)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsIntegerArray (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaIntegerArray *defaultArray)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsFloatArray (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaFloatArray *defaultArray)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsBooleanArray (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaBooleanArray *defaultArray)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsTimeArray (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaTimeArray *defaultArray)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsOpaqueArray (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaOpaqueArray *defaultArray)
 
AwaError AwaObjectDefinition_AddResourceDefinitionAsObjectLinkArray (AwaObjectDefinition *objectDefinition, AwaResourceID resourceID, const char *resourceName, int minimumInstances, int maximumInstances, AwaResourceOperations operations, const AwaObjectLinkArray *defaultArray)
 
AwaObjectID AwaObjectDefinition_GetID (const AwaObjectDefinition *objectDefinition)
 Retrieve the unique ID of an Object Definition. More...
 
const char * AwaObjectDefinition_GetName (const AwaObjectDefinition *objectDefinition)
 Retrieve the name of an Object Definition. More...
 
int AwaObjectDefinition_GetMinimumInstances (const AwaObjectDefinition *objectDefinition)
 Retrieve the minimum number of instances which can be created for an Object Definition. More...
 
int AwaObjectDefinition_GetMaximumInstances (const AwaObjectDefinition *objectDefinition)
 Retrieve the maximum number of instances which can be created for an Object Definition. More...
 
bool AwaObjectDefinition_IsResourceDefined (const AwaObjectDefinition *objectDefinition, AwaResourceID resourceID)
 Determine whether a Resource Definition exists within an Object Definition for the specified ID. More...
 
const AwaResourceDefinitionAwaObjectDefinition_GetResourceDefinition (const AwaObjectDefinition *objectDefinition, AwaResourceID resourceID)
 Retrieve a Resource Definition from an Object Definition using a resource ID. More...
 
bool AwaObjectDefinitionIterator_Next (AwaObjectDefinitionIterator *iterator)
 Determine whether the Object Definition iterator has not reached the end of a set of Object Definitions. More...
 
const AwaObjectDefinitionAwaObjectDefinitionIterator_Get (const AwaObjectDefinitionIterator *iterator)
 Retrieve the current Object Definition from an Object Definition iterator. More...
 
void AwaObjectDefinitionIterator_Free (AwaObjectDefinitionIterator **iterator)
 Clean up an Object Definition iterator, freeing all allocated resources. More...
 
AwaResourceID AwaResourceDefinition_GetID (const AwaResourceDefinition *resourceDefinition)
 Retrieve the unique ID of a Resource Definition. More...
 
AwaResourceType AwaResourceDefinition_GetType (const AwaResourceDefinition *resourceDefinition)
 Retrieve the resource type of a Resource Definition. More...
 
const char * AwaResourceDefinition_GetName (const AwaResourceDefinition *resourceDefinition)
 Retrieve the name of a Resource Definition. More...
 
int AwaResourceDefinition_GetMinimumInstances (const AwaResourceDefinition *resourceDefinition)
 Retrieve the minimum number of instances which can be created for an Resource Definition. More...
 
int AwaResourceDefinition_GetMaximumInstances (const AwaResourceDefinition *resourceDefinition)
 Retrieve the maximum number of instances which can be created for an Resource Definition. More...
 
AwaResourceOperations AwaResourceDefinition_GetSupportedOperations (const AwaResourceDefinition *resourceDefinition)
 Retrieve the supported operations for an Resource Definition. More...
 
bool AwaResourceDefinition_IsMandatory (const AwaResourceDefinition *resourceDefinition)
 Determine whether or not a Resource Definition is mandatory. More...
 
AwaResourceDefinitionIteratorAwaObjectDefinition_NewResourceDefinitionIterator (const AwaObjectDefinition *objectDefinition)
 Retrieves a new Resource Definition iterator that can be used to iterate through the set of defined resources within an Object Definition. More...
 
bool AwaResourceDefinitionIterator_Next (AwaResourceDefinitionIterator *iterator)
 Determine whether the Resource Definition iterator has not reached the end of a set of Resource Definitions. More...
 
const AwaResourceDefinitionAwaResourceDefinitionIterator_Get (const AwaResourceDefinitionIterator *iterator)
 Retrieve the current Resource Definition from an Resource Definition iterator. More...
 
void AwaResourceDefinitionIterator_Free (AwaResourceDefinitionIterator **iterator)
 Clean up an Resource Definition iterator, freeing all allocated resources. More...
 
bool AwaPathIterator_Next (AwaPathIterator *iterator)
 Determine whether the Path Iterator has not reached the end of a set of paths. More...
 
const char * AwaPathIterator_Get (const AwaPathIterator *iterator)
 Retrieve the current path from a Path Iterator. More...
 
void AwaPathIterator_Free (AwaPathIterator **iterator)
 Clean up a Path Iterator, freeing all allocated resources. More...
 
AwaError AwaAPI_MakeObjectPath (char *path, size_t pathSize, AwaObjectID objectID)
 Construct a path from an object ID. More...
 
AwaError AwaAPI_MakeObjectInstancePath (char *path, size_t pathSize, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID)
 Construct a path from an object and object instance ID. More...
 
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. More...
 
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. More...
 
bool AwaAPI_IsPathValid (const char *path)
 Check if a path string conforms to the valid path syntax. More...
 
AwaError AwaPathResult_GetError (const AwaPathResult *result)
 Retrieve an error from a Path Result. More...
 
AwaLWM2MError AwaPathResult_GetLWM2MError (const AwaPathResult *result)
 Retrieve a LWM2M error from a Path Result. More...
 
AwaPathIteratorAwaChangeSet_NewPathIterator (const AwaChangeSet *changeSet)
 Create a new Path Iterator for a ChangeSet, used to iterate through the list of resource paths retrieved by the corresponding Change Subscription or Observation. More...
 
AwaChangeType AwaChangeSet_GetChangeType (const AwaChangeSet *changeSet, const char *path)
 Retrieve the change type for a specified path in a ChangeSet. More...
 
bool AwaChangeSet_HasValue (const AwaChangeSet *changeSet, const char *path)
 Test if the ChangeSet has a value for the specified resource path. More...
 
bool AwaChangeSet_ContainsPath (const AwaChangeSet *changeSet, const char *path)
 Test if the ChangeSet has the specified path (resource, object instance or object) present. More...
 
AwaResourceType AwaChangeSet_GetResourceType (const AwaChangeSet *changeSet, const char *path)
 Get the resource type for the specified change. More...
 
AwaError AwaChangeSet_GetValueAsCStringPointer (const AwaChangeSet *changeSet, const char *path, const char **value)
 
AwaError AwaChangeSet_GetValueAsIntegerPointer (const AwaChangeSet *changeSet, const char *path, const AwaInteger **value)
 
AwaError AwaChangeSet_GetValueAsFloatPointer (const AwaChangeSet *changeSet, const char *path, const AwaFloat **value)
 
AwaError AwaChangeSet_GetValueAsBooleanPointer (const AwaChangeSet *changeSet, const char *path, const AwaBoolean **value)
 
AwaError AwaChangeSet_GetValueAsTimePointer (const AwaChangeSet *changeSet, const char *path, const AwaTime **value)
 
AwaError AwaChangeSet_GetValueAsObjectLinkPointer (const AwaChangeSet *changeSet, const char *path, const AwaObjectLink **value)
 
AwaError AwaChangeSet_GetValueAsOpaquePointer (const AwaChangeSet *changeSet, const char *path, const AwaOpaque **value)
 
AwaError AwaChangeSet_GetValueAsOpaque (const AwaChangeSet *changeSet, const char *path, AwaOpaque *value)
 Retrieve an opaque resource's value from a ChangeSet. More...
 
AwaError AwaChangeSet_GetValueAsObjectLink (const AwaChangeSet *changeSet, const char *path, AwaObjectLink *value)
 Retrieve an object link resource's value from a ChangeSet. More...
 
AwaError AwaChangeSet_GetValuesAsStringArrayPointer (const AwaChangeSet *changeSet, const char *path, const AwaStringArray **valueArray)
 
AwaError AwaChangeSet_GetValuesAsIntegerArrayPointer (const AwaChangeSet *changeSet, const char *path, const AwaIntegerArray **valueArray)
 
AwaError AwaChangeSet_GetValuesAsFloatArrayPointer (const AwaChangeSet *changeSet, const char *path, const AwaFloatArray **valueArray)
 
AwaError AwaChangeSet_GetValuesAsBooleanArrayPointer (const AwaChangeSet *changeSet, const char *path, const AwaBooleanArray **valueArray)
 
AwaError AwaChangeSet_GetValuesAsTimeArrayPointer (const AwaChangeSet *changeSet, const char *path, const AwaTimeArray **valueArray)
 
AwaError AwaChangeSet_GetValuesAsOpaqueArrayPointer (const AwaChangeSet *changeSet, const char *path, const AwaOpaqueArray **valueArray)
 
AwaError AwaChangeSet_GetValuesAsObjectLinkArrayPointer (const AwaChangeSet *changeSet, const char *path, const AwaObjectLinkArray **valueArray)
 
AwaLogLevel AwaLog_SetLevel (AwaLogLevel level)
 Set the current API log level. More...
 

Detailed Description

Provides declarations and definitions that are common to the Awa LWM2M API and Static API.

Typedef Documentation

typedef int AwaTimeout

Represents a timeout value, in milliseconds.

typedef size_t AwaArrayIndex

Represents a multiple-instance array index value.

typedef size_t AwaArrayLength

Represents a multiple-instance array length value.

typedef struct _AwaStringArray AwaStringArray
typedef struct _AwaIntegerArray AwaIntegerArray
typedef struct _AwaFloatArray AwaFloatArray
typedef struct _AwaBooleanArray AwaBooleanArray
typedef struct _AwaOpaqueArray AwaOpaqueArray
typedef struct _AwaTimeArray AwaTimeArray
typedef struct _AwaObjectLinkArray AwaObjectLinkArray
typedef struct _AwaCStringArrayIterator AwaCStringArrayIterator
typedef struct _AwaIntegerArrayIterator AwaIntegerArrayIterator
typedef struct _AwaFloatArrayIterator AwaFloatArrayIterator
typedef struct _AwaBooleanArrayIterator AwaBooleanArrayIterator
typedef struct _AwaOpaqueArrayIterator AwaOpaqueArrayIterator
typedef struct _AwaTimeArrayIterator AwaTimeArrayIterator
typedef struct _AwaObjectLinkArrayIterator AwaObjectLinkArrayIterator
typedef struct _ObjectDefinition AwaObjectDefinition
typedef struct _ResourceDefinition AwaResourceDefinition
typedef struct _AwaObjectDefinitionIterator AwaObjectDefinitionIterator
typedef struct _AwaResourceDefinitionIterator AwaResourceDefinitionIterator
typedef struct _AwaPathIterator AwaPathIterator
typedef struct _AwaPathResult AwaPathResult
typedef struct _AwaChangeSet AwaChangeSet

Enumeration Type Documentation

Supported change types for a change subscription.

Enumerator
AwaChangeType_Invalid 

indicates an invalid change type for the specified path

AwaChangeType_ResourceCreated 

indicates a resource was created on the specified path

AwaChangeType_ResourceModified 

indicates a resource was modified on the specified path

AwaChangeType_ResourceDeleted 

indicates a resource was deleted on the specified path

AwaChangeType_ObjectInstanceCreated 

indicates an object instance was created on the specified path

AwaChangeType_ObjectInstanceModified 

indicates an object instance was modified on the specified path

AwaChangeType_ObjectInstanceDeleted 

indicates an object instance was deleted on the specified path

AwaChangeType_Current 

TODO: indicates the current value of an object instance or resource on the specified path on subscription creation.

Supported subscribe types.

Enumerator
AwaSubscribeType_None 
AwaSubscribeType_Change 
AwaSubscribeType_Execute 

Function Documentation

AwaObjectDefinition* AwaObjectDefinition_New ( AwaObjectID  objectID,
const char *  objectName,
int  minimumInstances,
int  maximumInstances 
)

Define object metadata against an Object ID.

This is required before resources can be defined against an Object ID.

Parameters
[in]objectIDThe numeric object ID to define.
[in]objectNameA descriptive name that is used to describe the Object.
[in]minimumInstancesMinimum number of instances required. If greater than zero, the object is mandatory.
[in]maximumInstancesThe maximum number of instances allowed. If 1, the object is single-instance. Maximum is AWA_MAX_ID.
Returns
A pointer to a new ObjectDefinition instance. This pointer should not be freed. Return NULL on failure.
Examples:
client-defineset-example.c, and server-defineset-example.c.
void AwaObjectDefinition_Free ( AwaObjectDefinition **  objectDefinition)

Clean up an Object Definition, freeing all allocated resources.

Once freed, the definition is no longer valid.

Parameters
[in,out]objectDefinitionA pointer to an Object Definition pointer that will be set to NULL.
AwaError AwaObjectDefinition_AddResourceDefinitionAsNoType ( AwaObjectDefinition objectDefinition,
AwaResourceID  resourceID,
const char *  resourceName,
bool  isMandatory,
AwaResourceOperations  operations 
)

Add a Resource Definition to an existing Object Definition.

Paths are not used here as Object Instance IDs are not relevant.

Parameters
[in]objectDefinitionA pointer to an Object Definition to add the Resource Definition to.
[in]resourceIDThe numeric resource ID to define.
[in]resourceNameA descriptive name that is used to describe the Resource.
[in]isMandatorywhether or not object instances must contain this resource. If not, this is an optional resource which must be created within its object instance before being used.
[in]operationsThe valid operations allowed on this resource.
Returns
AwaError_Success on success.
AwaError_DefinitionInvalid if the Object Definition is not valid.
AwaError_AlreadyDefined if a Resource Definition already exists for the Object Definition with the same resourceID.
AwaError_IDInvalid if resourceID is negative or larger than AWA_MAX_ID.
AwaError_OutOfMemory if there is not enough memory to create the Resource Definition.
AwaObjectID AwaObjectDefinition_GetID ( const AwaObjectDefinition objectDefinition)

Retrieve the unique ID of an Object Definition.

Parameters
[in]objectDefinitionA pointer to a valid Object Definition.
Returns
the ID of the Object Definition if it is valid.
AWA_INVALID_ID if the Object Definition is invalid.
Examples:
client-definition-iterator-example.c.
const char* AwaObjectDefinition_GetName ( const AwaObjectDefinition objectDefinition)

Retrieve the name of an Object Definition.

Parameters
[in]objectDefinitionA pointer to an Object Definition.
Returns
the name of the Object Definition if it is valid.
NULL if the Object Definition is invalid.
Examples:
client-definition-iterator-example.c.
int AwaObjectDefinition_GetMinimumInstances ( const AwaObjectDefinition objectDefinition)

Retrieve the minimum number of instances which can be created for an Object Definition.

Parameters
[in]objectDefinitionA pointer to an Object Definition.
Returns
the minimum number of instances of the Object Definition if it is valid.
-1 if the Object Definition is invalid.
Examples:
client-definition-iterator-example.c.
int AwaObjectDefinition_GetMaximumInstances ( const AwaObjectDefinition objectDefinition)

Retrieve the maximum number of instances which can be created for an Object Definition.

Parameters
[in]objectDefinitionA pointer to a valid Object Definition.
Returns
the maximum number of instances of the Object Definition if it is valid.
-1 if the Object Definition is invalid.
Examples:
client-definition-iterator-example.c.
bool AwaObjectDefinition_IsResourceDefined ( const AwaObjectDefinition objectDefinition,
AwaResourceID  resourceID 
)

Determine whether a Resource Definition exists within an Object Definition for the specified ID.

Parameters
[in]objectDefinitionA pointer to a valid Object Definition.
[in]resourceIDThe numeric resource ID.
Returns
true if the Object Definition is valid, and it contains a Resource Definition with the specified resourceID.
false if the Object Definition is invalid, or it does not contain a Resource Definition with the specified resourceID.
const AwaResourceDefinition* AwaObjectDefinition_GetResourceDefinition ( const AwaObjectDefinition objectDefinition,
AwaResourceID  resourceID 
)

Retrieve a Resource Definition from an Object Definition using a resource ID.

Parameters
[in]objectDefinitionA pointer to a valid Object Definition.
[in]resourceIDThe numeric resource ID of the Resource Definition to retrieve.
Returns
the Resource Definition that matches the specified resourceID, if the Object Definition is valid, and the Resource Definition exists.
NULL if the Object Definition is invalid, or it does not contain a Resource Definition with the specified resourceID.
bool AwaObjectDefinitionIterator_Next ( AwaObjectDefinitionIterator iterator)

Determine whether the Object Definition iterator has not reached the end of a set of Object Definitions.

If the iterator has not reached the end, advance its position to the next Object Definition.

Parameters
[in]iteratorA pointer to a valid Object Definition iterator.
Returns
true if the Object Definition iterator is valid and the iterator has not yet reached the end of its elements.
false if the Object Definition iterator is invalid, or has reached the end of its elements.
Examples:
client-definition-iterator-example.c.
const AwaObjectDefinition* AwaObjectDefinitionIterator_Get ( const AwaObjectDefinitionIterator iterator)

Retrieve the current Object Definition from an Object Definition iterator.

Parameters
[in]iteratorA pointer to a valid Object Definition iterator.
Returns
the current Object Definition of the Object Definition iterator if it is valid
NULL if the Object Definition iterator is invalid.
Examples:
client-definition-iterator-example.c.
void AwaObjectDefinitionIterator_Free ( AwaObjectDefinitionIterator **  iterator)

Clean up an Object Definition iterator, freeing all allocated resources.

Once freed, the iterator is no longer valid.

Parameters
[in,out]iteratorA pointer to an Object Definition iterator pointer that will be set to NULL.
Examples:
client-definition-iterator-example.c.
AwaResourceID AwaResourceDefinition_GetID ( const AwaResourceDefinition resourceDefinition)

Retrieve the unique ID of a Resource Definition.

Parameters
[in]resourceDefinitionA pointer to a valid Resource Definition.
Returns
the ID of the Resource Definition if it is valid.
AWA_INVALID_ID if the Resource Definition is invalid.
Examples:
client-definition-iterator-example.c.
AwaResourceType AwaResourceDefinition_GetType ( const AwaResourceDefinition resourceDefinition)

Retrieve the resource type of a Resource Definition.

Parameters
[in]resourceDefinitionA pointer to a valid Resource Definition.
Returns
the type of the Resource Definition if it is valid.
AwaResourceType_Invalid if the Resource Definition is invalid.
Examples:
client-definition-iterator-example.c.
const char* AwaResourceDefinition_GetName ( const AwaResourceDefinition resourceDefinition)

Retrieve the name of a Resource Definition.

Parameters
[in]resourceDefinitionA pointer to a valid Resource Definition.
Returns
the name of the Resource Definition if it is valid.
NULL if the Resource Definition is invalid.
Examples:
client-definition-iterator-example.c.
int AwaResourceDefinition_GetMinimumInstances ( const AwaResourceDefinition resourceDefinition)

Retrieve the minimum number of instances which can be created for an Resource Definition.

Parameters
[in]resourceDefinitionA pointer to an Resource Definition.
Returns
the minimum number of instances of the Resource Definition if it is valid.
-1 if the Resource Definition is invalid.
Examples:
client-definition-iterator-example.c.
int AwaResourceDefinition_GetMaximumInstances ( const AwaResourceDefinition resourceDefinition)

Retrieve the maximum number of instances which can be created for an Resource Definition.

Parameters
[in]resourceDefinitionA pointer to a valid Resource Definition.
Returns
the maximum number of instances of the Resource Definition if it is valid.
-1 if the Resource Definition is invalid.
Examples:
client-definition-iterator-example.c.
AwaResourceOperations AwaResourceDefinition_GetSupportedOperations ( const AwaResourceDefinition resourceDefinition)

Retrieve the supported operations for an Resource Definition.

Parameters
[in]resourceDefinitionA pointer to a valid Resource Definition.
Returns
the supported operations for the Resource Definition if it is valid.
AwaResourceOperations_None if the Resource Definition is invalid.
Examples:
client-definition-iterator-example.c.
bool AwaResourceDefinition_IsMandatory ( const AwaResourceDefinition resourceDefinition)

Determine whether or not a Resource Definition is mandatory.

Parameters
[in]resourceDefinitionA pointer to an Resource Definition.
Returns
true if the Resource Definition if is valid, and is mandatory.
false if the Resource Definition is invalid, or optional.
AwaResourceDefinitionIterator* AwaObjectDefinition_NewResourceDefinitionIterator ( const AwaObjectDefinition objectDefinition)

Retrieves a new Resource Definition iterator that can be used to iterate through the set of defined resources within an Object Definition.

The iterator is owned by the caller and should eventually be freed with AwaResourceDefinitionIterator_Free.

Parameters
[in]objectDefinitionPointer to a valid Object Definition.
Returns
A pointer to a Resource Definition iterator, if the objectDefinition is valid.
NULL if the objectDefinition is not valid.
Examples:
client-definition-iterator-example.c.
bool AwaResourceDefinitionIterator_Next ( AwaResourceDefinitionIterator iterator)

Determine whether the Resource Definition iterator has not reached the end of a set of Resource Definitions.

If the iterator has not reached the end, advance its position to the next Resource Definition.

Parameters
[in]iteratorA pointer to a valid Resource Definition iterator.
Returns
true if the Resource Definition iterator is valid and the iterator has not yet reached the end of its elements.
false if the Resource Definition iterator is invalid, or has reached the end of its elements.
Examples:
client-definition-iterator-example.c.
const AwaResourceDefinition* AwaResourceDefinitionIterator_Get ( const AwaResourceDefinitionIterator iterator)

Retrieve the current Resource Definition from an Resource Definition iterator.

Parameters
[in]iteratorA pointer to a valid Resource Definition iterator.
Returns
the current Resource Definition of the Resource Definition iterator if it is valid
NULL if the Resource Definition iterator is invalid.
Examples:
client-definition-iterator-example.c.
void AwaResourceDefinitionIterator_Free ( AwaResourceDefinitionIterator **  iterator)

Clean up an Resource Definition iterator, freeing all allocated resources.

Once freed, the iterator is no longer valid.

Parameters
[in,out]iteratorA pointer to an Resource Definition iterator pointer that will be set to NULL.
Examples:
client-definition-iterator-example.c.
bool AwaPathIterator_Next ( AwaPathIterator iterator)

Determine whether the Path Iterator has not reached the end of a set of paths.

If the iterator has not reached the end, advance its position to the next path.

Parameters
[in]iteratorA pointer to a valid Path Iterator.
Returns
true if the Path Iterator is valid and the iterator has not yet reached the end of its elements.
false if the Path Iterator is invalid, or has reached the end of its elements.
Examples:
server-write-create-unspecified-instance-example.c.
const char* AwaPathIterator_Get ( const AwaPathIterator iterator)

Retrieve the current path from a Path Iterator.

If the iterator has not reached the end, advance its position to the next path.

Parameters
[in]iteratorA pointer to a valid Path Iterator.
Returns
the current path of the Path Iterator if it is valid
NULL if the Path Iterator is invalid.
Examples:
server-write-create-unspecified-instance-example.c.
void AwaPathIterator_Free ( AwaPathIterator **  iterator)

Clean up a Path Iterator, freeing all allocated resources.

Once freed, the iterator is no longer valid.

Parameters
[in,out]iteratorA pointer to a Path Iterator pointer that will be set to NULL.
AwaError AwaAPI_MakeObjectPath ( char *  path,
size_t  pathSize,
AwaObjectID  objectID 
)

Construct a path from an object ID.

Parameters
[in,out]pathCaller-allocated destination path.
[in]pathSizethe allocated size of the path.
[in]objectIDthe numerical object ID.
Returns
AwaError_Success on success.
AwaError_IDInvalid if the ID is invalid.
AwaError_PathInvalid if the path is NULL.
AwaError AwaAPI_MakeObjectInstancePath ( char *  path,
size_t  pathSize,
AwaObjectID  objectID,
AwaObjectInstanceID  objectInstanceID 
)

Construct a path from an object and object instance ID.

Parameters
[in,out]pathCaller-allocated destination path.
[in]pathSizethe allocated size of the path.
[in]objectIDthe numerical object ID.
[in]objectInstanceIDthe numerical object instance ID.
Returns
AwaError_Success on success.
AwaError_IDInvalid if the ID is invalid.
AwaError_PathInvalid if the path is NULL.
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.

Parameters
[in,out]pathCaller-allocated destination path.
[in]pathSizethe allocated size of the path.
[in]objectIDthe numerical object ID.
[in]objectInstanceIDthe numerical object instance ID.
[in]resourceIDthe numerical resource ID.
Returns
AwaError_Success on success.
AwaError_IDInvalid if the ID is invalid.
AwaError_PathInvalid if the path is NULL.
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.

Parameters
[in,out]pathCaller-allocated destination path.
[in]pathSizethe allocated size of the path.
[in]objectIDthe numerical object ID.
[in]objectInstanceIDthe numerical object instance ID.
[in]resourceIDthe numerical resource ID.
Returns
AwaError_Success on success.
AwaError_IDInvalid if the ID is invalid.
AwaError_PathInvalid if the path is NULL.
bool AwaAPI_IsPathValid ( const char *  path)

Check if a path string conforms to the valid path syntax.

Parameters
[in]patha valid object, object instance or resource path.
Returns
true if the path is a valid /O/I/R path.
false if the path is invalid.
AwaError AwaPathResult_GetError ( const AwaPathResult result)

Retrieve an error from a Path Result.

Parameters
[in]resultA pointer to a valid Path Result.
Returns
AwaError_Success if the result contains no error.
AwaError_OperationInvalid if the result is invalid.
Various errors on a valid but unsuccessful Path Result.
AwaLWM2MError AwaPathResult_GetLWM2MError ( const AwaPathResult result)

Retrieve a LWM2M error from a Path Result.

Parameters
[in]resultA pointer to a valid Path Result.
Returns
AwaLWM2MError_Success if the result contains no error.
Various errors on a valid but unsuccessful Path Result.
AwaPathIterator* AwaChangeSet_NewPathIterator ( const AwaChangeSet changeSet)

Create a new Path Iterator for a ChangeSet, used to iterate through the list of resource paths retrieved by the corresponding Change Subscription or Observation.

The resulting iterator is owned by the caller and should eventually be freed with AwaPathIterator_Free. This function can only be successful inside a callback of a successful change notification.

Parameters
[in]changeSetA pointer to the ChangeSet to search.
Returns
A pointer to a new PathIterator instance on success.
NULL on failure.
AwaChangeType AwaChangeSet_GetChangeType ( const AwaChangeSet changeSet,
const char *  path 
)

Retrieve the change type for a specified path in a ChangeSet.

Parameters
[in]changeSetA pointer to a valid ChangeSet.
[in]pathThe path with which to query the Get Response.
Returns
the change type for the specified path on success.
AwaClientChangeType_Invalid on an invalid operation.
bool AwaChangeSet_HasValue ( const AwaChangeSet changeSet,
const char *  path 
)

Test if the ChangeSet has a value for the specified resource path.

If the ChangeSet contains a value for the specified path, and the Resource Type is known, it can be retrieved with the appropriate AwaChangeSet_GetValueAs_ function.

Parameters
[in]changeSetA pointer to a valid ChangeSet
[in]pathThe path with which to query the ChangeSet
Returns
true if the ChangeSet contains a value for the specified resource path.
false if the ChangeSet does not contain a value for the specified resource path, or if the path is invalid.
bool AwaChangeSet_ContainsPath ( const AwaChangeSet changeSet,
const char *  path 
)

Test if the ChangeSet has the specified path (resource, object instance or object) present.

If the ChangeSet contains paths beyond the specified path, the path will be considered present.

Parameters
[in]changeSetA pointer to a valid ChangeSet.
[in]pathThe path with which to query the ChangeSet.
Returns
true if the ChangeSet contains the specified resource path.
false if the ChangeSet does not contain the specified resource path, or if the path is invalid.
AwaResourceType AwaChangeSet_GetResourceType ( const AwaChangeSet changeSet,
const char *  path 
)

Get the resource type for the specified change.

Only valid for resource changes.

Parameters
[in]changeSetA pointer to a valid ChangeSet.
[in]pathThe path with which to query the Get Response.
Returns
Resource type on success.
AwaResourceType_Invalid if change is not a resource change.
AwaError AwaChangeSet_GetValueAsOpaque ( const AwaChangeSet changeSet,
const char *  path,
AwaOpaque value 
)

Retrieve an opaque resource's value from a ChangeSet.

The resource is identified by the path. ChangeSets will contain values for any resources that have been created or modified. A pointer to a AwaOpaque struct is passed in and populated by the function. The data pointer within the AwaOpaque struct is only valid while within its Subscription or Observation callback. Once the callback exits the changeSet is freed, the data pointer is immediately invalid and should not be used or dereferenced.

Parameters
[in]changeSetThe ChangeSet to retrieve the value from.
[in]pathThe path of the opaque resource requested for retrieval.
[in,out]valueA pointer to a AwaOpaque struct that will be modified to refer to the requested opaque value.
Returns
AwaError_Success on success.
AwaError_TypeMismatch if the resource type corresponding to the specified path is not of type AwaResourceType_Opaque.
AwaError_PathNotFound if the specified resource path is not covered by the Get Response.
AwaError_OperationInvalid if the specified operation is invalid or NULL.
AwaError_PathInvalid if the specified path is invalid or does not correspond to a resource path.
AwaError AwaChangeSet_GetValueAsObjectLink ( const AwaChangeSet changeSet,
const char *  path,
AwaObjectLink value 
)

Retrieve an object link resource's value from a ChangeSet.

The resource is identified by the path. ChangeSets will contain values for any resources that have been created or modified. A pointer to a AwaObjectLink struct is passed in and populated by the function.

Parameters
[in]changeSetThe ChangeSet to retrieve the value from.
[in]pathThe path of the object link resource requested for retrieval.
[in,out]valueA pointer to a AwaObjectLink struct that will be modified to hold the requested object link value.
Returns
AwaError_Success on success.
AwaError_TypeMismatch if the resource type corresponding to the specified path is not of type AwaResourceType_ObjectLink.
AwaError_PathNotFound if the specified resource path is not covered by the Get Response.
AwaError_OperationInvalid if the specified operation is invalid or NULL.
AwaError_PathInvalid if the specified path is invalid or does not correspond to a resource path.
AwaLogLevel AwaLog_SetLevel ( AwaLogLevel  level)

Set the current API log level.

Parameters
[in]levelNew log level.
Returns
Previous log level.