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

This interface enables an application to interact with the LWM2M interface provided by LWM2M Server Core. More...

#include "common.h"
Include dependency graph for server.h:

Go to the source code of this file.

Typedefs

typedef void(* AwaServerObservationCallback) (const AwaChangeSet *changeSet, void *context)
 A user-specified callback handler for an Observation which will be fired on AwaServerSession_DispatchCallbacks if the subscribed entity has changed since the observation's session callbacks were last dispatched. More...
 
typedef void(* AwaServerClientRegisterEventCallback) (const AwaServerClientRegisterEvent *event, void *context)
 A user-specified callback handler for Server Notifications which will be fired on client registration. More...
 
typedef void(* AwaServerClientUpdateEventCallback) (const AwaServerClientUpdateEvent *event, void *context)
 A user-specified callback handler for Server Notifications which will be fired on client update. More...
 
typedef void(* AwaServerClientDeregisterEventCallback) (const AwaServerClientDeregisterEvent *event, void *context)
 A user-specified callback handler for Server Notifications which will be fired on client deregister. More...
 

Enumerations

enum  AwaWriteMode {
  AwaWriteMode_Replace,
  AwaWriteMode_Update,
  AwaWriteMode_LAST
}
 Supported write modes. More...
 

Functions

AwaServerSession * AwaServerSession_New (void)
 Initialise a new session of the Awa subsystem. More...
 
AwaError AwaServerSession_SetIPCAsUDP (AwaServerSession *session, const char *address, unsigned short port)
 Configure the IPC mechanism used by the API to communicate with the Core. More...
 
AwaError AwaServerSession_SetDefaultTimeout (AwaServerSession *session, AwaTimeout timeout)
 Set IPC connect timeout. More...
 
AwaError AwaServerSession_Connect (AwaServerSession *session)
 Connect a session (configured with an IPC mechanism) to the Core. More...
 
AwaError AwaServerSession_Refresh (AwaServerSession *session)
 Object and Resource Definitions are assembled by the application and sent to the server daemon for storage (a process called "Define"). More...
 
bool AwaServerSession_IsObjectDefined (const AwaServerSession *session, AwaObjectID objectID)
 Determines whether the specified session holds a valid definition for the given object. More...
 
const AwaObjectDefinitionAwaServerSession_GetObjectDefinition (const AwaServerSession *session, AwaObjectID objectID)
 Retrieves an object definition instance corresponding to the object identified by the given object ID. More...
 
AwaObjectDefinitionIteratorAwaServerSession_NewObjectDefinitionIterator (const AwaServerSession *session)
 Retrieves a new object definition iterator that can be used to iterate through the set of defined objects within the context of the given session. More...
 
AwaError AwaServerSession_Process (AwaServerSession *session, AwaTimeout timeout)
 Process any incoming requests from a LWM2M Client. More...
 
AwaError AwaServerSession_DispatchCallbacks (AwaServerSession *session)
 Invoke any callbacks scheduled since this function was last called. More...
 
AwaError AwaServerSession_Disconnect (AwaServerSession *session)
 When a session is no longer required, or if the application intends to sleep for some time, the session can be disconnected from the Core. More...
 
AwaError AwaServerSession_Free (AwaServerSession **session)
 Shut down an existing session, freeing any allocated memory. More...
 
AwaError AwaServerSession_PathToIDs (const AwaServerSession *session, const char *path, AwaObjectID *objectID, AwaObjectInstanceID *objectInstanceID, AwaResourceID *resourceID)
 Paths are used to identify objects, object instances and resources within the data model. More...
 
AwaServerListClientsOperation * AwaServerListClientsOperation_New (const AwaServerSession *session)
 Allocate and return a pointer to a new List Clients operation, that can be used to retrieve a list of clients and their registered entities currently connected to an LWM2M Server Daemon. More...
 
AwaError AwaServerListClientsOperation_Perform (AwaServerListClientsOperation *operation, AwaTimeout timeout)
 Process the List Clients operation by sending it to the Core. More...
 
const AwaServerListClientsResponse * AwaServerListClientsOperation_GetResponse (const AwaServerListClientsOperation *operation, const char *clientID)
 Obtain a List Clients Response instance from a processed List Clients operation. More...
 
AwaRegisteredEntityIterator * AwaServerListClientsResponse_NewRegisteredEntityIterator (const AwaServerListClientsResponse *response)
 Create a new Registered Entity iterator for a List Clients Response, used to iterate through the list of objects and object instances that exist within the client the response relates to. More...
 
AwaError AwaServerListClientsOperation_Free (AwaServerListClientsOperation **operation)
 Clean up a List Clients operation, freeing all allocated resources. More...
 
bool AwaClientIterator_Next (AwaClientIterator *iterator)
 Determine whether the Client Iterator has not reached the end of a set of clients. More...
 
const char * AwaClientIterator_GetClientID (const AwaClientIterator *iterator)
 Retrieve the ID from the current client in the Client Iterator. More...
 
void AwaClientIterator_Free (AwaClientIterator **iterator)
 Clean up a Client Iterator, freeing all allocated resources. More...
 
AwaClientIterator * AwaServerListClientsOperation_NewClientIterator (const AwaServerListClientsOperation *operation)
 Create a new Client Iterator for a List Clients Response, used to iterate through the list of client endpoint names retrieved by the corresponding List Clients operation. More...
 
bool AwaRegisteredEntityIterator_Next (AwaRegisteredEntityIterator *iterator)
 Determine whether the Registered Entity Iterator has not reached the end of a list of registered entities. More...
 
const char * AwaRegisteredEntityIterator_GetPath (const AwaRegisteredEntityIterator *iterator)
 Retrieve the path to the current registered entity in the Registered Entity Iterator. More...
 
void AwaRegisteredEntityIterator_Free (AwaRegisteredEntityIterator **iterator)
 Clean up a Registered Entity Iterator, freeing all allocated resources. More...
 
AwaServerDefineOperation * AwaServerDefineOperation_New (const AwaServerSession *session)
 Allocate and return a pointer to a new Define operation, that can be used to define Objects and Resources. More...
 
AwaError AwaServerDefineOperation_Add (AwaServerDefineOperation *operation, const AwaObjectDefinition *objectDefinition)
 Add an Object Definition to an existing Define operation, so that the client will create a suitable definition for this new object type. More...
 
AwaError AwaServerDefineOperation_Perform (AwaServerDefineOperation *operation, AwaTimeout timeout)
 
AwaError AwaServerDefineOperation_Free (AwaServerDefineOperation **operation)
 Clean up a Define operation, freeing all allocated resources. More...
 
const AwaServerDefineResponse * AwaServerDefineOperation_GetResponse (const AwaServerDefineOperation *operation)
 Obtain a Server Define Response instance from a processed Server Define operation. More...
 
AwaPathIteratorAwaServerDefineResponse_NewPathIterator (const AwaServerDefineResponse *response)
 Create a new Path Iterator for a Define Response, used to iterate through the list of paths returned in the response of the corresponding Define operation. More...
 
const AwaPathResultAwaServerDefineResponse_GetPathResult (const AwaServerDefineResponse *response, const char *path)
 Retrieve a path result from a Define Response relating to a definition on that path retrieved by the corresponding Define operation. More...
 
bool AwaServerDefineResponse_ContainsPath (const AwaServerDefineResponse *response, const char *path)
 Test if the Define Response has the specified path to a resource or object present. More...
 
AwaServerReadOperation * AwaServerReadOperation_New (const AwaServerSession *session)
 Allocate and return a pointer to a new Read operation, that can be used to retrieve resource values from the Core. More...
 
AwaError AwaServerReadOperation_AddPath (AwaServerReadOperation *operation, const char *clientID, const char *path)
 Adds a path of interest to a Read operation, as a request to retrieve all resources at or covered by this path from the Core. More...
 
AwaError AwaServerReadOperation_Perform (AwaServerReadOperation *operation, AwaTimeout timeout)
 Process the Read operation by sending it to the Core. More...
 
AwaError AwaServerReadOperation_Free (AwaServerReadOperation **operation)
 Clean up a Read operation, freeing all allocated resources. More...
 
AwaClientIterator * AwaServerReadOperation_NewClientIterator (const AwaServerReadOperation *operation)
 Create a new Client Iterator for a performed Read Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Read operation. More...
 
const AwaServerReadResponse * AwaServerReadOperation_GetResponse (const AwaServerReadOperation *operation, const char *clientID)
 Obtain a Read Response instance from a processed Read operation. More...
 
AwaPathIteratorAwaServerReadResponse_NewPathIterator (const AwaServerReadResponse *response)
 Create a new Path Iterator for a Read Response, used to iterate through the list of resource paths retrieved by the corresponding Read operation. More...
 
const AwaPathResultAwaServerReadResponse_GetPathResult (const AwaServerReadResponse *response, const char *path)
 Retrieve a path result from a Read Response relating to a subscription to that path retrieved by the corresponding Read operation. More...
 
bool AwaServerReadResponse_ContainsPath (const AwaServerReadResponse *response, const char *path)
 Test if the Read Response has the specified path (resource, object instance or object) present. More...
 
bool AwaServerReadResponse_HasValue (const AwaServerReadResponse *response, const char *path)
 Test if the Read Response has a value for the specified resource path. More...
 
AwaError AwaServerReadResponse_GetValueAsCStringPointer (const AwaServerReadResponse *response, const char *path, const char **value)
 
AwaError AwaServerReadResponse_GetValueAsIntegerPointer (const AwaServerReadResponse *response, const char *path, const AwaInteger **value)
 
AwaError AwaServerReadResponse_GetValueAsFloatPointer (const AwaServerReadResponse *response, const char *path, const AwaFloat **value)
 
AwaError AwaServerReadResponse_GetValueAsBooleanPointer (const AwaServerReadResponse *response, const char *path, const AwaBoolean **value)
 
AwaError AwaServerReadResponse_GetValueAsTimePointer (const AwaServerReadResponse *response, const char *path, const AwaTime **value)
 
AwaError AwaServerReadResponse_GetValueAsObjectLinkPointer (const AwaServerReadResponse *response, const char *path, const AwaObjectLink **value)
 
AwaError AwaServerReadResponse_GetValueAsOpaquePointer (const AwaServerReadResponse *response, const char *path, const AwaOpaque **value)
 
AwaError AwaServerReadResponse_GetValueAsOpaque (const AwaServerReadResponse *response, const char *path, AwaOpaque *value)
 Retrieve an opaque resource's value from a Read Response. More...
 
AwaError AwaServerReadResponse_GetValueAsObjectLink (const AwaServerReadResponse *response, const char *path, AwaObjectLink *value)
 Retrieve an object link resource's value from a Read Response. More...
 
AwaError AwaServerReadResponse_GetValuesAsStringArrayPointer (const AwaServerReadResponse *response, const char *path, const AwaStringArray **valueArray)
 
AwaError AwaServerReadResponse_GetValuesAsIntegerArrayPointer (const AwaServerReadResponse *response, const char *path, const AwaIntegerArray **valueArray)
 
AwaError AwaServerReadResponse_GetValuesAsFloatArrayPointer (const AwaServerReadResponse *response, const char *path, const AwaFloatArray **valueArray)
 
AwaError AwaServerReadResponse_GetValuesAsBooleanArrayPointer (const AwaServerReadResponse *response, const char *path, const AwaBooleanArray **valueArray)
 
AwaError AwaServerReadResponse_GetValuesAsTimeArrayPointer (const AwaServerReadResponse *response, const char *path, const AwaTimeArray **valueArray)
 
AwaError AwaServerReadResponse_GetValuesAsOpaqueArrayPointer (const AwaServerReadResponse *response, const char *path, const AwaOpaqueArray **valueArray)
 
AwaError AwaServerReadResponse_GetValuesAsObjectLinkArrayPointer (const AwaServerReadResponse *response, const char *path, const AwaObjectLinkArray **valueArray)
 
const char * AwaWriteMode_ToString (AwaWriteMode writeMode)
 Get a descriptive name for the specified Write Mode. More...
 
AwaWriteMode AwaWriteMode_FromString (const char *writeModeString)
 Get a Write Mode from a descriptive name of a Write Mode. More...
 
AwaServerWriteOperation * AwaServerWriteOperation_New (const AwaServerSession *session, AwaWriteMode defaultMode)
 Allocate and return a pointer to a new Write Operation, that can be used to set resource values. More...
 
