Awa LWM2M C API (0.2.5)  
client.h
Go to the documentation of this file.
1 /************************************************************************************************************************
2  Copyright (c) 2016, Imagination Technologies Limited and/or its affiliated group companies.
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
6  following conditions are met:
7  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
8  following disclaimer.
9  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
10  following disclaimer in the documentation and/or other materials provided with the distribution.
11  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
12  products derived from this software without specific prior written permission.
13 
14  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
15  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
18  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
19  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
20  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 ************************************************************************************************************************/
22 
23 
41 #ifndef AWA_CLIENT_H
42 #define AWA_CLIENT_H
43 
44 // @cond
45 #include <stdint.h>
46 #include <stdbool.h>
47 #include <stddef.h>
48 // @endcond
49 
50 #include "common.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 /**************************************************************************************************
57  * Example Usage
58  *************************************************************************************************/
59 
88 /**************************************************************************************************
89  * Public Types and Enumerations
90  *************************************************************************************************/
91 
93 typedef struct _AwaClientSession AwaClientSession;
94 typedef struct _AwaClientGetOperation AwaClientGetOperation;
95 typedef struct _AwaClientGetResponse AwaClientGetResponse;
96 typedef struct _AwaClientDefineOperation AwaClientDefineOperation;
97 typedef struct _AwaClientSetOperation AwaClientSetOperation;
98 typedef struct _AwaClientSetResponse AwaClientSetResponse;
99 typedef struct _AwaClientDeleteOperation AwaClientDeleteOperation;
100 typedef struct _AwaClientDeleteResponse AwaClientDeleteResponse;
101 typedef struct _AwaClientSubscribeOperation AwaClientSubscribeOperation;
102 typedef struct _AwaClientSubscribeResponse AwaClientSubscribeResponse;
103 typedef struct _AwaClientSubscription AwaClientChangeSubscription;
104 typedef struct _AwaClientSubscription AwaClientExecuteSubscription;
106 
107 /**************************************************************************************************
108  * Callbacks
109  *************************************************************************************************/
110 
119 typedef void (*AwaClientSubscribeToChangeCallback)(const AwaChangeSet * changeSet, void * context);
120 
129 typedef void (*AwaClientSubscribeToExecuteCallback)(const AwaExecuteArguments * arguments, void * context);
130 
131 
132 /**************************************************************************************************
133  * Session Management
134  *************************************************************************************************/
135 
145 AwaClientSession * AwaClientSession_New(void);
146 
158 AwaError AwaClientSession_SetIPCAsUDP(AwaClientSession * session, const char * address, uint16_t port);
159 
160 // Not yet implemented:
161 //AwaError AwaClientSession_SetIPCAsLocal(AwaClientSession * session);
162 //AwaError AwaClientSession_SetIPCAsMQTT(AwaClientSession * session /* ... */);
163 //AwaError AwaClientSession_SetIPCAsUbus(AwaClientSession * session /* ... */);
164 //AwaError AwaClientSession_SetIPCAsNanoMsg(AwaClientSession * session /* ... */);
165 
175 AwaError AwaClientSession_SetDefaultTimeout(AwaClientSession * session, AwaTimeout timeout);
176 
184 AwaError AwaClientSession_Connect(AwaClientSession * session);
185 
199 AwaError AwaClientSession_Refresh(AwaClientSession * session);
200 
211 bool AwaClientSession_IsObjectDefined(const AwaClientSession * session, AwaObjectID objectID);
212 
221 const AwaObjectDefinition * AwaClientSession_GetObjectDefinition(const AwaClientSession * session, AwaObjectID objectID);
222 
232 
241 AwaError AwaClientSession_Process(AwaClientSession * session, AwaTimeout timeout);
242 
249 AwaError AwaClientSession_DispatchCallbacks(AwaClientSession * session);
250 
263 AwaError AwaClientSession_Disconnect(AwaClientSession * session);
264 
273 AwaError AwaClientSession_Free(AwaClientSession ** session);
274 
287 AwaError AwaClientSession_PathToIDs(const AwaClientSession * session, const char * path, AwaObjectID * objectID, AwaObjectInstanceID * objectInstanceID, AwaResourceID * resourceID);
288 
289 
290 /**************************************************************************************************
291  * Object & Resource Definition Operation
292  *************************************************************************************************/
293 
313 AwaClientDefineOperation * AwaClientDefineOperation_New(const AwaClientSession * session);
314 
330 AwaError AwaClientDefineOperation_Add(AwaClientDefineOperation * operation, const AwaObjectDefinition * objectDefinition);
331 
332 /*
333  * @brief Process the Define operation by sending it to the Core.
334  * If successful, the object definition is also added to the session.
335  * @param[in] operation The Define operation to process.
336  * @param[in] timeout The function will wait at least as long as this value for a response.
337  * @return AwaError_Success on success.
338  * @return AwaError_Timeout if no response is received after the timeout duration expires.
339  * @return Various errors on failure.
340  */
341 AwaError AwaClientDefineOperation_Perform(AwaClientDefineOperation * operation, AwaTimeout timeout);
342 
350 AwaError AwaClientDefineOperation_Free(AwaClientDefineOperation ** operation);
351 
352 
353 
354 /**************************************************************************************************
355  * Object & Resource Retrieval Operation
356  *************************************************************************************************/
357 
370 AwaClientGetOperation * AwaClientGetOperation_New(const AwaClientSession * session);
371 
388 AwaError AwaClientGetOperation_AddPath(AwaClientGetOperation * operation, const char * path);
389 
404 AwaError AwaClientGetOperation_AddPathWithArrayRange(AwaClientGetOperation * operation, const char * path, AwaArrayIndex startIndex, AwaArrayLength indexCount);
405 
416 AwaError AwaClientGetOperation_Perform(AwaClientGetOperation * operation, AwaTimeout timeout);
417 
427 AwaError AwaClientGetOperation_Free(AwaClientGetOperation ** operation);
428 
439 const AwaClientGetResponse * AwaClientGetOperation_GetResponse(const AwaClientGetOperation * operation);
440 
450 AwaPathIterator * AwaClientGetResponse_NewPathIterator(const AwaClientGetResponse * response);
451 
461 bool AwaClientGetResponse_ContainsPath(const AwaClientGetResponse * response, const char * path);
462 
473 const AwaPathResult * AwaClientGetResponse_GetPathResult(const AwaClientGetResponse * response, const char * path);
474 
485 bool AwaClientGetResponse_HasValue(const AwaClientGetResponse * response, const char * path);
486 
504 AwaError AwaClientGetResponse_GetValueAsCStringPointer (const AwaClientGetResponse * response, const char * path, const char ** value);
505 AwaError AwaClientGetResponse_GetValueAsIntegerPointer (const AwaClientGetResponse * response, const char * path, const AwaInteger ** value);
506 AwaError AwaClientGetResponse_GetValueAsFloatPointer (const AwaClientGetResponse * response, const char * path, const AwaFloat ** value);
507 AwaError AwaClientGetResponse_GetValueAsBooleanPointer (const AwaClientGetResponse * response, const char * path, const AwaBoolean ** value);
508 AwaError AwaClientGetResponse_GetValueAsTimePointer (const AwaClientGetResponse * response, const char * path, const AwaTime ** value);
509 AwaError AwaClientGetResponse_GetValueAsObjectLinkPointer(const AwaClientGetResponse * response, const char * path, const AwaObjectLink ** value);
510 AwaError AwaClientGetResponse_GetValueAsOpaquePointer (const AwaClientGetResponse * response, const char * path, const AwaOpaque ** value);
528 AwaError AwaClientGetResponse_GetValueAsOpaque(const AwaClientGetResponse * response, const char * path, AwaOpaque * value);
529 
543 AwaError AwaClientGetResponse_GetValueAsObjectLink(const AwaClientGetResponse * response, const char * path, AwaObjectLink * value);
544 
562 AwaError AwaClientGetResponse_GetValuesAsStringArrayPointer (const AwaClientGetResponse * response, const char * path, const AwaStringArray ** valueArray);
563 AwaError AwaClientGetResponse_GetValuesAsIntegerArrayPointer (const AwaClientGetResponse * response, const char * path, const AwaIntegerArray ** valueArray);
564 AwaError AwaClientGetResponse_GetValuesAsFloatArrayPointer (const AwaClientGetResponse * response, const char * path, const AwaFloatArray ** valueArray);
565 AwaError AwaClientGetResponse_GetValuesAsBooleanArrayPointer (const AwaClientGetResponse * response, const char * path, const AwaBooleanArray ** valueArray);
566 AwaError AwaClientGetResponse_GetValuesAsTimeArrayPointer (const AwaClientGetResponse * response, const char * path, const AwaTimeArray ** valueArray);
567 AwaError AwaClientGetResponse_GetValuesAsOpaqueArrayPointer (const AwaClientGetResponse * response, const char * path, const AwaOpaqueArray ** valueArray);
568 AwaError AwaClientGetResponse_GetValuesAsObjectLinkArrayPointer(const AwaClientGetResponse * response, const char * path, const AwaObjectLinkArray ** valueArray);
572 /**************************************************************************************************
573  * Object & Resource Value Setting Operation
574  *************************************************************************************************/
575 
587 AwaClientSetOperation * AwaClientSetOperation_New(const AwaClientSession * session);
588 
603 AwaError AwaClientSetOperation_CreateObjectInstance(AwaClientSetOperation * operation, const char * path);
604 
615 AwaError AwaClientSetOperation_CreateOptionalResource(AwaClientSetOperation * operation, const char * path);
616 
631 AwaError AwaClientSetOperation_AddValueAsCString (AwaClientSetOperation * operation, const char * path, const char * value);
632 AwaError AwaClientSetOperation_AddValueAsInteger (AwaClientSetOperation * operation, const char * path, AwaInteger value);
633 AwaError AwaClientSetOperation_AddValueAsFloat (AwaClientSetOperation * operation, const char * path, AwaFloat value);
634 AwaError AwaClientSetOperation_AddValueAsBoolean (AwaClientSetOperation * operation, const char * path, AwaBoolean value);
635 AwaError AwaClientSetOperation_AddValueAsTime (AwaClientSetOperation * operation, const char * path, AwaTime value);
636 AwaError AwaClientSetOperation_AddValueAsOpaque (AwaClientSetOperation * operation, const char * path, AwaOpaque value);
637 AwaError AwaClientSetOperation_AddValueAsObjectLink(AwaClientSetOperation * operation, const char * path, AwaObjectLink value);
655 AwaError AwaClientSetOperation_AddValueAsStringArray (AwaClientSetOperation * operation, const char * path, const AwaStringArray * array);
656 AwaError AwaClientSetOperation_AddValueAsIntegerArray (AwaClientSetOperation * operation, const char * path, const AwaIntegerArray * array);
657 AwaError AwaClientSetOperation_AddValueAsFloatArray (AwaClientSetOperation * operation, const char * path, const AwaFloatArray * array);
658 AwaError AwaClientSetOperation_AddValueAsBooleanArray (AwaClientSetOperation * operation, const char * path, const AwaBooleanArray * array);
659 AwaError AwaClientSetOperation_AddValueAsTimeArray (AwaClientSetOperation * operation, const char * path, const AwaTimeArray * array);
660 AwaError AwaClientSetOperation_AddValueAsOpaqueArray (AwaClientSetOperation * operation, const char * path, const AwaOpaqueArray * array);
661 AwaError AwaClientSetOperation_AddValueAsObjectLinkArray(AwaClientSetOperation * operation, const char * path, const AwaObjectLinkArray * array);
682 AwaError AwaClientSetOperation_AddArrayValueAsCString (AwaClientSetOperation * operation, const char * path, int resourceInstanceID, const char * value);
683 AwaError AwaClientSetOperation_AddArrayValueAsInteger (AwaClientSetOperation * operation, const char * path, int resourceInstanceID, AwaInteger value);
684 AwaError AwaClientSetOperation_AddArrayValueAsFloat (AwaClientSetOperation * operation, const char * path, int resourceInstanceID, AwaFloat value);
685 AwaError AwaClientSetOperation_AddArrayValueAsBoolean (AwaClientSetOperation * operation, const char * path, int resourceInstanceID, AwaBoolean value);
686 AwaError AwaClientSetOperation_AddArrayValueAsTime (AwaClientSetOperation * operation, const char * path, int resourceInstanceID, AwaTime value);
687 AwaError AwaClientSetOperation_AddArrayValueAsOpaque (AwaClientSetOperation * operation, const char * path, int resourceInstanceID, AwaOpaque value);
688 AwaError AwaClientSetOperation_AddArrayValueAsObjectLink(AwaClientSetOperation * operation, const char * path, int resourceInstanceID, AwaObjectLink value);
699 AwaError AwaClientSetOperation_Perform(AwaClientSetOperation * operation, AwaTimeout timeout);
700 
709 const AwaClientSetResponse * AwaClientSetOperation_GetResponse(const AwaClientSetOperation * operation);
710 
718 AwaError AwaClientSetOperation_Free(AwaClientSetOperation ** operation);
719 
729 AwaPathIterator * AwaClientSetResponse_NewPathIterator(const AwaClientSetResponse * response);
730 
741 const AwaPathResult * AwaClientSetResponse_GetPathResult(const AwaClientSetResponse * response, const char * path);
742 
751 bool AwaClientSetResponse_ContainsPath(const AwaClientSetResponse * response, const char * path);
752 
753 
754 /**************************************************************************************************
755  * Object Instance & Resource Deletion Operation
756  *************************************************************************************************/
757 
764 AwaClientDeleteOperation * AwaClientDeleteOperation_New(const AwaClientSession * session);
765 
775 AwaError AwaClientDeleteOperation_AddPath(AwaClientDeleteOperation * operation, const char * path);
776 
789 AwaError AwaClientDeleteOperation_AddPathWithArrayRange(AwaClientDeleteOperation * operation, const char * path, AwaArrayIndex startIndex, AwaArrayLength indexCount);
790 
800 AwaError AwaClientDeleteOperation_Perform(AwaClientDeleteOperation * operation, AwaTimeout timeout);
801 
810 const AwaClientDeleteResponse * AwaClientDeleteOperation_GetResponse(const AwaClientDeleteOperation * operation);
811 
820 AwaError AwaClientDeleteOperation_Free(AwaClientDeleteOperation ** operation);
821 
831 AwaPathIterator * AwaClientDeleteResponse_NewPathIterator(const AwaClientDeleteResponse * response);
832 
843 const AwaPathResult * AwaClientDeleteResponse_GetPathResult(const AwaClientDeleteResponse * response, const char * path);
844 
854 bool AwaClientDeleteResponse_ContainsPath(const AwaClientDeleteResponse * response, const char * path);
855 
856 
857 /**************************************************************************************************
858  * Subscription Procedures
859  *************************************************************************************************/
860 
874 AwaClientSubscribeOperation * AwaClientSubscribeOperation_New(const AwaClientSession * session);
875 
885 AwaError AwaClientSubscribeOperation_AddChangeSubscription(AwaClientSubscribeOperation * operation, AwaClientChangeSubscription * subscription);
886 
896 AwaError AwaClientSubscribeOperation_AddExecuteSubscription(AwaClientSubscribeOperation * operation, AwaClientExecuteSubscription * subscription);
897 
907 AwaError AwaClientSubscribeOperation_AddCancelChangeSubscription(AwaClientSubscribeOperation * operation, AwaClientChangeSubscription * subscription);
908 
918 AwaError AwaClientSubscribeOperation_AddCancelExecuteSubscription(AwaClientSubscribeOperation * operation, AwaClientExecuteSubscription * subscription);
919 
932 AwaError AwaClientSubscribeOperation_Perform(AwaClientSubscribeOperation * operation, AwaTimeout timeout);
933 
944 const AwaClientSubscribeResponse * AwaClientSubscribeOperation_GetResponse(const AwaClientSubscribeOperation * operation);
945 
954 AwaError AwaClientSubscribeOperation_Free(AwaClientSubscribeOperation ** operation); // caller must keep subscription valid during entire observe operation
955 
965 AwaPathIterator * AwaClientSubscribeResponse_NewPathIterator(const AwaClientSubscribeResponse * response);
966 
976 const AwaPathResult * AwaClientSubscribeResponse_GetPathResult(const AwaClientSubscribeResponse * response, const char * path);
977 
992 AwaClientChangeSubscription * AwaClientChangeSubscription_New(const char * path, AwaClientSubscribeToChangeCallback callback, void * context);
993 
1000 const char * AwaClientChangeSubscription_GetPath(AwaClientChangeSubscription * subscription);
1001 
1009 AwaError AwaClientChangeSubscription_Free(AwaClientChangeSubscription ** subscription);
1010 
1025 AwaClientExecuteSubscription * AwaClientExecuteSubscription_New(const char * path, AwaClientSubscribeToExecuteCallback callback, void * context);
1026 
1033 const char * AwaClientExecuteSubscription_GetPath(AwaClientExecuteSubscription * subscription);
1034 
1042 AwaError AwaClientExecuteSubscription_Free(AwaClientExecuteSubscription ** subscription);
1043 
1044 
1045 /**************************************************************************************************
1046  * ChangeSet Functions for Change Subscriptions
1047  *************************************************************************************************/
1048 
1056 const AwaClientSession * AwaChangeSet_GetClientSession(const AwaChangeSet * changeSet);
1057 
1058 #ifdef __cplusplus
1059 }
1060 #endif
1061 
1062 #endif // AWA_CLIENT_H
AwaError
API Error Codes.
Definition: error.h:38
struct _AwaPathResult AwaPathResult
Definition: common.h:710
AwaError AwaClientGetResponse_GetValueAsObjectLinkPointer(const AwaClientGetResponse *response, const char *path, const AwaObjectLink **value)
AwaError AwaClientSetOperation_AddArrayValueAsFloat(AwaClientSetOperation *operation, const char *path, int resourceInstanceID, AwaFloat value)
const AwaObjectDefinition * AwaClientSession_GetObjectDefinition(const AwaClientSession *session, AwaObjectID objectID)
Retrieves an object definition instance corresponding to the object identified by the given object ID...
AwaError AwaClientGetResponse_GetValuesAsFloatArrayPointer(const AwaClientGetResponse *response, const char *path, const AwaFloatArray **valueArray)
AwaClientChangeSubscription * AwaClientChangeSubscription_New(const char *path, AwaClientSubscribeToChangeCallback callback, void *context)
Allocate and return a pointer to a new Change Subscription, that can be used to subscribe to changes ...
AwaClientDeleteOperation * AwaClientDeleteOperation_New(const AwaClientSession *session)
Allocate and return a pointer to a new Delete operation, that can be used to delete optional resource...
int AwaTimeout
Represents a timeout value, in milliseconds.
Definition: common.h:70
AwaError AwaClientSetOperation_CreateOptionalResource(AwaClientSetOperation *operation, const char *path)
Adds a resource path to a Set Operation, as a request to create an optional Resource.
bool AwaClientSession_IsObjectDefined(const AwaClientSession *session, AwaObjectID objectID)
Determines whether the specified session holds a valid definition for the given object.
struct _AwaBooleanArray AwaBooleanArray
Definition: common.h:100
AwaError AwaClientSession_Disconnect(AwaClientSession *session)
When a session is no longer required, or if the application intends to sleep for some time...
AwaError AwaClientGetResponse_GetValueAsObjectLink(const AwaClientGetResponse *response, const char *path, AwaObjectLink *value)
Retrieve an object link resource&#39;s value from a Get Response.
AwaError AwaClientGetResponse_GetValuesAsTimeArrayPointer(const AwaClientGetResponse *response, const char *path, const AwaTimeArray **valueArray)
AwaError AwaClientGetResponse_GetValueAsCStringPointer(const AwaClientGetResponse *response, const char *path, const char **value)
AwaError AwaClientGetResponse_GetValueAsBooleanPointer(const AwaClientGetResponse *response, const char *path, const AwaBoolean **value)
struct _AwaIntegerArray AwaIntegerArray
Definition: common.h:98
AwaError AwaClientSetOperation_Perform(AwaClientSetOperation *operation, AwaTimeout timeout)
Process the Set Operation by sending it to the Core.
AwaPathIterator * AwaClientGetResponse_NewPathIterator(const AwaClientGetResponse *response)
Create a new Path Iterator for a Get Response, used to iterate through the list of resource paths ret...
AwaError AwaClientSetOperation_AddValueAsTime(AwaClientSetOperation *operation, const char *path, AwaTime value)
AwaError AwaClientDeleteOperation_Free(AwaClientDeleteOperation **operation)
Shut down an existing operation, freeing any allocated memory.
AwaError AwaClientGetOperation_AddPathWithArrayRange(AwaClientGetOperation *operation, const char *path, AwaArrayIndex startIndex, AwaArrayLength indexCount)
Add a resource path to a multiple-instance resource and specify a range of resource instances to retr...
size_t AwaArrayLength
Represents a multiple-instance array length value.
Definition: common.h:94
void(* AwaClientSubscribeToChangeCallback)(const AwaChangeSet *changeSet, void *context)
A user-specified callback handler for a Change Subscription which will be fired on AwaClientSession_D...
Definition: client.h:119
AwaError AwaClientSetOperation_AddArrayValueAsObjectLink(AwaClientSetOperation *operation, const char *path, int resourceInstanceID, AwaObjectLink value)
AwaClientDefineOperation * AwaClientDefineOperation_New(const AwaClientSession *session)
Allocate and return a pointer to a new Define operation, that can be used to define Objects and Resou...
struct _AwaFloatArray AwaFloatArray
Definition: common.h:99
AwaError AwaClientDefineOperation_Add(AwaClientDefineOperation *operation, const AwaObjectDefinition *objectDefinition)
Add an Object Definition to an existing Define operation, so that the client will create a suitable d...
const AwaPathResult * AwaClientSubscribeResponse_GetPathResult(const AwaClientSubscribeResponse *response, const char *path)
Retrieve a path result from a Subscribe Response relating to a subscription to that path retrieved by...
AwaError AwaClientSetOperation_AddArrayValueAsCString(AwaClientSetOperation *operation, const char *path, int resourceInstanceID, const char *value)
struct _AwaOpaqueArray AwaOpaqueArray
Definition: common.h:101
AwaError AwaClientSubscribeOperation_Perform(AwaClientSubscribeOperation *operation, AwaTimeout timeout)
Process the Subscribe operation by sending it to the Core, notifying the Core to begin or cancel subs...
AwaPathIterator * AwaClientSetResponse_NewPathIterator(const AwaClientSetResponse *response)
Create a new Path Iterator for a Set Response, used to iterate through the list of paths returned in ...
AwaClientGetOperation * AwaClientGetOperation_New(const AwaClientSession *session)
Allocate and return a pointer to a new Get operation, that can be used to retrieve resource values fr...
AwaError AwaClientSession_Connect(AwaClientSession *session)
Connect a session (configured with an IPC mechanism) to the Core.
bool AwaClientGetResponse_ContainsPath(const AwaClientGetResponse *response, const char *path)
Test if the Get Response has the specified path (resource, object instance or object) present...
AwaError AwaClientSetOperation_AddArrayValueAsInteger(AwaClientSetOperation *operation, const char *path, int resourceInstanceID, AwaInteger value)
bool AwaBoolean
Corresponds to the LWM2M Boolean type.
Definition: types.h:71
AwaClientSetOperation * AwaClientSetOperation_New(const AwaClientSession *session)
Allocate and return a pointer to a new Set Operation, that can be used to set resource values...
AwaError AwaClientGetResponse_GetValueAsOpaque(const AwaClientGetResponse *response, const char *path, AwaOpaque *value)
Retrieve an opaque resource&#39;s value from a Get Response.
AwaPathIterator * AwaClientDeleteResponse_NewPathIterator(const AwaClientDeleteResponse *response)
Create a new Path Iterator for a Delete Response, used to iterate through the list of resource paths ...
AwaClientSession * AwaClientSession_New(void)
Initialise a new session of the Awa subsystem.
AwaPathIterator * AwaClientSubscribeResponse_NewPathIterator(const AwaClientSubscribeResponse *response)
Create a new Path Iterator for a Subscribe Response, used to iterate through the list of paths relati...
AwaError AwaClientSetOperation_AddArrayValueAsBoolean(AwaClientSetOperation *operation, const char *path, int resourceInstanceID, AwaBoolean value)
AwaError AwaClientSetOperation_AddValueAsIntegerArray(AwaClientSetOperation *operation, const char *path, const AwaIntegerArray *array)
AwaError AwaClientChangeSubscription_Free(AwaClientChangeSubscription **subscription)
Shut down a Change Subscription, freeing any allocated memory.
AwaError AwaClientGetResponse_GetValueAsOpaquePointer(const AwaClientGetResponse *response, const char *path, const AwaOpaque **value)
const AwaPathResult * AwaClientSetResponse_GetPathResult(const AwaClientSetResponse *response, const char *path)
Retrieve a path result from a Set Response relating to a write to that path retrieved by the correspo...
A utility struct used to convey data pointer and size of an opaque data block.
Definition: types.h:81
AwaError AwaClientSetOperation_AddValueAsBoolean(AwaClientSetOperation *operation, const char *path, AwaBoolean value)
AwaError AwaClientDeleteOperation_AddPathWithArrayRange(AwaClientDeleteOperation *operation, const char *path, AwaArrayIndex startIndex, AwaArrayLength indexCount)
Add a path to a multiple-instance resource and specify a range of resource instances to delete...
AwaError AwaClientSetOperation_AddValueAsOpaqueArray(AwaClientSetOperation *operation, const char *path, const AwaOpaqueArray *array)
AwaObjectDefinitionIterator * AwaClientSession_NewObjectDefinitionIterator(const AwaClientSession *session)
Retrieves a new object definition iterator that can be used to iterate through the set of defined obj...
AwaError AwaClientSetOperation_AddValueAsOpaque(AwaClientSetOperation *operation, const char *path, AwaOpaque value)
AwaError AwaClientSetOperation_AddValueAsFloat(AwaClientSetOperation *operation, const char *path, AwaFloat value)
AwaError AwaClientSession_DispatchCallbacks(AwaClientSession *session)
Invoke any callbacks scheduled since this function was last called.
const AwaClientDeleteResponse * AwaClientDeleteOperation_GetResponse(const AwaClientDeleteOperation *operation)
Obtain a Delete Response instance from a processed Delete operation.
struct _AwaTimeArray AwaTimeArray
Definition: common.h:102
AwaClientSubscribeOperation * AwaClientSubscribeOperation_New(const AwaClientSession *session)
Allocate and return a pointer to a new Subscribe operation, that can be used to subscribe to executio...
int AwaObjectInstanceID
Definition: types.h:44
size_t AwaArrayIndex
Represents a multiple-instance array index value.
Definition: common.h:89
AwaError AwaClientGetResponse_GetValuesAsOpaqueArrayPointer(const AwaClientGetResponse *response, const char *path, const AwaOpaqueArray **valueArray)
AwaError AwaClientGetResponse_GetValueAsIntegerPointer(const AwaClientGetResponse *response, const char *path, const AwaInteger **value)
const char * AwaClientExecuteSubscription_GetPath(AwaClientExecuteSubscription *subscription)
Retrieve the path from a Execute subscription.
struct _AwaChangeSet AwaChangeSet
Definition: common.h:734
AwaError AwaClientGetOperation_AddPath(AwaClientGetOperation *operation, const char *path)
Adds a path of interest to a Get operation, as a request to retrieve all resources at or covered by t...
AwaError AwaClientDefineOperation_Free(AwaClientDefineOperation **operation)
Clean up a Define operation, freeing all allocated resources.
AwaError AwaClientGetResponse_GetValueAsTimePointer(const AwaClientGetResponse *response, const char *path, const AwaTime **value)
AwaError AwaClientSubscribeOperation_AddExecuteSubscription(AwaClientSubscribeOperation *operation, AwaClientExecuteSubscription *subscription)
Adds a Execute Subscription of interest to a Subscribe operation, as a request to be notified of exec...
const AwaClientSetResponse * AwaClientSetOperation_GetResponse(const AwaClientSetOperation *operation)
Obtain a Set Response instance from a processed Set Operation.
AwaError AwaClientExecuteSubscription_Free(AwaClientExecuteSubscription **subscription)
Shut down an Execute Subscription, freeing any allocated memory.
AwaError AwaClientSubscribeOperation_AddCancelExecuteSubscription(AwaClientSubscribeOperation *operation, AwaClientExecuteSubscription *subscription)
Adds a Cancel flag to a Execute Subscription in a specified Subscribe operation, as a request to canc...
AwaError AwaClientGetResponse_GetValuesAsStringArrayPointer(const AwaClientGetResponse *response, const char *path, const AwaStringArray **valueArray)
AwaError AwaClientGetResponse_GetValuesAsIntegerArrayPointer(const AwaClientGetResponse *response, const char *path, const AwaIntegerArray **valueArray)
AwaError AwaClientSetOperation_AddValueAsBooleanArray(AwaClientSetOperation *operation, const char *path, const AwaBooleanArray *array)
const AwaClientSubscribeResponse * AwaClientSubscribeOperation_GetResponse(const AwaClientSubscribeOperation *operation)
Obtain a Subscribe Response instance from a processed Subscribe operation.
AwaError AwaClientGetOperation_Free(AwaClientGetOperation **operation)
Clean up a Get operation, freeing all allocated resources.
AwaError AwaClientSession_Process(AwaClientSession *session, AwaTimeout timeout)
Process any incoming requests from the LWM2M Client.
AwaError AwaClientSubscribeOperation_Free(AwaClientSubscribeOperation **operation)
Clean up a Subscribe operation, freeing all allocated resources.
AwaError AwaClientSession_Free(AwaClientSession **session)
Shut down an existing session, freeing any allocated memory.
AwaError AwaClientGetResponse_GetValueAsFloatPointer(const AwaClientGetResponse *response, const char *path, const AwaFloat **value)
struct _AwaObjectDefinitionIterator AwaObjectDefinitionIterator
Definition: common.h:348
AwaError AwaClientGetResponse_GetValuesAsBooleanArrayPointer(const AwaClientGetResponse *response, const char *path, const AwaBooleanArray **valueArray)
AwaError AwaClientSetOperation_AddValueAsCString(AwaClientSetOperation *operation, const char *path, const char *value)
AwaError AwaClientSetOperation_Free(AwaClientSetOperation **operation)
Clean up a Set Operation, freeing all allocated resources.
AwaError AwaClientSetOperation_AddArrayValueAsOpaque(AwaClientSetOperation *operation, const char *path, int resourceInstanceID, AwaOpaque value)
AwaError AwaClientSession_SetDefaultTimeout(AwaClientSession *session, AwaTimeout timeout)
Set IPC connect timeout.
AwaClientExecuteSubscription * AwaClientExecuteSubscription_New(const char *path, AwaClientSubscribeToExecuteCallback callback, void *context)
Allocate and return a pointer to a new Execute Subscription, that can be used to subscribe to executi...
AwaError AwaClientSetOperation_AddValueAsObjectLink(AwaClientSetOperation *operation, const char *path, AwaObjectLink value)
AwaError AwaClientGetOperation_Perform(AwaClientGetOperation *operation, AwaTimeout timeout)
Process the Get operation by sending it to the Core.
double AwaFloat
Corresponds to the LWM2M Float type.
Definition: types.h:66
AwaError AwaClientGetResponse_GetValuesAsObjectLinkArrayPointer(const AwaClientGetResponse *response, const char *path, const AwaObjectLinkArray **valueArray)
AwaError AwaClientSession_Refresh(AwaClientSession *session)
Object and Resource Definitions are assembled by the application and sent to the client daemon for st...
struct _ObjectDefinition AwaObjectDefinition
Definition: common.h:346
struct _AwaStringArray AwaStringArray
Definition: common.h:97
int AwaObjectID
Definition: types.h:43
bool AwaClientGetResponse_HasValue(const AwaClientGetResponse *response, const char *path)
Test if the Get Response has a value for the specified resource path.
AwaError AwaClientDefineOperation_Perform(AwaClientDefineOperation *operation, AwaTimeout timeout)
AwaError AwaClientSubscribeOperation_AddCancelChangeSubscription(AwaClientSubscribeOperation *operation, AwaClientChangeSubscription *subscription)
Adds a Cancel flag to a Change Subscription in a specified Subscribe operation, as a request to cance...
AwaError AwaClientSetOperation_AddValueAsStringArray(AwaClientSetOperation *operation, const char *path, const AwaStringArray *array)
AwaError AwaClientSetOperation_AddValueAsFloatArray(AwaClientSetOperation *operation, const char *path, const AwaFloatArray *array)
int AwaResourceID
Definition: types.h:45
AwaError AwaClientSetOperation_AddValueAsTimeArray(AwaClientSetOperation *operation, const char *path, const AwaTimeArray *array)
AwaError AwaClientSession_PathToIDs(const AwaClientSession *session, const char *path, AwaObjectID *objectID, AwaObjectInstanceID *objectInstanceID, AwaResourceID *resourceID)
Paths are used to identify objects, object instances and resources within the data model...
AwaError AwaClientSetOperation_AddArrayValueAsTime(AwaClientSetOperation *operation, const char *path, int resourceInstanceID, AwaTime value)
const AwaClientGetResponse * AwaClientGetOperation_GetResponse(const AwaClientGetOperation *operation)
Obtain a Get Response instance from a processed Get operation.
AwaError AwaClientSubscribeOperation_AddChangeSubscription(AwaClientSubscribeOperation *operation, AwaClientChangeSubscription *subscription)
Adds a Change Subscription of interest to a Subscribe operation, as a request to be notified of chang...
int64_t AwaInteger
Corresponds to the LWM2M 64-bit Integer type.
Definition: types.h:61
Provides declarations and definitions that are common to the Awa LWM2M API and Static API...
struct _AwaObjectLinkArray AwaObjectLinkArray
Definition: common.h:103
bool AwaClientSetResponse_ContainsPath(const AwaClientSetResponse *response, const char *path)
Test if the Set Response has the specified path to a resource or object present.
void(* AwaClientSubscribeToExecuteCallback)(const AwaExecuteArguments *arguments, void *context)
A user-specified callback handler for an Execute Subscription which will be fired on AwaClientSession...
Definition: client.h:129
AwaError AwaClientSetOperation_CreateObjectInstance(AwaClientSetOperation *operation, const char *path)
Adds an object or object instance path to a Set Operation, as a request to create an Object Instance...
AwaError AwaClientDeleteOperation_AddPath(AwaClientDeleteOperation *operation, const char *path)
Adds a path to a Delete operation, as a request to delete the specified resource or object instance...
AwaError AwaClientSetOperation_AddValueAsInteger(AwaClientSetOperation *operation, const char *path, AwaInteger value)
const AwaPathResult * AwaClientDeleteResponse_GetPathResult(const AwaClientDeleteResponse *response, const char *path)
Retrieve a path result from a Delete Response relating to a subscription to that path retrieved by th...
AwaError AwaClientSession_SetIPCAsUDP(AwaClientSession *session, const char *address, uint16_t port)
Configure the IPC mechanism used by the API to communicate with the Core.
int64_t AwaTime
Corresponds to the LWM2M Time type.
Definition: types.h:76
const AwaClientSession * AwaChangeSet_GetClientSession(const AwaChangeSet *changeSet)
Retrieve the corresponding session for a ChangeSet.
AwaError AwaClientDeleteOperation_Perform(AwaClientDeleteOperation *operation, AwaTimeout timeout)
Process the Delete operation by sending it to the Core.
const AwaPathResult * AwaClientGetResponse_GetPathResult(const AwaClientGetResponse *response, const char *path)
Retrieve a path result from a Get Response relating to a write to that path retrieved by the correspo...
bool AwaClientDeleteResponse_ContainsPath(const AwaClientDeleteResponse *response, const char *path)
Test if the Delete Response has the specified path (object instance or object) present.
AwaError AwaClientSetOperation_AddValueAsObjectLinkArray(AwaClientSetOperation *operation, const char *path, const AwaObjectLinkArray *array)
struct _AwaPathIterator AwaPathIterator
Definition: common.h:617
const char * AwaClientChangeSubscription_GetPath(AwaClientChangeSubscription *subscription)
Retrieve the path from a Change subscription.