This interface enables an application to interact with the LWM2M interface provided by LWM2M Server Core. More...
#include "common.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 AwaObjectDefinition * | AwaServerSession_GetObjectDefinition (const AwaServerSession *session, AwaObjectID objectID) |
Retrieves an object definition instance corresponding to the object identified by the given object ID. More... | |
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. 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... | |
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. More... | |
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. 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... | |
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. More... | |
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. 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... | |
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. More... | |
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. 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... | |
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. More... | |
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. 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... | |
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. More... | |
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. 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... | |
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. More... | |
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. 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... | |
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. More... | |
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. 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... | |
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. More... | |
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. 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... | |
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 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!
[in] | changeSet | A pointer to a valid ChangeSet. |
[in] | context | A 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!
[in] | context | A 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!
[in] | context | A 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!
[in] | context | A pointer to user-specified data passed to AwaServerSession_SetClientDeregisterEventCallback. |
enum AwaWriteMode |
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.
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.
[in] | session | Pointer to the session that is to be configured. |
[in] | address | Specifies the IP address or hostname to use to connect with the Core. |
[in] | port | Specifies the Port number to use to connect with the Core. |
AwaError AwaServerSession_SetDefaultTimeout | ( | AwaServerSession * | session, |
AwaTimeout | timeout | ||
) |
Set IPC connect timeout.
Used internally by AwaServerSession_Connect and AwaServerSession_Disconnect.
[in] | session | Pointer to a valid server session. |
[in] | timeout | The time within which an IPC session Connect must complete to avoid timeout. It must be greater than 0. |
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.
[in] | session | Pointer to an IPC-configured session. |
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.
[in] | session | A pointer to a valid session instance. |
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.
[in] | session | Pointer to a connected session. |
[in] | objectID | Identifies the object for which the query is targeted. |
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.
[in] | session | Pointer to a connected session. |
[in] | objectID | Identifies the object for which the query is targeted. |
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.
[in] | session | Pointer to a connected session. |
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.
[in] | session | Pointer to a connected session. |
[in] | timeout | The function will wait at least as long as this value for a response. |
AwaError AwaServerSession_DispatchCallbacks | ( | AwaServerSession * | session | ) |
Invoke any callbacks scheduled since this function was last called.
[in] | session | Pointer to a connected session. |
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.
[in] | session | Pointer to a connected session. |
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.
[in,out] | session | A pointer to a session pointer that will be set to NULL. |
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.
[in] | session | Pointer to a valid session. |
[in] | path | Resource path to convert. |
[out] | objectID | Pointer to Object ID for result, or NULL to ignore. |
[out] | objectInstanceID | Pointer to Object Instance ID for result, or NULL to ignore. |
[out] | resourceID | Pointer to Resource ID for result, or NULL to ignore. |
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.
[in] | session | A pointer to a valid session. |
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.
[in] | operation | The List Clients operation to process. |
[in] | timeout | The function will wait at least as long as this value for a response. |
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.
[in] | operation | The processed List Clients operation to obtain the List Clients response from. |
[in] | clientID | The endpoint name of the connected client to search. |
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.
[in] | response | A pointer to the List Clients response to search. |
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.
[in,out] | operation | A pointer to a List Clients operation pointer that will be set to NULL. |
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.
[in] | iterator | A pointer to a valid Client Iterator. |
const char* AwaClientIterator_GetClientID | ( | const AwaClientIterator * | iterator | ) |
Retrieve the ID from the current client in the Client Iterator.
[in] | iterator | A pointer to a valid Client Iterator. |
void AwaClientIterator_Free | ( | AwaClientIterator ** | iterator | ) |
Clean up a Client Iterator, freeing all allocated resources.
Once freed, the iterator is no longer valid.
[in,out] | iterator | A pointer to a Client Iterator pointer that will be set to NULL. |
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.
[in] | operation | A pointer to a performed List Clients operation to iterate through |
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.
[in] | iterator | A pointer to a valid Registered Entity Iterator. |
const char* AwaRegisteredEntityIterator_GetPath | ( | const AwaRegisteredEntityIterator * | iterator | ) |
Retrieve the path to the current registered entity in the Registered Entity Iterator.
[in] | iterator | A pointer to a valid Registered Entity Iterator. |
void AwaRegisteredEntityIterator_Free | ( | AwaRegisteredEntityIterator ** | iterator | ) |
Clean up a Registered Entity Iterator, freeing all allocated resources.
Once freed, the iterator is no longer valid.
[in,out] | iterator | A pointer to a Registered Entity Iterator pointer that will be set to NULL. |
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.
[in] | session | A pointer to a valid session. |
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.
[in] | operation | Pointer to a valid Define operation. |
[in] | objectDefinition | Pointer to a valid Object Definition. |
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.
[in,out] | operation | A pointer to a Define operation pointer that will be set to NULL. |
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.
[in] | operation | The processed Server Define operation to obtain the Server Define response from. |
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.
[in] | response | A pointer to the Define Response to search. |
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.
[in] | response | A pointer to the Define Response to search. |
[in] | path | A path to an entity that was requested to be defined. |
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.
[in] | response | A pointer to a valid Define Response. |
[in] | path | The path with which to query the Define Response. |
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.
[in] | session | A pointer to a valid session. |
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.
[in] | operation | The Read operation to add the path of interest to. |
[in] | clientID | The name of the client to query |
[in] | path | The path of the resource, object instance or object requested for retrieval. |
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.
[in] | operation | The Read operation to process. |
[in] | timeout | The function will wait at least as long as this value for a response. |
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.
[in,out] | operation | A pointer to a Read operation pointer that will be set to NULL. |
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.
[in] | operation | A pointer to a performed Read operation to iterate through |
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.
[in] | operation | The processed Read operation to obtain the Read response from. |
[in] | clientID | The endpoint name of the client to retrieve read values from. |
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.
[in] | response | A pointer to the Read Response to search. |
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.
[in] | response | A pointer to the Read Response to search. |
[in] | path | A path to an entity that was requested to be read from. |
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.
[in] | response | A pointer to a valid Read Response. |
[in] | path | The path with which to query the Read Response. |
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.
[in] | response | A pointer to a valid Read Response. |
[in] | path | The path with which to query the Read Response. |
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.
[in] | response | The current Read Response to retrieve the value from. |
[in] | path | The path of the opaque resource requested for retrieval. |
[in,out] | value | A pointer to a AwaOpaque struct that will be modified to refer to the requested opaque value. |
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.
[in] | response | The current Read Response to retrieve the value from. |
[in] | path | The path of the object link resource requested for retrieval. |
[in,out] | value | A pointer to a AwaObjectLink struct that will be modified to hold the requested object link value. |
const char* AwaWriteMode_ToString | ( | AwaWriteMode | writeMode | ) |
Get a descriptive name for the specified Write Mode.
[in] | writeMode | Write Mode |
AwaWriteMode AwaWriteMode_FromString | ( | const char * | writeModeString | ) |
Get a Write Mode from a descriptive name of a Write Mode.
[in] | writeModeString | A Write Mode in string form |
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.
[in] | session | A pointer to a valid session. |
[in] | defaultMode | The default write mode to use; either AwaWriteMode_Replace, or AwaWriteMode_Update. |
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.
[in] | operation | The Write Operation to add the path of interest to. |
[in] | path | The path of the object or object instance requested for object instance creation. |
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.
[in] | operation | The Write Operation to add the path of interest to. |
[in] | path | The path of object instance to modify for a corresponding write. |
[in] | mode | The write mode to use; either AwaWriteMode_Replace, or AwaWriteMode_Update. |
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.
[in] | operation | The Write Operation to add the path of interest to. |
[in] | path | The path of object instance to modify for a corresponding write. |
[in] | mode | The write mode to use; either AwaWriteMode_Replace, or AwaWriteMode_Update. |
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.
[in] | operation | The Write Operation to process. |
[in] | clientID | The name of the client to perform the Write Operation |
[in] | timeout | The function will wait at least as long as this value for a response. |
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.
[in] | operation | The processed Write Operation to obtain the Write response from. |
[in] | clientID | The endpoint name of the connected client to search. |
AwaError AwaServerWriteOperation_Free | ( | AwaServerWriteOperation ** | operation | ) |
Clean up a Write Operation, freeing all allocated resources.
Once freed, the operation is no longer valid.
[in,out] | operation | A pointer to a Write Operation pointer that will be set to NULL. |
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.
[in] | operation | A pointer to a performed Write Operation to iterate through |
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.
[in] | response | A pointer to the Write Response to search. |
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.
[in] | response | A pointer to the Write Response to search. |
[in] | path | A path to an entity that was written to. |
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.
[in] | response | A pointer to a valid Write Response. |
[in] | path | The path with which to query the Write Response. |
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.
[in] | session | A pointer to a valid session instance. |
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.
[in] | operation | A pointer to a valid delete operation. |
[in] | clientID | The endpoint name of the connected client to request resources to be deleted. |
[in] | path | The path of the resource, resource instance or object instance requested to delete. |
AwaError AwaServerDeleteOperation_Perform | ( | AwaServerDeleteOperation * | operation, |
AwaTimeout | timeout | ||
) |
Process the Delete operation by sending it to the Core.
[in] | operation | The Delete operation to process. |
[in] | timeout | The function will wait at least as long as this value for a response. |
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.
[in] | operation | The processed Delete operation to obtain the Delete response from. |
[in] | clientID | The endpoint name of the connected client to search. |
AwaError AwaServerDeleteOperation_Free | ( | AwaServerDeleteOperation ** | operation | ) |
Clean up a Delete operation, freeing all allocated resources.
Once freed, the operation is no longer valid.
[in,out] | operation | A pointer to a Delete operation pointer that will be set to NULL. |
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.
[in] | operation | A pointer to a performed Delete Operation to iterate through. |
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.
[in] | response | A pointer to the Delete Response to search. |
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.
[in] | response | A pointer to the Delete Response to search. |
[in] | path | A path to an entity that was requested to be deleted. |
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.
[in] | response | A pointer to a valid Delete Response. |
[in] | path | The path with which to query the Delete Response. |
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.
[in] | session | A pointer to a valid session. |
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.
[in] | operation | A pointer to a valid Execute operation. |
[in] | clientID | The endpoint name of the connected client to execute upon. |
[in] | path | The path of the resource, resource instance or object instance requested to execute. |
[in] | arguments | Execute arguments, or NULL to execute the resource without arguments. |
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.
[in] | operation | The Execute operation to process. |
[in] | timeout | The function will wait at least as long as this value for a response. |
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.
[in] | operation | The processed Execute operation to obtain the Execute response from. |
[in] | clientID | The endpoint name of the connected client to search. |
AwaError AwaServerExecuteOperation_Free | ( | AwaServerExecuteOperation ** | operation | ) |
Clean up an Execute operation, freeing all allocated resources.
Once freed, the operation is no longer valid.
[in,out] | operation | A pointer to an Execute operation pointer that will be set to NULL. |
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.
[in] | operation | A pointer to a performed Execute operation to iterate through |
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.
[in] | response | A pointer to the Execute Response to search. |
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.
[in] | response | A pointer to the Execute Response to search. |
[in] | path | A path to a resource that was requested to be executed. |
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.
[in] | response | A pointer to a valid Execute Response. |
[in] | path | The path with which to query the Execute Response. |
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:
[in] | session | A pointer to a valid session. |
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.
[in] | operation | The Write Attributes operation to process. |
[in] | timeout | The function will wait at least as long as this value for a response. |
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.
[in] | operation | The processed Write Attributes operation to obtain the Write Attributes response from. |
[in] | clientID | The endpoint name of the connected client to search. |
AwaError AwaServerWriteAttributesOperation_Free | ( | AwaServerWriteAttributesOperation ** | operation | ) |
Clean up a Write Attributes operation, freeing all allocated resources.
Once freed, the operation is no longer valid.
[in,out] | operation | A pointer to a Write Attributes operation pointer that will be set to NULL. |
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.
[in] | operation | A pointer to a performed Write Attributes operation to iterate through |
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.
[in] | response | A pointer to the Write Attributes Response to search. |
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.
[in] | response | A pointer to the Write Attributes Response to search. |
[in] | path | A path to an entity that had attributes written to. |
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.
[in] | response | A pointer to a valid Write Attributes Response. |
[in] | path | The path with which to query the Write Attributes Response. |
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.
[in] | session | A pointer to a valid session. |
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.
[in] | operation | A pointer to a valid Discover operation. |
[in] | clientID | The endpoint name of the client to discover entities. |
[in] | path | The path of the resource, resource instance or object instance requested to discover. |
AwaError AwaServerDiscoverOperation_Perform | ( | AwaServerDiscoverOperation * | operation, |
AwaTimeout | timeout | ||
) |
Process the Discover operation by sending it to the Core.
[in] | operation | The Discover operation to process. |
[in] | timeout | The function will wait at least as long as this value for a response. |
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.
[in] | operation | The processed Discover operation to obtain the Discover response from. |
[in] | clientID | The endpoint name of the connected client to perform the discover operation upon. |
AwaError AwaServerDiscoverOperation_Free | ( | AwaServerDiscoverOperation ** | operation | ) |
Clean up a Discover operation, freeing all allocated resources.
Once freed, the operation is no longer valid.
[in,out] | operation | A pointer to a Discover operation pointer that will be set to NULL. |
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.
[in] | operation | A pointer to a performed Discover operation to iterate through. |
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.
[in] | response | A pointer to the Discover Response to search. |
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.
[in] | response | A pointer to the Discover Response to search. |
[in] | path | A path to an entity that had attributes written to. |
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.
[in] | response | A pointer to a valid Discover Response. |
[in] | path | The path with which to query the Discover Response. |
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.
[in] | response | A pointer to the Discover Response to search. |
[in] | path | The path to an entity to explore discovered attributes. |
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.
[in] | iterator | A pointer to a valid Attribute Iterator. |
const char* AwaAttributeIterator_GetLink | ( | const AwaAttributeIterator * | iterator | ) |
Retrieve the link name associated with the current attribute in the Attribute Iterator.
[in] | iterator | A pointer to a valid Attribute Iterator. |
void AwaAttributeIterator_Free | ( | AwaAttributeIterator ** | iterator | ) |
Clean up a Attribute Iterator, freeing all allocated resources.
Once freed, the iterator is no longer valid.
[in,out] | iterator | A 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.
[in] | session | A pointer to a valid session. |
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.
[in] | operation | The Observe operation to add the path of interest to. |
[in] | observation | A valid Change observation to an entity of interest. |
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.
[in] | operation | The Observe operation to add the path of interest to. |
[in] | observation | A valid Change observation to an entity of interest. |
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.
[in] | operation | The Observe operation to process. |
[in] | timeout | The function will wait at least as long as this value for a response. |
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.
[in] | operation | The processed Observe operation to obtain the Observe response from. |
[in] | clientID | The endpoint name of the connected client to process an observe response from. |
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.
[in,out] | operation | A pointer to an Observe operation pointer that will be set to NULL. |
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.
[in] | clientID | The endpoint name of the connected client intended to begin or cancel observations upon. |
[in] | path | The path of the resource, object instance or object to observe. |
[in] | callback | Pointer to function to call when the entity specified by path is created, changed or deleted. |
[in] | context | A pointer to a user specified object for use in the change callback |
const char* AwaServerObservation_GetPath | ( | AwaServerObservation * | observation | ) |
Retrieve the path from an Observation.
[in] | observation | A valid Observation. |
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.
[in,out] | observation | A pointer to an Observation pointer, which will be set to NULL by this function. |
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.
[in] | operation | A pointer to a performed Discover operation to iterate through. |
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.
[in] | response | A pointer to the Observe Response to search. |
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.
[in] | response | A pointer to the Observe Response to search. |
[in] | path | A path to a resource that was requested to be observed. |
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.
[in] | response | A pointer to a valid Observe Response. |
[in] | path | The path with which to query the Observe Response. |
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.
[in] | changeSet | A pointer to a valid ChangeSet. |
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.
[in] | changeSet | A pointer to a valid ChangeSet. |
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.
[in] | session | A pointer to a valid session. |
[in] | callback | Function pointer to call when a client registers with the server. Pass NULL to clear. |
[in] | context | A pointer to a user specified object for use in the callback. |
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.
[in] | session | A pointer to a valid session. |
[in] | callback | Function pointer to call when a client updates its registration with the server. Pass NULL to clear. |
[in] | context | A pointer to a user specified object for use in the callback. |
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.
[in] | session | A pointer to a valid session. |
[in] | callback | Function pointer to call when a client deregisters with the server. Pass NULL to clear. |
[in] | context | A pointer to a user specified object for use in the callback. |
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.
[in] | event | A pointer to a Client Register Event to iterate through. |
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.
[in] | event | A pointer to a Client Update Event to iterate through. |
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.
[in] | event | A pointer to a Client Register Event to iterate through. |
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.
[in] | event | A pointer to the Client Register Event to search. |
[in] | clientID | The endpoint name of the registered client to search. |
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.
[in] | event | A pointer to the Client Update Event to search. |
[in] | clientID | The endpoint name of the registered client to search. |