AwaError AwaServerWriteOperation_CreateObjectInstance (AwaServerWriteOperation *operation, const char *path)
 Adds an object instance path to a Write Operation, as a request to create an Object Instance. More...
 
AwaError AwaServerWriteOperation_SetObjectInstanceWriteMode (AwaServerWriteOperation *operation, const char *path, AwaWriteMode mode)
 Changes the write mode for an object instance path. More...
 
AwaError AwaServerWriteOperation_SetResourceWriteMode (AwaServerWriteOperation *operation, const char *path, AwaWriteMode mode)
 Changes the write mode for a resource path. More...
 
AwaError AwaServerWriteOperation_AddValueAsCString (AwaServerWriteOperation *operation, const char *path, const char *value)
 
AwaError AwaServerWriteOperation_AddValueAsInteger (AwaServerWriteOperation *operation, const char *path, AwaInteger value)
 
AwaError AwaServerWriteOperation_AddValueAsFloat (AwaServerWriteOperation *operation, const char *path, AwaFloat value)
 
AwaError AwaServerWriteOperation_AddValueAsBoolean (AwaServerWriteOperation *operation, const char *path, AwaBoolean value)
 
AwaError AwaServerWriteOperation_AddValueAsTime (AwaServerWriteOperation *operation, const char *path, AwaTime value)
 
AwaError AwaServerWriteOperation_AddValueAsOpaque (AwaServerWriteOperation *operation, const char *path, AwaOpaque value)
 
AwaError AwaServerWriteOperation_AddValueAsObjectLink (AwaServerWriteOperation *operation, const char *path, AwaObjectLink value)
 
AwaError AwaServerWriteOperation_AddValueAsStringArray (AwaServerWriteOperation *operation, const char *path, const AwaStringArray *array)
 
AwaError AwaServerWriteOperation_AddValueAsIntegerArray (AwaServerWriteOperation *operation, const char *path, const AwaIntegerArray *array)
 
AwaError AwaServerWriteOperation_AddValueAsFloatArray (AwaServerWriteOperation *operation, const char *path, const AwaFloatArray *array)
 
AwaError AwaServerWriteOperation_AddValueAsBooleanArray (AwaServerWriteOperation *operation, const char *path, const AwaBooleanArray *array)
 
AwaError AwaServerWriteOperation_AddValueAsTimeArray (AwaServerWriteOperation *operation, const char *path, const AwaTimeArray *array)
 
AwaError AwaServerWriteOperation_AddValueAsOpaqueArray (AwaServerWriteOperation *operation, const char *path, const AwaOpaqueArray *array)
 
AwaError AwaServerWriteOperation_AddValueAsObjectLinkArray (AwaServerWriteOperation *operation, const char *path, const AwaObjectLinkArray *array)
 
AwaError AwaServerWriteOperation_AddArrayValueAsCString (AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, const char *value)
 
AwaError AwaServerWriteOperation_AddArrayValueAsInteger (AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaInteger value)
 
AwaError AwaServerWriteOperation_AddArrayValueAsFloat (AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaFloat value)
 
AwaError AwaServerWriteOperation_AddArrayValueAsBoolean (AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaBoolean value)
 
AwaError AwaServerWriteOperation_AddArrayValueAsTime (AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaTime value)
 
AwaError AwaServerWriteOperation_AddArrayValueAsOpaque (AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaOpaque value)
 
AwaError AwaServerWriteOperation_AddArrayValueAsObjectLink (AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaObjectLink value)
 
AwaError AwaServerWriteOperation_Perform (AwaServerWriteOperation *operation, const char *clientID, AwaTimeout timeout)
 Process the Write Operation by sending it to the Core. More...
 
const AwaServerWriteResponse * AwaServerWriteOperation_GetResponse (const AwaServerWriteOperation *operation, const char *clientID)
 Obtain a Write Response instance from a processed Write Operation. More...
 
AwaError AwaServerWriteOperation_Free (AwaServerWriteOperation **operation)
 Clean up a Write Operation, freeing all allocated resources. More...
 
AwaClientIterator * AwaServerWriteOperation_NewClientIterator (const AwaServerWriteOperation *operation)
 Create a new Client Iterator for a Write Response, used to iterate through the list of client endpoint names retrieved by the corresponding Write Operation. More...
 
AwaPathIteratorAwaServerWriteResponse_NewPathIterator (const AwaServerWriteResponse *response)
 Create a new Path Iterator for a Write Response, used to iterate through the list of paths returned in the response of the corresponding Write Operation. More...
 
const AwaPathResultAwaServerWriteResponse_GetPathResult (const AwaServerWriteResponse *response, const char *path)
 Retrieve a path result from a Write Response relating to a write to that path retrieved by the corresponding Write Operation. More...
 
bool AwaServerWriteResponse_ContainsPath (const AwaServerWriteResponse *response, const char *path)
 Test if the Write Response has the specified path to a resource or object present. More...
 
AwaServerDeleteOperation * AwaServerDeleteOperation_New (const AwaServerSession *session)
 Allocate and return a pointer to a new Delete operation, that can be used to delete optional resources, resource instances, and object instances. More...
 
AwaError AwaServerDeleteOperation_AddPath (AwaServerDeleteOperation *operation, const char *clientID, const char *path)
 Adds a path to a Delete operation, as a request to delete the specified object or object instance. More...
 
AwaError AwaServerDeleteOperation_Perform (AwaServerDeleteOperation *operation, AwaTimeout timeout)
 Process the Delete operation by sending it to the Core. More...
 
const AwaServerDeleteResponse * AwaServerDeleteOperation_GetResponse (const AwaServerDeleteOperation *operation, const char *clientID)
 Obtain a Delete Response instance from a processed Delete operation. More...
 
AwaError AwaServerDeleteOperation_Free (AwaServerDeleteOperation **operation)
 Clean up a Delete operation, freeing all allocated resources. More...
 
AwaClientIterator * AwaServerDeleteOperation_NewClientIterator (const AwaServerDeleteOperation *operation)
 Create a new Client Iterator for a performed Delete Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Delete operation. More...
 
AwaPathIteratorAwaServerDeleteResponse_NewPathIterator (const AwaServerDeleteResponse *response)
 Create a new Path Iterator for a Delete Response, used to iterate through the list of resource paths retrieved by the corresponding Delete operation. More...
 
const AwaPathResultAwaServerDeleteResponse_GetPathResult (const AwaServerDeleteResponse *response, const char *path)
 Retrieve a path result from a Delete Response relating to a subscription to that path retrieved by the corresponding Delete operation. More...
 
bool AwaServerDeleteResponse_ContainsPath (const AwaServerDeleteResponse *response, const char *path)
 Test if the Delete Response has the specified path (object instance or object) present. More...
 
AwaServerExecuteOperation * AwaServerExecuteOperation_New (const AwaServerSession *session)
 Allocate and return a pointer to a new Execute operation, that can be used to trigger executable resources. More...
 
AwaError AwaServerExecuteOperation_AddPath (AwaServerExecuteOperation *operation, const char *clientID, const char *path, const AwaExecuteArguments *arguments)
 Adds a path to an Execute operation, as a request to execute the specified resource. More...
 
AwaError AwaServerExecuteOperation_Perform (AwaServerExecuteOperation *operation, AwaTimeout timeout)
 Process the Execute operation by sending it to the Core. More...
 
const AwaServerExecuteResponse * AwaServerExecuteOperation_GetResponse (const AwaServerExecuteOperation *operation, const char *clientID)
 Obtain an Execute Response instance from a processed Execute operation. More...
 
AwaError AwaServerExecuteOperation_Free (AwaServerExecuteOperation **operation)
 Clean up an Execute operation, freeing all allocated resources. More...
 
AwaClientIterator * AwaServerExecuteOperation_NewClientIterator (const AwaServerExecuteOperation *operation)
 Create a new Client Iterator for a performed Execute Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Execute operation. More...
 
AwaPathIteratorAwaServerExecuteResponse_NewPathIterator (const AwaServerExecuteResponse *response)
 Create a new Path Iterator for an Execute Response, used to iterate through the list of resource paths retrieved by the corresponding Execute operation. More...
 
const AwaPathResultAwaServerExecuteResponse_GetPathResult (const AwaServerExecuteResponse *response, const char *path)
 Retrieve a path result from an Execute Response relating to an execution to that path retrieved by the corresponding Execute operation. More...
 
bool AwaServerExecuteResponse_ContainsPath (const AwaServerExecuteResponse *response, const char *path)
 Test if the Execute Response has the specified resource path present. More...
 
AwaServerWriteAttributesOperation * AwaServerWriteAttributesOperation_New (const AwaServerSession *session)
 Allocate and return a pointer to a new Write Attributes operation, that can be used to modify when notifications for changes to objects, object instances and resources will be sent from a connected client to the observing server daemon. More...
 
AwaError AwaServerWriteAttributesOperation_AddAttributeAsInteger (AwaServerWriteAttributesOperation *operation, const char *clientID, const char *path, const char *link, AwaInteger value)
 
AwaError AwaServerWriteAttributesOperation_AddAttributeAsFloat (AwaServerWriteAttributesOperation *operation, const char *clientID, const char *path, const char *link, AwaFloat value)
 
AwaError AwaServerWriteAttributesOperation_Perform (AwaServerWriteAttributesOperation *operation, AwaTimeout timeout)
 Process the Write Attributes operation by sending it to the Core. More...
 
const AwaServerWriteAttributesResponse * AwaServerWriteAttributesOperation_GetResponse (const AwaServerWriteAttributesOperation *operation, const char *clientID)
 Obtain a Write Attributes Response instance from a processed Write Attributes operation. More...
 
AwaError AwaServerWriteAttributesOperation_Free (AwaServerWriteAttributesOperation **operation)
 Clean up a Write Attributes operation, freeing all allocated resources. More...
 
AwaClientIterator * AwaServerWriteAttributesOperation_NewClientIterator (const AwaServerWriteAttributesOperation *operation)
 Create a new Client Iterator for a performed Write Attributes Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Write Attributes operation. More...
 
AwaPathIteratorAwaServerWriteAttributesResponse_NewPathIterator (const AwaServerWriteAttributesResponse *response)
 Create a new Path Iterator for a Write Attributes Response, used to iterate through the list of paths retrieved by the corresponding Write Attributes operation. More...
 
const AwaPathResultAwaServerWriteAttributesResponse_GetPathResult (const AwaServerWriteAttributesResponse *response, const char *path)
 Retrieve a path result from a Write Attributes Response relating to a subscription to that path retrieved by the corresponding Write Attributes operation. More...
 
bool AwaServerWriteAttributesResponse_ContainsPath (const AwaServerWriteAttributesResponse *response, const char *path)
 Test if the Write Attributes Response has the specified path (resource, object instance or object) present. More...
 
AwaServerDiscoverOperation * AwaServerDiscoverOperation_New (const AwaServerSession *session)
 Allocate and return a pointer to a new Discover operation, that can be used to discover attributes attached to objects, object instances and resources. More...
 
AwaError AwaServerDiscoverOperation_AddPath (AwaServerDiscoverOperation *operation, const char *clientID, const char *path)
 Adds a path to a Discover operation, as a request to discover the specified resource. More...
 
AwaError AwaServerDiscoverOperation_Perform (AwaServerDiscoverOperation *operation, AwaTimeout timeout)
 Process the Discover operation by sending it to the Core. More...
 
const AwaServerDiscoverResponse * AwaServerDiscoverOperation_GetResponse (const AwaServerDiscoverOperation *operation, const char *clientID)
 Obtain a Discover Response instance from a processed Discover operation. More...
 
AwaError AwaServerDiscoverOperation_Free (AwaServerDiscoverOperation **operation)
 Clean up a Discover operation, freeing all allocated resources. More...
 
AwaClientIterator * AwaServerDiscoverOperation_NewClientIterator (const AwaServerDiscoverOperation *operation)
 Create a new Client Iterator for a performed Discover Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Discover operation. More...
 
AwaPathIteratorAwaServerDiscoverResponse_NewPathIterator (const AwaServerDiscoverResponse *response)
 Create a new Path Iterator for a Discover Response, used to iterate through the list of paths retrieved by the corresponding Discover operation. More...
 
const AwaPathResultAwaServerDiscoverResponse_GetPathResult (const AwaServerDiscoverResponse *response, const char *path)
 Retrieve a path result from a Discover Response relating to a subscription to that path retrieved by the corresponding Discover operation. More...
 
bool AwaServerDiscoverResponse_ContainsPath (const AwaServerDiscoverResponse *response, const char *path)
 Test if the Discover Response has the specified path (resource, object instance or object) present. More...
 
AwaError AwaServerDiscoverResponse_GetAttributeValueAsIntegerPointer (const AwaServerDiscoverResponse *response, const char *path, const char *link, const AwaInteger **value)
 
AwaError AwaServerDiscoverResponse_GetAttributeValueAsFloatPointer (const AwaServerDiscoverResponse *response, const char *path, const char *link, const AwaFloat **value)
 
AwaAttributeIterator * AwaServerDiscoverResponse_NewAttributeIterator (const AwaServerDiscoverResponse *response, const char *path)
 Create a new Attribute Iterator for a Discover Response, used to iterate through the list of attributes retrieved by the corresponding Discover operation. More...
 
bool AwaAttributeIterator_Next (AwaAttributeIterator *iterator)
 Determine whether the Attribute Iterator has not reached the end of a list of attributes. More...
 
const char * AwaAttributeIterator_GetLink (const AwaAttributeIterator *iterator)
 Retrieve the link name associated with the current attribute in the Attribute Iterator. More...
 
void AwaAttributeIterator_Free (AwaAttributeIterator **iterator)
 Clean up a Attribute Iterator, freeing all allocated resources. More...
 
AwaServerObserveOperation * AwaServerObserveOperation_New (const AwaServerSession *session)
 Allocate and return a pointer to a new Observe operation, that can be used to observe to and be notified of changes to objects, object instances and resource values from the Core. More...
 
AwaError AwaServerObserveOperation_AddObservation (AwaServerObserveOperation *operation, AwaServerObservation *observation)
 Adds an Observation of interest to an Observe operation, as a request to be notified of changes to the observed entity from the Core. More...
 
AwaError AwaServerObserveOperation_AddCancelObservation (AwaServerObserveOperation *operation, AwaServerObservation *observation)
 Adds a Cancel flag to an Observation in a specified Observe operation, as a request to cancel being notified of changes to the observed entity from the Core. More...
 
AwaError AwaServerObserveOperation_Perform (AwaServerObserveOperation *operation, AwaTimeout timeout)
 Process the Observe operation by sending it to the Core, notifying the Core to begin or cancel observation to changes of the observed entities inside the specified Observe operation. More...
 
const AwaServerObserveResponse * AwaServerObserveOperation_GetResponse (const AwaServerObserveOperation *operation, const char *clientID)
 Obtain an Observe Response instance from a processed Observe operation. More...
 
AwaError AwaServerObserveOperation_Free (AwaServerObserveOperation **operation)
 Clean up an Observe operation, freeing all allocated resources. More...
 
AwaServerObservation * AwaServerObservation_New (const char *clientID, const char *path, AwaServerObservationCallback callback, void *context)
 Allocate and return a pointer to a new Observation, that can be used to observe to changes on either a resource, object instance or object. More...
 
const char * AwaServerObservation_GetPath (AwaServerObservation *observation)
 Retrieve the path from an Observation. More...
 
AwaError AwaServerObservation_Free (AwaServerObservation **observation)
 Shut down an Observation, freeing any allocated memory. More...
 
AwaClientIterator * AwaServerObserveOperation_NewClientIterator (const AwaServerObserveOperation *operation)
 Create a new Client Iterator for a performed Observe Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Observe operation. More...
 
AwaPathIteratorAwaServerObserveResponse_NewPathIterator (const AwaServerObserveResponse *response)
 Create a new Path Iterator for an Observe Response, used to iterate through the list of object, object instance and resource paths retrieved by the corresponding Observe operation. More...
 
const AwaPathResultAwaServerObserveResponse_GetPathResult (const AwaServerObserveResponse *response, const char *path)
 Retrieve a path result from an Observe Response relating to a observation to that path retrieved by the corresponding Observe operation. More...
 
bool AwaServerObserveResponse_ContainsPath (const AwaServerObserveResponse *response, const char *path)
 Test if the Observe Response has the specified object, object instance or resource path present. More...
 
const AwaServerSession * AwaChangeSet_GetServerSession (const AwaChangeSet *changeSet)
 Retrieve the corresponding session for a ChangeSet. More...
 
const char * AwaChangeSet_GetClientID (const AwaChangeSet *changeSet)
 Retrieve the corresponding client ID for a ChangeSet. More...
 
AwaError AwaServerSession_SetClientRegisterEventCallback (AwaServerSession *session, AwaServerClientRegisterEventCallback callback, void *context)
 Sets a callback function to be called whenever a Client registers with the server. More...
 
AwaError AwaServerSession_SetClientUpdateEventCallback (AwaServerSession *session, AwaServerClientUpdateEventCallback callback, void *context)
 Sets a callback function to be called whenever a Client updates its registration with the server. More...
 
AwaError AwaServerSession_SetClientDeregisterEventCallback (AwaServerSession *session, AwaServerClientDeregisterEventCallback callback, void *context)
 Sets a callback function to be called whenever a Client deregisters with the server. More...
 
AwaClientIterator * AwaServerClientRegisterEvent_NewClientIterator (const AwaServerClientRegisterEvent *event)
 Create a new Client Iterator from a Client Register Event, used to iterate through the list of client endpoint names (IDs) held by the event. More...
 
AwaClientIterator * AwaServerClientUpdateEvent_NewClientIterator (const AwaServerClientUpdateEvent *event)
 Create a new Client Iterator from a Client Update Event, used to iterate through the list of client endpoint names (IDs) held by the event. More...
 
AwaClientIterator * AwaServerClientDeregisterEvent_NewClientIterator (const AwaServerClientDeregisterEvent *event)
 Create a new Client Iterator from a Client Deregister Event, used to iterate through the list of client endpoint names (IDs) held by the event. More...
 
AwaRegisteredEntityIterator * AwaServerClientRegisterEvent_NewRegisteredEntityIterator (const AwaServerClientRegisterEvent *event, const char *clientID)
 Create a new Registered Entity iterator for a Client Register Event, used to iterate through the list of objects and object instances that exist within the client the event relates to. More...
 
AwaRegisteredEntityIterator * AwaServerClientUpdateEvent_NewRegisteredEntityIterator (const AwaServerClientUpdateEvent *event, const char *clientID)
 Create a new Registered Entity iterator for a Client Update Event, used to iterate through the list of objects and object instances that exist within the client the event relates to. More...
 

Detailed Description

This interface enables an application to interact with the LWM2M interface provided by LWM2M Server Core.

The Core may be running as a separate process (daemon), or it may be linked with the application directly.

The Core provides LWM2M operations targeted at registered LWM2M clients. LWM2M operations provide access to client resources within a data model based on Objects, Object Instances and Resources. Please consult the LWM2M specification for details of this model.

A Management Application may interact with clients via the Awa Server API, accessing the client's resources. Therefore it is essential that both the Client Application and Management Application are aware of the same data model.

It is recommended that registered IDs are used for objects that conform to registered LWM2M objects such as IPSO objects.

Typedef Documentation

typedef void(* AwaServerObservationCallback) (const AwaChangeSet *changeSet, void *context)

A user-specified callback handler for an Observation which will be fired on AwaServerSession_DispatchCallbacks if the subscribed entity has changed since the observation's session callbacks were last dispatched.

Warning: Do NOT process any operations while inside an observe callback!

Parameters
[in]changeSetA pointer to a valid ChangeSet.
[in]contextA pointer to user-specified data passed to AwaServerObservation_New
typedef void(* AwaServerClientRegisterEventCallback) (const AwaServerClientRegisterEvent *event, void *context)

A user-specified callback handler for Server Notifications which will be fired on client registration.

Warning: Do NOT process any operations while inside this callback!

Parameters
[in]contextA pointer to user-specified data passed to AwaServerSession_SetClientRegisterEventCallback.
typedef void(* AwaServerClientUpdateEventCallback) (const AwaServerClientUpdateEvent *event, void *context)

A user-specified callback handler for Server Notifications which will be fired on client update.

Warning: Do NOT process any operations while inside this callback!

Parameters
[in]contextA pointer to user-specified data passed to AwaServerSession_SetClientUpdateEventCallback.
typedef void(* AwaServerClientDeregisterEventCallback) (const AwaServerClientDeregisterEvent *event, void *context)

A user-specified callback handler for Server Notifications which will be fired on client deregister.

Warning: Do NOT process any operations while inside this callback!

Parameters
[in]contextA pointer to user-specified data passed to AwaServerSession_SetClientDeregisterEventCallback.

Enumeration Type Documentation

Supported write modes.

Enumerator
AwaWriteMode_Replace 

indicates a write using CoAP "PUT"

AwaWriteMode_Update 

indicates a write using CoAP "POST"

AwaWriteMode_LAST 

Reserved value.

Function Documentation

AwaServerSession* AwaServerSession_New ( void  )

Initialise a new session of the Awa subsystem.

A Session is required for interaction with the Awa Core. Operations to interact with Core resources are created in the context of a session, however the session must be connected before an operation can be processed. The session is owned by the caller and should eventually be freed with AwaClientSession_Free.

Returns
Pointer to new client session.
NULL on error.
Examples:
client-subscribe-to-execute-example.c, server-defineset-example.c, server-delete-object-instance-example.c, server-event-example.c, server-execute-arguments-example.c, server-execute-example.c, server-list-clients-example.c, server-observe-example.c, server-read-example.c, server-write-create-example.c, server-write-create-unspecified-instance-example.c, and server-write-example.c.
AwaError AwaServerSession_SetIPCAsUDP ( AwaServerSession *  session,
const char *  address,
unsigned short  port 
)

Configure the IPC mechanism used by the API to communicate with the Core.

This function configures the mechanism to use UDP with the Core located at the specified address and port.

Parameters
[in]sessionPointer to the session that is to be configured.
[in]addressSpecifies the IP address or hostname to use to connect with the Core.
[in]portSpecifies the Port number to use to connect with the Core.
Returns
AwaError_Success on success.
AwaError_IPCError if an IPC error occurs.
AwaError_SessionInvalid if the specified session is invalid.
Examples:
client-subscribe-to-execute-example.c.
AwaError AwaServerSession_SetDefaultTimeout ( AwaServerSession *  session,
AwaTimeout  timeout 
)

Set IPC connect timeout.

Used internally by AwaServerSession_Connect and AwaServerSession_Disconnect.

Parameters
[in]sessionPointer to a valid server session.
[in]timeoutThe time within which an IPC session Connect must complete to avoid timeout. It must be greater than 0.
Returns
AwaError_Success on success.
Various errors on failure.
AwaError AwaServerSession_Connect ( AwaServerSession *  session)

Connect a session (configured with an IPC mechanism) to the Core.

A session must be connected before operations can be processed.

Parameters
[in]sessionPointer to an IPC-configured session.
Returns
AwaError_Success on success.
Various errors on failure.
Examples:
client-subscribe-to-execute-example.c, server-defineset-example.c, server-delete-object-instance-example.c, server-event-example.c, server-execute-arguments-example.c, server-execute-example.c, server-list-clients-example.c, server-observe-example.c, server-read-example.c, server-write-create-example.c, server-write-create-unspecified-instance-example.c, and server-write-example.c.
AwaError AwaServerSession_Refresh ( AwaServerSession *  session)

Object and Resource Definitions are assembled by the application and sent to the server daemon for storage (a process called "Define").

After successful definition, the application can shut down and the daemon will retain the definitions. Later, an application may wish to interact with these objects and resources. In order to do this in a type-safe manner, the Session must be aware of the definitions. Definitions will be held by the Session if DefineObject/DefineResource functions were used to successfully define objects and resources. If not, then the definitions must be retrieved with AwaServerSession_Refresh.

Parameters
[in]sessionA pointer to a valid session instance.
Returns
AwaError_Success on success.
AwaError_SessionInvalid if the specified session is invalid.
bool AwaServerSession_IsObjectDefined ( const AwaServerSession *  session,
AwaObjectID  objectID 
)

Determines whether the specified session holds a valid definition for the given object.

A session will hold a valid definition if the Core has a valid definition at the time the session was connected, or if a successful Define operation has been performed for this object.

Parameters
[in]sessionPointer to a connected session.
[in]objectIDIdentifies the object for which the query is targeted.
Returns
True if object is defined.
False if object is not defined, or if the session is invalid.
const AwaObjectDefinition* AwaServerSession_GetObjectDefinition ( const AwaServerSession *  session,
AwaObjectID  objectID 
)

Retrieves an object definition instance corresponding to the object identified by the given object ID.

The object definition is owned by the session and should not be freed by the caller.

Parameters
[in]sessionPointer to a connected session.
[in]objectIDIdentifies the object for which the query is targeted.
Returns
A const pointer to an object definition instance, if it exists.
NULL if a definition for the object specified does not exist.
AwaObjectDefinitionIterator* AwaServerSession_NewObjectDefinitionIterator ( const AwaServerSession *  session)

Retrieves a new object definition iterator that can be used to iterate through the set of defined objects within the context of the given session.

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

Parameters
[in]sessionPointer to a connected session.
Returns
A pointer to an object definition iterator, if the session is valid.
NULL if the session is not valid.
AwaError AwaServerSession_Process ( AwaServerSession *  session,
AwaTimeout  timeout 
)

Process any incoming requests from a LWM2M Client.

Callbacks are scheduled on the session but are not invoked.

Parameters
[in]sessionPointer to a connected session.
[in]timeoutThe function will wait at least as long as this value for a response.
Returns
AwaError_Success on success.
AwaError_Timeout if no response is received after the timeout duration expires.
Various errors on failure.
Examples:
server-event-example.c, and server-observe-example.c.
AwaError AwaServerSession_DispatchCallbacks ( AwaServerSession *  session)

Invoke any callbacks scheduled since this function was last called.

Parameters
[in]sessionPointer to a connected session.
Returns
AwaError_Success on success.
Various errors on failure.
Examples:
server-event-example.c, and server-observe-example.c.
AwaError AwaServerSession_Disconnect ( AwaServerSession *  session)

When a session is no longer required, or if the application intends to sleep for some time, the session can be disconnected from the Core.

This maintains object and resource definition information, but prevents the processing of operations, or the reception of subscription notifications. The session can be reconnected to the Core with AwaServerSession_Connect. If a connected session is freed, it is automatically disconnected.

Parameters
[in]sessionPointer to a connected session.
Returns
AwaError_Success on success.
AwaError_IPCError if the session is not configured.
AwaError_SessionNotConnected if the session is not connected.
AwaError_SessionInvalid if the session is invalid.
Examples:
client-subscribe-to-execute-example.c, server-defineset-example.c, server-delete-object-instance-example.c, server-event-example.c, server-execute-arguments-example.c, server-execute-example.c, server-list-clients-example.c, server-observe-example.c, server-read-example.c, server-write-create-example.c, server-write-create-unspecified-instance-example.c, and server-write-example.c.
AwaError AwaServerSession_Free ( AwaServerSession **  session)

Shut down an existing session, freeing any allocated memory.

This function should eventually be called on every session to avoid a memory leak. If the session is connected, it will automatically be disconnected first.

Parameters
[in,out]sessionA pointer to a session pointer that will be set to NULL.
Returns
AwaError_Success on success.
AwaError_SessionInvalid if the session is not valid.
Examples:
client-subscribe-to-execute-example.c, server-defineset-example.c, server-delete-object-instance-example.c, server-event-example.c, server-execute-arguments-example.c, server-execute-example.c, server-list-clients-example.c, server-observe-example.c, server-read-example.c, server-write-create-example.c, server-write-create-unspecified-instance-example.c, and server-write-example.c.
AwaError AwaServerSession_PathToIDs ( const AwaServerSession *  session,
const char *  path,
AwaObjectID objectID,
AwaObjectInstanceID objectInstanceID,
AwaResourceID resourceID 
)

Paths are used to identify objects, object instances and resources within the data model.

This function converts a path to equivalent object, object instance and resource IDs.

Parameters
[in]sessionPointer to a valid session.
[in]pathResource path to convert.
[out]objectIDPointer to Object ID for result, or NULL to ignore.
[out]objectInstanceIDPointer to Object Instance ID for result, or NULL to ignore.
[out]resourceIDPointer to Resource ID for result, or NULL to ignore.
Returns
AwaError_Success on success
AwaError_PathInvalid if path is not in the correct form.
AwaError_PathNotFound if path is correctly formed but does not correspond with a defined entity.
AwaServerListClientsOperation* AwaServerListClientsOperation_New ( const AwaServerSession *  session)

Allocate and return a pointer to a new List Clients operation, that can be used to retrieve a list of clients and their registered entities currently connected to an LWM2M Server Daemon.

When processed, the response is made available via AwaServerListClientsOperation_GetResponse which may be iterated through to retrieve the endpoint name of each client and their registered objects and object instances. The List Clients operation is owned by the caller and should eventually be freed with AwaServerListClientsOperation_Free.

Parameters
[in]sessionA pointer to a valid session.
Returns
Pointer to a newly allocated List Clients operation instance.
NULL on failure.
Examples:
server-list-clients-example.c.
AwaError AwaServerListClientsOperation_Perform ( AwaServerListClientsOperation *  operation,
AwaTimeout  timeout 
)

Process the List Clients operation by sending it to the Core.

If successful, the response can be obtained with AwaServerListClientsOperation_GetResponse and iterated through to retrieve the registered entities for each connected client.

Parameters
[in]operationThe List Clients operation to process.
[in]timeoutThe function will wait at least as long as this value for a response.
Returns
AwaError_Success on success.
AwaError_Timeout if no response is received after the timeout duration expires.
Various errors on failure.
Examples:
server-list-clients-example.c.
const AwaServerListClientsResponse* AwaServerListClientsOperation_GetResponse ( const AwaServerListClientsOperation *  operation,
const char *  clientID 
)

Obtain a List Clients Response instance from a processed List Clients operation.

This may be iterated through using a AwaRegisteredEntityIterator in order to retrieve the registered objects and object instances for the specified client. The List Clients Response is owned by the List Clients operation and should not be freed by the caller.

Parameters
[in]operationThe processed List Clients operation to obtain the List Clients response from.
[in]clientIDThe endpoint name of the connected client to search.
Returns
Pointer to AwaClientList ClientsResponse if operation is valid and has a valid response.
NULL if the operation is invalid, or has no valid response (may not have been processed).
Examples:
server-list-clients-example.c.
AwaRegisteredEntityIterator* AwaServerListClientsResponse_NewRegisteredEntityIterator ( const AwaServerListClientsResponse *  response)

Create a new Registered Entity iterator for a List Clients Response, used to iterate through the list of objects and object instances that exist within the client the response relates to.

The resulting iterator is owned by the caller and should eventually be freed with AwaRegisteredEntityIterator_Free. This function can only be successful after a List Clients operation has been successfully processed.

Parameters
[in]responseA pointer to the List Clients response to search.
Returns
A pointer to a new RegisteredEntityIterator instance on success.
NULL on failure.
Examples:
server-list-clients-example.c.
AwaError AwaServerListClientsOperation_Free ( AwaServerListClientsOperation **  operation)

Clean up a List Clients operation, freeing all allocated resources.

Once freed, the operation is no longer valid. Note: freeing a List Clients operation will invalidate all derived List Clients Response instances.

Parameters
[in,out]operationA pointer to a List Clients operation pointer that will be set to NULL.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is not valid.
Examples:
server-list-clients-example.c.
bool AwaClientIterator_Next ( AwaClientIterator *  iterator)

Determine whether the Client Iterator has not reached the end of a set of clients.

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

Parameters
[in]iteratorA pointer to a valid Client Iterator.
Returns
True if the Client Iterator is valid and the iterator has not yet reached the end of its elements.
False if the Client Iterator is invalid, or has reached the end of its elements.
Examples:
server-event-example.c, and server-list-clients-example.c.
const char* AwaClientIterator_GetClientID ( const AwaClientIterator *  iterator)

Retrieve the ID from the current client in the Client Iterator.

Parameters
[in]iteratorA pointer to a valid Client Iterator.
Returns
The client ID if the Client Iterator is valid.
NULL if the Client Iterator is invalid.
Examples:
server-event-example.c, and server-list-clients-example.c.
void AwaClientIterator_Free ( AwaClientIterator **  iterator)

Clean up a Client Iterator, freeing all allocated resources.

Once freed, the iterator is no longer valid.

Parameters
[in,out]iteratorA pointer to a Client Iterator pointer that will be set to NULL.
Examples:
server-event-example.c, and server-list-clients-example.c.
AwaClientIterator* AwaServerListClientsOperation_NewClientIterator ( const AwaServerListClientsOperation *  operation)

Create a new Client Iterator for a List Clients Response, used to iterate through the list of client endpoint names retrieved by the corresponding List Clients operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaClientIterator_Free. This function can only be successful after a List Clients operation has been successfully processed.

Parameters
[in]operationA pointer to a performed List Clients operation to iterate through
Returns
A pointer to a new ClientIterator instance on success.
NULL on failure.
Examples:
server-list-clients-example.c.
bool AwaRegisteredEntityIterator_Next ( AwaRegisteredEntityIterator *  iterator)

Determine whether the Registered Entity Iterator has not reached the end of a list of registered entities.

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

Parameters
[in]iteratorA pointer to a valid Registered Entity Iterator.
Returns
True if the Registered Entity Iterator is valid and the iterator has not yet reached the end of its elements.
False if the Registered Entity Iterator is invalid, or has reached the end of its elements.
Examples:
server-event-example.c, and server-list-clients-example.c.
const char* AwaRegisteredEntityIterator_GetPath ( const AwaRegisteredEntityIterator *  iterator)

Retrieve the path to the current registered entity in the Registered Entity Iterator.

Parameters
[in]iteratorA pointer to a valid Registered Entity Iterator.
Returns
The path if the Registered Entity Iterator is valid.
NULL if the Registered Entity Iterator is invalid.
Examples:
server-event-example.c, and server-list-clients-example.c.
void AwaRegisteredEntityIterator_Free ( AwaRegisteredEntityIterator **  iterator)

Clean up a Registered Entity Iterator, freeing all allocated resources.

Once freed, the iterator is no longer valid.

Parameters
[in,out]iteratorA pointer to a Registered Entity Iterator pointer that will be set to NULL.
Examples:
server-event-example.c, and server-list-clients-example.c.
AwaServerDefineOperation* AwaServerDefineOperation_New ( const AwaServerSession *  session)

Allocate and return a pointer to a new Define operation, that can be used to define Objects and Resources.

The operation is owned by the caller and should eventually be freed with AwaServerDefineOperation_Free.

Object and Resource Definitions are assembled by the application and sent to the client daemon for storage (a process called "Define"). After successful definition, the application can shut down and the daemon will retain the definitions.

Later, an application may wish to interact with these objects and resources. In order to do this in a type-safe manner, the Session must be aware of the definition. Definitions will be held by the Session if DefineObject/DefineResource functions were used to successfully define objects and resources. If not, then the definition must be retrieved with SessionRefresh.

Parameters
[in]sessionA pointer to a valid session.
Returns
Pointer to a newly allocated Define operation instance.
NULL on failure.
Examples:
server-defineset-example.c.
AwaError AwaServerDefineOperation_Add ( AwaServerDefineOperation *  operation,
const AwaObjectDefinition objectDefinition 
)

Add an Object Definition to an existing Define operation, so that the client will create a suitable definition for this new object type.

Multiple object definitions can be added to a single Define operation provided they correspond to different objects. An existing object definition cannot be redefined via this API. Note: A copy of the Object Definition is made, therefore all resources in the object definition must be defined before calling this function, if all are to be included.

Parameters
[in]operationPointer to a valid Define operation.
[in]objectDefinitionPointer to a valid Object Definition.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid or NULL.
AwaError_DefinitionInvalid if the object definition is invalid or NULL.
AwaError_AlreadyDefined if a definition already exists for the new object definition.
Examples:
server-defineset-example.c.
AwaError AwaServerDefineOperation_Perform ( AwaServerDefineOperation *  operation,
AwaTimeout  timeout 
)
AwaError AwaServerDefineOperation_Free ( AwaServerDefineOperation **  operation)

Clean up a Define operation, freeing all allocated resources.

Once freed, the operation is no longer valid.

Parameters
[in,out]operationA pointer to a Define operation pointer that will be set to NULL.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is not valid.
Examples:
server-defineset-example.c.
const AwaServerDefineResponse* AwaServerDefineOperation_GetResponse ( const AwaServerDefineOperation *  operation)

Obtain a Server Define Response instance from a processed Server Define operation.

This may be iterated through to determine whether the define operation succeeded for the requested paths. The Server Define Response is owned by the Server Define operation and should not be freed by the caller.

Parameters
[in]operationThe processed Server Define operation to obtain the Server Define response from.
Returns
Pointer to AwaClientServer DefineResponse if operation is valid and has a valid response.
NULL if the operation is invalid, or has no valid response (may not have been processed).
AwaPathIterator* AwaServerDefineResponse_NewPathIterator ( const AwaServerDefineResponse *  response)

Create a new Path Iterator for a Define Response, used to iterate through the list of paths returned in the response of the corresponding Define operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaPathIterator_Free. This function can only be successful after a Define operation has been successfully processed.

Parameters
[in]responseA pointer to the Define Response to search.
Returns
A pointer to a new PathIterator instance on success.
NULL on failure.
const AwaPathResult* AwaServerDefineResponse_GetPathResult ( const AwaServerDefineResponse *  response,
const char *  path 
)

Retrieve a path result from a Define Response relating to a definition on that path retrieved by the corresponding Define operation.

Querying the path result will allow the caller to determine the status of a request to define objects and resources.

Parameters
[in]responseA pointer to the Define Response to search.
[in]pathA path to an entity that was requested to be defined.
Returns
NULL if no definition exists in the Define response for the specified path, or if the response, path or result is NULL.
Pointer to PathResult instance. Do not free.
bool AwaServerDefineResponse_ContainsPath ( const AwaServerDefineResponse *  response,
const char *  path 
)

Test if the Define Response has the specified path to a resource or object present.

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

Parameters
[in]responseA pointer to a valid Define Response.
[in]pathThe path with which to query the Define Response.
Returns
True if the Define Response contains the specified resource path.
False if the Define Response does not contain the specified resource path, or if the path is invalid.
AwaServerReadOperation* AwaServerReadOperation_New ( const AwaServerSession *  session)

Allocate and return a pointer to a new Read operation, that can be used to retrieve resource values from the Core.

Read operations can be loaded with one or more paths of interest, corresponding to resources or trees of resources that the application wishes to retrieve. When processed, the response is made available via AwaServerReadOperation_GetResponse and will contain the resources returned by the Core in response to the query. The Read operation is owned by the caller and should eventually be freed with AwaServerReadOperation_Free.

Parameters
[in]sessionA pointer to a valid session.
Returns
Pointer to a newly allocated Read operation instance.
NULL on failure.
Examples:
server-read-example.c.
AwaError AwaServerReadOperation_AddPath ( AwaServerReadOperation *  operation,
const char *  clientID,
const char *  path 
)

Adds a path of interest to a Read operation, as a request to retrieve all resources at or covered by this path from the Core.

Adding an object path will retrieve all resources held by all object instances of this object. Adding an object instance path will retrieve all resources held by this object instance. Adding a resource path will retrieve that specific resource. Multiple-instance resources are retrieved in their entirety (the entire array is retrieved) Adding a path that does not correspond to any resources in the Core will result in the subsequent ReadResponse lacking resources for that path.

Parameters
[in]operationThe Read operation to add the path of interest to.
[in]clientIDThe name of the client to query
[in]pathThe path of the resource, object instance or object requested for retrieval.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid.
AwaError_PathInvalid if the path specified is not a valid data model path.
Examples:
server-read-example.c.
AwaError AwaServerReadOperation_Perform ( AwaServerReadOperation *  operation,
AwaTimeout  timeout 
)

Process the Read operation by sending it to the Core.

If successful, the response can be obtained with AwaServerReadOperation_GetResponse and queried for retrieved resource values.

Parameters
[in]operationThe Read operation to process.
[in]timeoutThe function will wait at least as long as this value for a response.
Returns
AwaError_Success on success.
AwaError_Timeout if no response is received after the timeout duration expires.
Various errors on failure.
Examples:
server-read-example.c.
AwaError AwaServerReadOperation_Free ( AwaServerReadOperation **  operation)

Clean up a Read operation, freeing all allocated resources.

Once freed, the operation is no longer valid. Note: freeing a Read operation will invalidate all derived Read Response instances, and any Opaque or CString pointers retrieved from an associated Read Response.

Parameters
[in,out]operationA pointer to a Read operation pointer that will be set to NULL.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is not valid.
Examples:
server-read-example.c.
AwaClientIterator* AwaServerReadOperation_NewClientIterator ( const AwaServerReadOperation *  operation)

Create a new Client Iterator for a performed Read Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Read operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaClientIterator_Free. This function can only be successful after a Read operation has been successfully processed.

Parameters
[in]operationA pointer to a performed Read operation to iterate through
Returns
A pointer to a new ClientIterator instance on success.
NULL on failure.
const AwaServerReadResponse* AwaServerReadOperation_GetResponse ( const AwaServerReadOperation *  operation,
const char *  clientID 
)

Obtain a Read Response instance from a processed Read operation.

This may be queried directly by path to obtain the resource values returned by the Core. A Path iterator can be used to obtain a list of all resource paths provided by the Read Response. The Read Response is owned by the Read operation and should not be freed by the caller.

Parameters
[in]operationThe processed Read operation to obtain the Read response from.
[in]clientIDThe endpoint name of the client to retrieve read values from.
Returns
Pointer to AwaServerReadResponse if operation is valid and has a valid response.
NULL if the operation is invalid, or has no valid response (may not have been processed).
Examples:
server-read-example.c.
AwaPathIterator* AwaServerReadResponse_NewPathIterator ( const AwaServerReadResponse *  response)

Create a new Path Iterator for a Read Response, used to iterate through the list of resource paths retrieved by the corresponding Read operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaPathIterator_Free. This function can only be successful after a Read operation has been successfully processed.

Parameters
[in]responseA pointer to the Read Response to search.
Returns
A pointer to a new PathIterator instance on success.
NULL on failure.
const AwaPathResult* AwaServerReadResponse_GetPathResult ( const AwaServerReadResponse *  response,
const char *  path 
)

Retrieve a path result from a Read Response relating to a subscription to that path retrieved by the corresponding Read operation.

Querying the path result will allow the caller to determine the status of a request to read an object, object instance or resource.

Parameters
[in]responseA pointer to the Read Response to search.
[in]pathA path to an entity that was requested to be read from.
Returns
NULL if no definition exists in the Read response for the specified path, or if the response, path or result is NULL.
Pointer to PathResult instance. Do not free.
bool AwaServerReadResponse_ContainsPath ( const AwaServerReadResponse *  response,
const char *  path 
)

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

If the Read Response contains paths beyond the specified path, the path will be considered present. This function can only be successful after a Read operation has been successfully processed.

Parameters
[in]responseA pointer to a valid Read Response.
[in]pathThe path with which to query the Read Response.
Returns
True if the Read Response contains the specified resource path.
False if the Read Response does not contain the specified resource path, or if the path is invalid.
bool AwaServerReadResponse_HasValue ( const AwaServerReadResponse *  response,
const char *  path 
)

Test if the Read Response has a value for the specified resource path.

If the Read Response contains a value for the specified path, and the Resource Type is known, it can be retrieved with the appropriate AwaServerReadResponse_ReadValueAs_ function. This function can only be successful after a Read operation has been successfully processed.

Parameters
[in]responseA pointer to a valid Read Response.
[in]pathThe path with which to query the Read Response.
Returns
True if the Read Response contains a value for the specified resource path.
False if the Read Response does not contain a value for the specified resource path, or if the path is invalid.
AwaError AwaServerReadResponse_GetValueAsOpaque ( const AwaServerReadResponse *  response,
const char *  path,
AwaOpaque value 
)

Retrieve an opaque resource's value from a Read Response.

The resource is identified by the path. This function can only be successful after a Read operation has been successfully processed. A pointer to a AwaOpaque struct is passed in and populated by the function. The data pointer within the AwaOpaque struct is only valid as long as the Read operation remains valid. If the operation is freed, the data pointer is immediately invalid and should not be used or dereferenced.

Parameters
[in]responseThe current Read Response 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 Read 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 AwaServerReadResponse_GetValueAsObjectLink ( const AwaServerReadResponse *  response,
const char *  path,
AwaObjectLink value 
)

Retrieve an object link resource's value from a Read Response.

The resource is identified by the path. This function can only be successful after a Read operation has been successfully processed. A pointer to a AwaObjectLink struct is passed in and populated by the function.

Parameters
[in]responseThe current Read Response 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 Read 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.
const char* AwaWriteMode_ToString ( AwaWriteMode  writeMode)

Get a descriptive name for the specified Write Mode.

Parameters
[in]writeModeWrite Mode
Returns
Pointer to an immutable c string
AwaWriteMode AwaWriteMode_FromString ( const char *  writeModeString)

Get a Write Mode from a descriptive name of a Write Mode.

Parameters
[in]writeModeStringA Write Mode in string form
Returns
A Awa Write Mode code
AwaServerWriteOperation* AwaServerWriteOperation_New ( const AwaServerSession *  session,
AwaWriteMode  defaultMode 
)

Allocate and return a pointer to a new Write Operation, that can be used to set resource values.

Optional resources can be created if AwaWriteMode_Update is specified as the default write mode. New object instances can be created, automatically creating all covered mandatory resources. Write Operations can be loaded with one or more resource paths with corresponding value. The Write Operation is owned by the caller and should eventually be freed with AwaServerWriteOperation_Free.

Parameters
[in]sessionA pointer to a valid session.
[in]defaultModeThe default write mode to use; either AwaWriteMode_Replace, or AwaWriteMode_Update.
Returns
A pointer to a newly allocated Write Operation instance.
NULL on failure.
Examples:
server-observe-example.c, server-write-create-example.c, server-write-create-unspecified-instance-example.c, and server-write-example.c.
AwaError AwaServerWriteOperation_CreateObjectInstance ( AwaServerWriteOperation *  operation,
const char *  path 
)

Adds an object instance path to a Write Operation, as a request to create an Object Instance.

The target object must support creation of a new object instance, such as supporting multiple instances, or an optional instance that does not exist. When the operation is processed, if the object instance ID is specified in the path, the object instance requested will be created (or an error returned if it already exists). If the object instance ID is not specified in the path, the ID will be automatically assigned by the Core if the instance can be created.

Parameters
[in]operationThe Write Operation to add the path of interest to.
[in]pathThe path of the object or object instance requested for object instance creation.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid.
AwaError_PathInvalid if the specified path is invalid.
Examples:
server-write-create-example.c, and server-write-create-unspecified-instance-example.c.
AwaError AwaServerWriteOperation_SetObjectInstanceWriteMode ( AwaServerWriteOperation *  operation,
const char *  path,
AwaWriteMode  mode 
)

Changes the write mode for an object instance path.

Write Operations on object instances use defaultMode set in AwaServerWriteOperation_New by default, but can be set to another mode to change the write behavior for specific object instance paths. Using AwaWriteMode_Replace will only succeed if the object instance already exists.

Parameters
[in]operationThe Write Operation to add the path of interest to.
[in]pathThe path of object instance to modify for a corresponding write.
[in]modeThe write mode to use; either AwaWriteMode_Replace, or AwaWriteMode_Update.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid, or the specified write mode is invalid.
AwaError_PathInvalid if the specified path is invalid.
AwaError AwaServerWriteOperation_SetResourceWriteMode ( AwaServerWriteOperation *  operation,
const char *  path,
AwaWriteMode  mode 
)

Changes the write mode for a resource path.

Write Operations on resource use defaultMode set in AwaServerWriteOperation_New by default, but can be set to another mode to change the write behavior for specific resource paths. Using AwaWriteMode_Replace will only succeed if the resource already exists. This function is intended to be used for multiple-instance resources, where AwaWriteMode_Update will amend an array resource, whereas AwaWriteMode_Replace will entirely replace it with the values passed in the write operation.

Parameters
[in]operationThe Write Operation to add the path of interest to.
[in]pathThe path of object instance to modify for a corresponding write.
[in]modeThe write mode to use; either AwaWriteMode_Replace, or AwaWriteMode_Update.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid, or the specified write mode is invalid.
AwaError_PathInvalid if the specified path is invalid.
AwaError AwaServerWriteOperation_Perform ( AwaServerWriteOperation *  operation,
const char *  clientID,
AwaTimeout  timeout 
)

Process the Write Operation by sending it to the Core.

This function is intended to be called once per connected client in order to set resources more efficiently than being required to specify multiple client IDs for each path.

Parameters
[in]operationThe Write Operation to process.
[in]clientIDThe name of the client to perform the Write Operation
[in]timeoutThe function will wait at least as long as this value for a response.
Returns
AwaError_Success on success.
AwaError_Timeout if no response is received after the timeout duration expires.
Various errors on failure.
Examples:
server-observe-example.c, server-write-create-example.c, server-write-create-unspecified-instance-example.c, and server-write-example.c.
const AwaServerWriteResponse* AwaServerWriteOperation_GetResponse ( const AwaServerWriteOperation *  operation,
const char *  clientID 
)

Obtain a Write Response instance from a processed Write Operation.

This may be iterated through to determine whether the write operation succeeded for the requested paths. The Write Response is owned by the Write Operation and should not be freed by the caller.

Parameters
[in]operationThe processed Write Operation to obtain the Write response from.
[in]clientIDThe endpoint name of the connected client to search.
Returns
Pointer to AwaServerWriteResponse if operation is valid and has a valid response.
NULL if the operation is invalid, or has no valid response (may not have been processed).
Examples:
server-write-create-unspecified-instance-example.c.
AwaError AwaServerWriteOperation_Free ( AwaServerWriteOperation **  operation)

Clean up a Write Operation, freeing all allocated resources.

Once freed, the operation is no longer valid.

Parameters
[in,out]operationA pointer to a Write Operation pointer that will be set to NULL.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is not valid.
Examples:
server-observe-example.c, server-write-create-example.c, server-write-create-unspecified-instance-example.c, and server-write-example.c.
AwaClientIterator* AwaServerWriteOperation_NewClientIterator ( const AwaServerWriteOperation *  operation)

Create a new Client Iterator for a Write Response, used to iterate through the list of client endpoint names retrieved by the corresponding Write Operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaClientIterator_Free. This function can only be successful after a Write Operation has been successfully processed.

Parameters
[in]operationA pointer to a performed Write Operation to iterate through
Returns
A pointer to a new ClientIterator instance on success.
NULL on failure.
AwaPathIterator* AwaServerWriteResponse_NewPathIterator ( const AwaServerWriteResponse *  response)

Create a new Path Iterator for a Write Response, used to iterate through the list of paths returned in the response of the corresponding Write Operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaPathIterator_Free. This function can only be successful after a Write Operation has been successfully processed.

Parameters
[in]responseA pointer to the Write Response to search.
Returns
A pointer to a new PathIterator instance on success.
NULL on failure.
Examples:
server-write-create-unspecified-instance-example.c.
const AwaPathResult* AwaServerWriteResponse_GetPathResult ( const AwaServerWriteResponse *  response,
const char *  path 
)

Retrieve a path result from a Write Response relating to a write to that path retrieved by the corresponding Write Operation.

Querying the path result will allow the caller to determine the status of a request to define objects and resources.

Parameters
[in]responseA pointer to the Write Response to search.
[in]pathA path to an entity that was written to.
Returns
NULL if no definition exists in the Write response for the specified path, or if the response, path or result is NULL.
Pointer to PathResult instance. Do not free.
bool AwaServerWriteResponse_ContainsPath ( const AwaServerWriteResponse *  response,
const char *  path 
)

Test if the Write Response has the specified path to a resource or object present.

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

Parameters
[in]responseA pointer to a valid Write Response.
[in]pathThe path with which to query the Write Response.
Returns
True if the Write Response contains the specified resource path.
False if the Write Response does not contain the specified resource path, or if the path is invalid.
AwaServerDeleteOperation* AwaServerDeleteOperation_New ( const AwaServerSession *  session)

Allocate and return a pointer to a new Delete operation, that can be used to delete optional resources, resource instances, and object instances.

Parameters
[in]sessionA pointer to a valid session instance.
Returns
A pointer to a newly allocated Delete operation instance, or NULL on failure.
Examples:
server-delete-object-instance-example.c.
AwaError AwaServerDeleteOperation_AddPath ( AwaServerDeleteOperation *  operation,
const char *  clientID,
const char *  path 
)

Adds a path to a Delete operation, as a request to delete the specified object or object instance.

Individual resources cannot be deleted.

Parameters
[in]operationA pointer to a valid delete operation.
[in]clientIDThe endpoint name of the connected client to request resources to be deleted.
[in]pathThe path of the resource, resource instance or object instance requested to delete.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid.
AwaError_PathInvalid if the specified path is invalid.
AwaError_NotDefined if the specified path refers to an object or resource that is not defined.
Examples:
server-delete-object-instance-example.c.
AwaError AwaServerDeleteOperation_Perform ( AwaServerDeleteOperation *  operation,
AwaTimeout  timeout 
)

Process the Delete operation by sending it to the Core.

Parameters
[in]operationThe Delete operation to process.
[in]timeoutThe function will wait at least as long as this value for a response.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid.
AwaError_Timeout if no response is received after the timeout duration expires.
Various errors on failure.
Examples:
server-delete-object-instance-example.c.
const AwaServerDeleteResponse* AwaServerDeleteOperation_GetResponse ( const AwaServerDeleteOperation *  operation,
const char *  clientID 
)

Obtain a Delete Response instance from a processed Delete operation.

This may be iterated through to determine whether the delete operation succeeded for the requested paths. The Delete Response is owned by the Delete operation and should not be freed by the caller.

Parameters
[in]operationThe processed Delete operation to obtain the Delete response from.
[in]clientIDThe endpoint name of the connected client to search.
Returns
Pointer to AwaServerDeleteResponse if operation is valid and has a valid response.
NULL if the operation is invalid, or has no valid response (may not have been processed).
AwaError AwaServerDeleteOperation_Free ( AwaServerDeleteOperation **  operation)

Clean up a Delete operation, freeing all allocated resources.

Once freed, the operation is no longer valid.

Parameters
[in,out]operationA pointer to a Delete operation pointer that will be set to NULL.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is not valid.
Examples:
server-delete-object-instance-example.c.
AwaClientIterator* AwaServerDeleteOperation_NewClientIterator ( const AwaServerDeleteOperation *  operation)

Create a new Client Iterator for a performed Delete Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Delete operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaClientIterator_Free. This function can only be successful after a Delete operation has been successfully processed.

Parameters
[in]operationA pointer to a performed Delete Operation to iterate through.
Returns
A pointer to a new ClientIterator instance on success.
NULL on failure.
AwaPathIterator* AwaServerDeleteResponse_NewPathIterator ( const AwaServerDeleteResponse *  response)

Create a new Path Iterator for a Delete Response, used to iterate through the list of resource paths retrieved by the corresponding Delete operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaPathIterator_Free. This function can only be successful after a Delete operation has been successfully processed.

Parameters
[in]responseA pointer to the Delete Response to search.
Returns
A pointer to a new PathIterator instance on success.
NULL on failure.
const AwaPathResult* AwaServerDeleteResponse_GetPathResult ( const AwaServerDeleteResponse *  response,
const char *  path 
)

Retrieve a path result from a Delete Response relating to a subscription to that path retrieved by the corresponding Delete operation.

Querying the path result will allow the caller to determine the status of a request to delete an object or object instance.

Parameters
[in]responseA pointer to the Delete Response to search.
[in]pathA path to an entity that was requested to be deleted.
Returns
NULL if no definition exists in the Delete response for the specified path, or if the response, path or result is NULL.
Pointer to PathResult instance. Do not free.
bool AwaServerDeleteResponse_ContainsPath ( const AwaServerDeleteResponse *  response,
const char *  path 
)

Test if the Delete Response has the specified path (object instance or object) present.

If the Delete Response contains paths beyond the specified path, the path will be considered present. This function can only be successful after a Delete operation has been successfully processed.

Parameters
[in]responseA pointer to a valid Delete Response.
[in]pathThe path with which to query the Delete Response.
Returns
True if the Delete Response contains the specified resource path.
False if the Delete Response does not contain the specified resource path, or if the path is invalid.
AwaServerExecuteOperation* AwaServerExecuteOperation_New ( const AwaServerSession *  session)

Allocate and return a pointer to a new Execute operation, that can be used to trigger executable resources.

An execute arguments instance can be optionally passed in order to provide a way to control how a resource is executed. The Execute operation is owned by the caller and should eventually be freed with AwaServerExecuteOperation_Free.

Parameters
[in]sessionA pointer to a valid session.
Returns
A pointer to a newly allocated Execute operation instance.
NULL on failure.
Examples:
client-subscribe-to-execute-example.c, server-execute-arguments-example.c, and server-execute-example.c.
AwaError AwaServerExecuteOperation_AddPath ( AwaServerExecuteOperation *  operation,
const char *  clientID,
const char *  path,
const AwaExecuteArguments arguments 
)

Adds a path to an Execute operation, as a request to execute the specified resource.

Parameters
[in]operationA pointer to a valid Execute operation.
[in]clientIDThe endpoint name of the connected client to execute upon.
[in]pathThe path of the resource, resource instance or object instance requested to execute.
[in]argumentsExecute arguments, or NULL to execute the resource without arguments.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid.
AwaError_PathInvalid if the specified path is invalid.
AwaError_NotDefined if the specified path refers to an object or resource that is not defined.
Examples:
client-subscribe-to-execute-example.c, server-execute-arguments-example.c, and server-execute-example.c.
AwaError AwaServerExecuteOperation_Perform ( AwaServerExecuteOperation *  operation,
AwaTimeout  timeout 
)

Process the Execute operation by sending it to the Core.

In the current version perform only supports executing resources on a single client, but in the future multiple clients will be supported.

Parameters
[in]operationThe Execute operation to process.
[in]timeoutThe function will wait at least as long as this value for a response.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid.
AwaError_Timeout if no response is received after the timeout duration expires.
Various errors on failure.
Examples:
client-subscribe-to-execute-example.c, server-execute-arguments-example.c, and server-execute-example.c.
const AwaServerExecuteResponse* AwaServerExecuteOperation_GetResponse ( const AwaServerExecuteOperation *  operation,
const char *  clientID 
)

Obtain an Execute Response instance from a processed Execute operation.

This may be iterated through to determine whether the execute operation succeeded for the requested resource paths. The Execute Response is owned by the Execute operation and should not be freed by the caller.

Parameters
[in]operationThe processed Execute operation to obtain the Execute response from.
[in]clientIDThe endpoint name of the connected client to search.
Returns
Pointer to AwaServerExecuteResponse if operation is valid and has a valid response.
NULL if the operation is invalid, or has no valid response (may not have been processed).
AwaError AwaServerExecuteOperation_Free ( AwaServerExecuteOperation **  operation)

Clean up an Execute operation, freeing all allocated resources.

Once freed, the operation is no longer valid.

Parameters
[in,out]operationA pointer to an Execute operation pointer that will be set to NULL.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is not valid.
Examples:
client-subscribe-to-execute-example.c, server-execute-arguments-example.c, and server-execute-example.c.
AwaClientIterator* AwaServerExecuteOperation_NewClientIterator ( const AwaServerExecuteOperation *  operation)

Create a new Client Iterator for a performed Execute Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Execute operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaClientIterator_Free. This function can only be successful after an Execute operation has been successfully processed.

Parameters
[in]operationA pointer to a performed Execute operation to iterate through
Returns
A pointer to a new ClientIterator instance on success.
NULL on failure.
AwaPathIterator* AwaServerExecuteResponse_NewPathIterator ( const AwaServerExecuteResponse *  response)

Create a new Path Iterator for an Execute Response, used to iterate through the list of resource paths retrieved by the corresponding Execute operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaPathIterator_Free. This function can only be successful after an Execute operation has been successfully processed.

Parameters
[in]responseA pointer to the Execute Response to search.
Returns
A pointer to a new PathIterator instance on success.
NULL on failure.
const AwaPathResult* AwaServerExecuteResponse_GetPathResult ( const AwaServerExecuteResponse *  response,
const char *  path 
)

Retrieve a path result from an Execute Response relating to an execution to that path retrieved by the corresponding Execute operation.

Querying the path result will allow the caller to determine the status of a request to execute a resource.

Parameters
[in]responseA pointer to the Execute Response to search.
[in]pathA path to a resource that was requested to be executed.
Returns
NULL if no definition exists in the Execute response for the specified path, or if the response, path or result is NULL.
Pointer to PathResult instance. Do not free.
bool AwaServerExecuteResponse_ContainsPath ( const AwaServerExecuteResponse *  response,
const char *  path 
)

Test if the Execute Response has the specified resource path present.

If the Execute Response contains paths beyond the specified path, the path will be considered present. This function can only be successful after an Execute operation has been successfully processed.

Parameters
[in]responseA pointer to a valid Execute Response.
[in]pathThe path with which to query the Execute Response.
Returns
True if the Execute Response contains the specified resource path.
False if the Execute Response does not contain the specified resource path, or if the path is invalid.
AwaServerWriteAttributesOperation* AwaServerWriteAttributesOperation_New ( const AwaServerSession *  session)

Allocate and return a pointer to a new Write Attributes operation, that can be used to modify when notifications for changes to objects, object instances and resources will be sent from a connected client to the observing server daemon.

The inverse of the Write Attributes operation is Discover, which allows the discovery of existing write attributes attached to objects, object instances and resources. In LWM2M 1.0, only the following attributes are supported:

  • Name:Minimum Period, Link:pmin, Attachment:Resource, Type:Integer
  • Name:Maximum Period, Link:pmax, Attachment:Resource, Type:Integer
  • Name:Greater Than, Link:gt, Attachment:Resource, Type:Float
  • Name:Less Than, Link:lt, Attachment:Resource, Type:Float
  • Name:Step, Link:stp, Attachment:Resource, Type:Float The Write Attributes operation is owned by the caller and should eventually be freed with AwaServerWrite AttributesOperation_Free.
    Parameters
    [in]sessionA pointer to a valid session.
    Returns
    A pointer to a newly allocated Write Attributes operation instance.
    NULL on failure.
AwaError AwaServerWriteAttributesOperation_Perform ( AwaServerWriteAttributesOperation *  operation,
AwaTimeout  timeout 
)

Process the Write Attributes operation by sending it to the Core.

All attribute values must be verified before being written for the result to be successful. Any error will result in no attributes being written.

Parameters
[in]operationThe Write Attributes operation to process.
[in]timeoutThe function will wait at least as long as this value for a response.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid.
AwaError_Timeout if no response is received after the timeout duration expires.
Various errors on failure.
const AwaServerWriteAttributesResponse* AwaServerWriteAttributesOperation_GetResponse ( const AwaServerWriteAttributesOperation *  operation,
const char *  clientID 
)

Obtain a Write Attributes Response instance from a processed Write Attributes operation.

This may be iterated through to determine whether the Write Attributes operation succeeded on the requested paths. The Write Attributes Response is owned by the Write Attributes operation and should not be freed by the caller.

Parameters
[in]operationThe processed Write Attributes operation to obtain the Write Attributes response from.
[in]clientIDThe endpoint name of the connected client to search.
Returns
Pointer to AwaServerWrite AttributesResponse if operation is valid and has a valid response.
NULL if the operation is invalid, or has no valid response (may not have been processed).
AwaError AwaServerWriteAttributesOperation_Free ( AwaServerWriteAttributesOperation **  operation)

Clean up a Write Attributes operation, freeing all allocated resources.

Once freed, the operation is no longer valid.

Parameters
[in,out]operationA pointer to a Write Attributes operation pointer that will be set to NULL.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is not valid.
AwaClientIterator* AwaServerWriteAttributesOperation_NewClientIterator ( const AwaServerWriteAttributesOperation *  operation)

Create a new Client Iterator for a performed Write Attributes Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Write Attributes operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaClientIterator_Free. This function can only be successful after a Write Attributes operation has been successfully processed.

Parameters
[in]operationA pointer to a performed Write Attributes operation to iterate through
Returns
A pointer to a new ClientIterator instance on success.
NULL on failure.
AwaPathIterator* AwaServerWriteAttributesResponse_NewPathIterator ( const AwaServerWriteAttributesResponse *  response)

Create a new Path Iterator for a Write Attributes Response, used to iterate through the list of paths retrieved by the corresponding Write Attributes operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaPathIterator_Free. This function can only be successful after a Write Attributes operation has been successfully processed.

Parameters
[in]responseA pointer to the Write Attributes Response to search.
Returns
A pointer to a new PathIterator instance on success.
NULL on failure.
const AwaPathResult* AwaServerWriteAttributesResponse_GetPathResult ( const AwaServerWriteAttributesResponse *  response,
const char *  path 
)

Retrieve a path result from a Write Attributes Response relating to a subscription to that path retrieved by the corresponding Write Attributes operation.

Querying the path result will allow the caller to determine the status of a request to Write Attributes to an object, object instance or resource.

Parameters
[in]responseA pointer to the Write Attributes Response to search.
[in]pathA path to an entity that had attributes written to.
Returns
NULL if no definition exists in the Write Attributes response for the specified path, or if the response, path or result is NULL.
Pointer to PathResult instance. Do not free.
bool AwaServerWriteAttributesResponse_ContainsPath ( const AwaServerWriteAttributesResponse *  response,
const char *  path 
)

Test if the Write Attributes Response has the specified path (resource, object instance or object) present.

If the Write Attributes Response contains paths beyond the specified path, the path will be considered present. This function can only be successful after a Write Attributes operation has been successfully processed.

Parameters
[in]responseA pointer to a valid Write Attributes Response.
[in]pathThe path with which to query the Write Attributes Response.
Returns
True if the Write Attributes Response contains the specified resource path.
False if the Write Attributes Response does not contain the specified resource path, or if the path is invalid.
AwaServerDiscoverOperation* AwaServerDiscoverOperation_New ( const AwaServerSession *  session)

Allocate and return a pointer to a new Discover operation, that can be used to discover attributes attached to objects, object instances and resources.

The discover operation can also be used to discover which resources are implemented for a given object instance. The Discover operation is owned by the caller and should eventually be freed with AwaServerDiscoverOperation_Free.

Parameters
[in]sessionA pointer to a valid session.
Returns
A pointer to a newly allocated Discover operation instance.
NULL on failure.
AwaError AwaServerDiscoverOperation_AddPath ( AwaServerDiscoverOperation *  operation,
const char *  clientID,
const char *  path 
)

Adds a path to a Discover operation, as a request to discover the specified resource.

Parameters
[in]operationA pointer to a valid Discover operation.
[in]clientIDThe endpoint name of the client to discover entities.
[in]pathThe path of the resource, resource instance or object instance requested to discover.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid.
AwaError_PathInvalid if the specified path is invalid.
AwaError_NotDefined if the specified path refers to an object or resource that is not defined.
AwaError AwaServerDiscoverOperation_Perform ( AwaServerDiscoverOperation *  operation,
AwaTimeout  timeout 
)

Process the Discover operation by sending it to the Core.

Parameters
[in]operationThe Discover operation to process.
[in]timeoutThe function will wait at least as long as this value for a response.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid.
AwaError_Timeout if no response is received after the timeout duration expires.
Various errors on failure.
const AwaServerDiscoverResponse* AwaServerDiscoverOperation_GetResponse ( const AwaServerDiscoverOperation *  operation,
const char *  clientID 
)

Obtain a Discover Response instance from a processed Discover operation.

This may be iterated through to determine whether the Discover operation succeeded on the requested paths. The Discover Response is owned by the Discover operation and should not be freed by the caller.

Parameters
[in]operationThe processed Discover operation to obtain the Discover response from.
[in]clientIDThe endpoint name of the connected client to perform the discover operation upon.
Returns
Pointer to AwaServerDiscoverResponse if operation is valid and has a valid response.
NULL if the operation is invalid, or has no valid response (may not have been processed).
AwaError AwaServerDiscoverOperation_Free ( AwaServerDiscoverOperation **  operation)

Clean up a Discover operation, freeing all allocated resources.

Once freed, the operation is no longer valid.

Parameters
[in,out]operationA pointer to a Discover operation pointer that will be set to NULL.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is not valid.
AwaClientIterator* AwaServerDiscoverOperation_NewClientIterator ( const AwaServerDiscoverOperation *  operation)

Create a new Client Iterator for a performed Discover Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Discover operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaClientIterator_Free. This function can only be successful after a Discover operation has been successfully processed.

Parameters
[in]operationA pointer to a performed Discover operation to iterate through.
Returns
A pointer to a new ClientIterator instance on success.
NULL on failure.
AwaPathIterator* AwaServerDiscoverResponse_NewPathIterator ( const AwaServerDiscoverResponse *  response)

Create a new Path Iterator for a Discover Response, used to iterate through the list of paths retrieved by the corresponding Discover operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaPathIterator_Free. This function can only be successful after a Discover operation has been successfully processed.

Parameters
[in]responseA pointer to the Discover Response to search.
Returns
A pointer to a new PathIterator instance on success.
NULL on failure.
const AwaPathResult* AwaServerDiscoverResponse_GetPathResult ( const AwaServerDiscoverResponse *  response,
const char *  path 
)

Retrieve a path result from a Discover Response relating to a subscription to that path retrieved by the corresponding Discover operation.

Querying the path result will allow the caller to determine the status of a request to Discover an object, object instance or resource.

Parameters
[in]responseA pointer to the Discover Response to search.
[in]pathA path to an entity that had attributes written to.
Returns
NULL if no definition exists in the Discover response for the specified path, or if the response, path or result is NULL.
Pointer to PathResult instance. Do not free.
bool AwaServerDiscoverResponse_ContainsPath ( const AwaServerDiscoverResponse *  response,
const char *  path 
)

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

If the Discover Response contains paths beyond the specified path, the path will be considered present. This function can only be successful after a Discover operation has been successfully processed.

Parameters
[in]responseA pointer to a valid Discover Response.
[in]pathThe path with which to query the Discover Response.
Returns
True if the Discover Response contains the specified resource path.
False if the Discover Response does not contain the specified resource path, or if the path is invalid.
AwaAttributeIterator* AwaServerDiscoverResponse_NewAttributeIterator ( const AwaServerDiscoverResponse *  response,
const char *  path 
)

Create a new Attribute Iterator for a Discover Response, used to iterate through the list of attributes retrieved by the corresponding Discover operation.

Each path may have zero or more attributes. The resulting iterator is owned by the caller and should eventually be freed with AwaAttributeIterator_Free. This function can only be successful after a Discover operation has been successfully processed.

Parameters
[in]responseA pointer to the Discover Response to search.
[in]pathThe path to an entity to explore discovered attributes.
Returns
A pointer to a new PathIterator instance on success.
NULL on failure.
bool AwaAttributeIterator_Next ( AwaAttributeIterator *  iterator)

Determine whether the Attribute Iterator has not reached the end of a list of attributes.

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

Parameters
[in]iteratorA pointer to a valid Attribute Iterator.
Returns
True if the Attribute Iterator is valid and the iterator has not yet reached the end of its elements.
False if the Attribute Iterator is invalid, or has reached the end of its elements.
const char* AwaAttributeIterator_GetLink ( const AwaAttributeIterator *  iterator)

Retrieve the link name associated with the current attribute in the Attribute Iterator.

Parameters
[in]iteratorA pointer to a valid Attribute Iterator.
Returns
The path if the Attribute Iterator is valid.
NULL if the Attribute Iterator is invalid.
void AwaAttributeIterator_Free ( AwaAttributeIterator **  iterator)

Clean up a Attribute Iterator, freeing all allocated resources.

Once freed, the iterator is no longer valid.

Parameters
[in,out]iteratorA pointer to a Attribute Iterator pointer that will be set to NULL.
AwaServerObserveOperation* AwaServerObserveOperation_New ( const AwaServerSession *  session)

Allocate and return a pointer to a new Observe operation, that can be used to observe to and be notified of changes to objects, object instances and resource values from the Core.

Observe operations can be loaded with one or more paths of interest, corresponding to resources or trees of resources that the application wishes to observe. When processed, the response is made available via AwaServerObserveOperation_GetResponse and will contain result information for each of the paths returned by the Core in response to the query. The Observe operation is owned by the caller and should eventually be freed with AwaServerObserveOperation_Free.

Parameters
[in]sessionA pointer to a valid session.
Returns
Pointer to a newly allocated Observe operation instance.
NULL on failure.
Examples:
server-observe-example.c.
AwaError AwaServerObserveOperation_AddObservation ( AwaServerObserveOperation *  operation,
AwaServerObservation *  observation 
)

Adds an Observation of interest to an Observe operation, as a request to be notified of changes to the observed entity from the Core.

Parameters
[in]operationThe Observe operation to add the path of interest to.
[in]observationA valid Change observation to an entity of interest.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid.
AwaError_ObservationInvalid if the observation is invalid.
Examples:
server-observe-example.c.
AwaError AwaServerObserveOperation_AddCancelObservation ( AwaServerObserveOperation *  operation,
AwaServerObservation *  observation 
)

Adds a Cancel flag to an Observation in a specified Observe operation, as a request to cancel being notified of changes to the observed entity from the Core.

Parameters
[in]operationThe Observe operation to add the path of interest to.
[in]observationA valid Change observation to an entity of interest.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is invalid.
AwaError_ObservationInvalid if the observation is invalid.
Examples:
server-observe-example.c.
AwaError AwaServerObserveOperation_Perform ( AwaServerObserveOperation *  operation,
AwaTimeout  timeout 
)

Process the Observe operation by sending it to the Core, notifying the Core to begin or cancel observation to changes of the observed entities inside the specified Observe operation.

If successful, the response can be obtained with AwaClientObserveOperation_GetResponse and queried for path results, each of which relate to the result of a single request to begin or cancel an observation.

Parameters
[in]operationThe Observe operation to process.
[in]timeoutThe function will wait at least as long as this value for a response.
Returns
AwaError_Success on success.
AwaError_Timeout if no response is received after the timeout duration expires.
Various errors on failure.
Examples:
server-observe-example.c.
const AwaServerObserveResponse* AwaServerObserveOperation_GetResponse ( const AwaServerObserveOperation *  operation,
const char *  clientID 
)

Obtain an Observe Response instance from a processed Observe operation.

This may be queried directly by path to obtain results of an observation request returned by the Core. A Path iterator can be used to obtain a list of all observation paths provided by the Observe Response. The Observe Response is owned by the Observe operation and should not be freed by the caller.

Parameters
[in]operationThe processed Observe operation to obtain the Observe response from.
[in]clientIDThe endpoint name of the connected client to process an observe response from.
Returns
Pointer to AwaClientObserveResponse if operation is valid and has a valid response.
NULL if the operation is invalid, or has no valid response (may not have been processed).
AwaError AwaServerObserveOperation_Free ( AwaServerObserveOperation **  operation)

Clean up an Observe operation, freeing all allocated resources.

Once freed, the operation is no longer valid. Note: freeing an Observe operation will invalidate all derived Observe Response instances.

Parameters
[in,out]operationA pointer to an Observe operation pointer that will be set to NULL.
Returns
AwaError_Success on success.
AwaError_OperationInvalid if the operation is not valid.
Examples:
server-observe-example.c.
AwaServerObservation* AwaServerObservation_New ( const char *  clientID,
const char *  path,
AwaServerObservationCallback  callback,
void *  context 
)

Allocate and return a pointer to a new Observation, that can be used to observe to changes on either a resource, object instance or object.

The specified callback function will be fired on AwaServerSession_DispatchCallbacks if the observed entity has changed since the session callbacks were last dispatched. The observation will not be active until it is added to an Observe operation and performed. Operations can be created within a callback, but they cannot be performed. The caller must keep any observations valid until the entire observe operation is freed. The Observation is owned by the caller and should eventually be freed with AwaServerObservation_Free.

Parameters
[in]clientIDThe endpoint name of the connected client intended to begin or cancel observations upon.
[in]pathThe path of the resource, object instance or object to observe.
[in]callbackPointer to function to call when the entity specified by path is created, changed or deleted.
[in]contextA pointer to a user specified object for use in the change callback
Returns
A pointer to a newly allocated Observation instance.
NULL on failure.
Examples:
server-observe-example.c.
const char* AwaServerObservation_GetPath ( AwaServerObservation *  observation)

Retrieve the path from an Observation.

Parameters
[in]observationA valid Observation.
Returns
The observation's path if the observation is valid.
NULL if the observation is not valid.
AwaError AwaServerObservation_Free ( AwaServerObservation **  observation)

Shut down an Observation, freeing any allocated memory.

This function should eventually be called on every operation to avoid a memory leak.

Parameters
[in,out]observationA pointer to an Observation pointer, which will be set to NULL by this function.
Returns
AwaError_Success on success
Error_OperationInvalid if the operation is not valid.
Examples:
server-observe-example.c.
AwaClientIterator* AwaServerObserveOperation_NewClientIterator ( const AwaServerObserveOperation *  operation)

Create a new Client Iterator for a performed Observe Operation, used to iterate through the list of client endpoint names retrieved by the corresponding Observe operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaClientIterator_Free. This function can only be successful after an Observe operation has been successfully processed.

Parameters
[in]operationA pointer to a performed Discover operation to iterate through.
Returns
A pointer to a new ClientIterator instance on success.
NULL on failure.
AwaPathIterator* AwaServerObserveResponse_NewPathIterator ( const AwaServerObserveResponse *  response)

Create a new Path Iterator for an Observe Response, used to iterate through the list of object, object instance and resource paths retrieved by the corresponding Observe operation.

The resulting iterator is owned by the caller and should eventually be freed with AwaPathIterator_Free. This function can only be successful after an Observe operation has been successfully processed.

Parameters
[in]responseA pointer to the Observe Response to search.
Returns
A pointer to a new PathIterator instance on success.
NULL on failure.
const AwaPathResult* AwaServerObserveResponse_GetPathResult ( const AwaServerObserveResponse *  response,
const char *  path 
)

Retrieve a path result from an Observe Response relating to a observation to that path retrieved by the corresponding Observe operation.

Querying the path result will allow the caller to determine the status of a request to observe a resource.

Parameters
[in]responseA pointer to the Observe Response to search.
[in]pathA path to a resource that was requested to be observed.
Returns
NULL if no definition exists in the Observe response for the specified path, or if the response, path or result is NULL.
Pointer to PathResult instance. Do not free.
bool AwaServerObserveResponse_ContainsPath ( const AwaServerObserveResponse *  response,
const char *  path 
)

Test if the Observe Response has the specified object, object instance or resource path present.

If the Observe Response contains paths beyond the specified path, the path will be considered present. This function can only be successful after an Observe operation has been successfully processed.

Parameters
[in]responseA pointer to a valid Observe Response.
[in]pathThe path with which to query the Observe Response.
Returns
True if the Observe Response contains the specified path.
False if the Observe Response does not contain the specified path, or if the path is invalid.
const AwaServerSession* AwaChangeSet_GetServerSession ( const AwaChangeSet changeSet)

Retrieve the corresponding session for a ChangeSet.

This function is only valid for a ChangeSet connected to a server session.

Parameters
[in]changeSetA pointer to a valid ChangeSet.
Returns
The session for the given ChangeSet.
NULL if the ChangeSet is invalid.
const char* AwaChangeSet_GetClientID ( const AwaChangeSet changeSet)

Retrieve the corresponding client ID for a ChangeSet.

This function is only valid for a ChangeSet connected to a server session.

Parameters
[in]changeSetA pointer to a valid ChangeSet.
Returns
The session for the given ChangeSet.
NULL if the ChangeSet is invalid.
AwaError AwaServerSession_SetClientRegisterEventCallback ( AwaServerSession *  session,
AwaServerClientRegisterEventCallback  callback,
void *  context 
)

Sets a callback function to be called whenever a Client registers with the server.

Any existing callback function is replaced.

The callback of type AwaServerClientRegisterEventCallback will be passed an event object and the context pointer specified here.

Parameters
[in]sessionA pointer to a valid session.
[in]callbackFunction pointer to call when a client registers with the server. Pass NULL to clear.
[in]contextA pointer to a user specified object for use in the callback.
Returns
AwaError_Success on success.
AwaError_SessionInvalid if the specified session is invalid.
Examples:
server-event-example.c.
AwaError AwaServerSession_SetClientUpdateEventCallback ( AwaServerSession *  session,
AwaServerClientUpdateEventCallback  callback,
void *  context 
)

Sets a callback function to be called whenever a Client updates its registration with the server.

Any existing callback function is replaced.

The callback of type AwaServerClientUpdateEventCallback will be passed an event object and the context pointer specified here.

Parameters
[in]sessionA pointer to a valid session.
[in]callbackFunction pointer to call when a client updates its registration with the server. Pass NULL to clear.
[in]contextA pointer to a user specified object for use in the callback.
Returns
AwaError_Success on success.
AwaError_SessionInvalid if the specified session is invalid.
Examples:
server-event-example.c.
AwaError AwaServerSession_SetClientDeregisterEventCallback ( AwaServerSession *  session,
AwaServerClientDeregisterEventCallback  callback,
void *  context 
)

Sets a callback function to be called whenever a Client deregisters with the server.

Any existing callback function is replaced.

The callback of type AwaServerClientDeregisterEventCallback will be passed an event object and the context pointer specified here.

Parameters
[in]sessionA pointer to a valid session.
[in]callbackFunction pointer to call when a client deregisters with the server. Pass NULL to clear.
[in]contextA pointer to a user specified object for use in the callback.
Returns
AwaError_Success on success.
AwaError_SessionInvalid if the specified session is invalid.
Examples:
server-event-example.c.
AwaClientIterator* AwaServerClientRegisterEvent_NewClientIterator ( const AwaServerClientRegisterEvent *  event)

Create a new Client Iterator from a Client Register Event, used to iterate through the list of client endpoint names (IDs) held by the event.

The resulting iterator is owned by the caller and should eventually be freed with AwaClientIterator_Free. This function can only be successful within a Client Register Event callback.

Parameters
[in]eventA pointer to a Client Register Event to iterate through.
Returns
A pointer to a new AwaClientIterator instance on success.
NULL on failure.
Examples:
server-event-example.c.
AwaClientIterator* AwaServerClientUpdateEvent_NewClientIterator ( const AwaServerClientUpdateEvent *  event)

Create a new Client Iterator from a Client Update Event, used to iterate through the list of client endpoint names (IDs) held by the event.

The resulting iterator is owned by the caller and should eventually be freed with AwaClientIterator_Free. This function can only be successful within a Client Update Event callback.

Parameters
[in]eventA pointer to a Client Update Event to iterate through.
Returns
A pointer to a new AwaClientIterator instance on success.
NULL on failure.
Examples:
server-event-example.c.
AwaClientIterator* AwaServerClientDeregisterEvent_NewClientIterator ( const AwaServerClientDeregisterEvent *  event)

Create a new Client Iterator from a Client Deregister Event, used to iterate through the list of client endpoint names (IDs) held by the event.

The resulting iterator is owned by the caller and should eventually be freed with AwaClientIterator_Free. This function can only be successful within a Client Deregister Event callback.

Parameters
[in]eventA pointer to a Client Register Event to iterate through.
Returns
A pointer to a new AwaClientIterator instance on success.
NULL on failure.
Examples:
server-event-example.c.
AwaRegisteredEntityIterator* AwaServerClientRegisterEvent_NewRegisteredEntityIterator ( const AwaServerClientRegisterEvent *  event,
const char *  clientID 
)

Create a new Registered Entity iterator for a Client Register Event, used to iterate through the list of objects and object instances that exist within the client the event relates to.

The resulting iterator is owned by the caller and should eventually be freed with AwaRegisteredEntityIterator_Free. This function can only be successful within a Client Register Event callback.

Parameters
[in]eventA pointer to the Client Register Event to search.
[in]clientIDThe endpoint name of the registered client to search.
Returns
A pointer to a new AwaRegisteredEntityIterator instance on success.
NULL on failure.
Examples:
server-event-example.c.
AwaRegisteredEntityIterator* AwaServerClientUpdateEvent_NewRegisteredEntityIterator ( const AwaServerClientUpdateEvent *  event,
const char *  clientID 
)

Create a new Registered Entity iterator for a Client Update Event, used to iterate through the list of objects and object instances that exist within the client the event relates to.

The resulting iterator is owned by the caller and should eventually be freed with AwaRegisteredEntityIterator_Free. This function can only be successful within a Client Update Event callback.

Parameters
[in]eventA pointer to the Client Update Event to search.
[in]clientIDThe endpoint name of the registered client to search.
Returns
A pointer to a new AwaRegisteredEntityIterator instance on success.
NULL on failure.
Examples:
server-event-example.c.