Awa LWM2M C API (0.2.5)  
server.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 
41 #ifndef AWA_SERVER_H
42 #define AWA_SERVER_H
43 
44 // @cond
45 #include <stdbool.h>
46 // @endcond
47 
48 #include "common.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /**************************************************************************************************
55  * Example Usage
56  *************************************************************************************************/
57 
86 /**************************************************************************************************
87  * Public Types and Enumerations
88  *************************************************************************************************/
89 
93 typedef enum
94 {
98 } AwaWriteMode;
99 
101 typedef struct _AwaServerSession AwaServerSession;
102 typedef struct _AwaServerListClientsOperation AwaServerListClientsOperation;
103 typedef struct _AwaServerListClientsResponse AwaServerListClientsResponse;
104 typedef struct _AwaClientIterator AwaClientIterator;
105 typedef struct _AwaRegisteredEntityIterator AwaRegisteredEntityIterator;
106 typedef struct _AwaServerDefineOperation AwaServerDefineOperation;
107 typedef struct _AwaServerDefineResponse AwaServerDefineResponse;
108 typedef struct _AwaServerReadOperation AwaServerReadOperation;
109 typedef struct _AwaServerReadResponse AwaServerReadResponse;
110 typedef struct _AwaServerWriteOperation AwaServerWriteOperation;
111 typedef struct _AwaWriteResponse AwaServerWriteResponse;
112 typedef struct _AwaServerDeleteResponse AwaServerDeleteResponse;
113 typedef struct _AwaServerDeleteOperation AwaServerDeleteOperation;
114 typedef struct _AwaServerExecuteOperation AwaServerExecuteOperation;
115 typedef struct _AwaServerExecuteResponse AwaServerExecuteResponse;
116 typedef struct _AwaServerWriteAttributesOperation AwaServerWriteAttributesOperation;
117 typedef struct _AwaServerWriteAttributesResponse AwaServerWriteAttributesResponse;
118 typedef struct _AwaServerDiscoverOperation AwaServerDiscoverOperation;
119 typedef struct _AwaServerDiscoverResponse AwaServerDiscoverResponse;
120 typedef struct _AwaAttributeIterator AwaAttributeIterator;
121 typedef struct _AwaServerObserveOperation AwaServerObserveOperation;
122 typedef struct _AwaServerObservation AwaServerObservation;
123 typedef struct _AwaServerObserveResponse AwaServerObserveResponse;
124 typedef struct _AwaServerClientRegisterEvent AwaServerClientRegisterEvent;
125 typedef struct _AwaServerClientUpdateEvent AwaServerClientUpdateEvent;
126 typedef struct _AwaServerClientDeregisterEvent AwaServerClientDeregisterEvent;
128 
129 
130 /**************************************************************************************************
131  * Callbacks
132  *************************************************************************************************/
133 
142 typedef void (*AwaServerObservationCallback)(const AwaChangeSet * changeSet, void * context);
143 
149 typedef void (*AwaServerClientRegisterEventCallback)(const AwaServerClientRegisterEvent * event, void * context);
150 
156 typedef void (*AwaServerClientUpdateEventCallback)(const AwaServerClientUpdateEvent * event, void * context);
157 
163 typedef void (*AwaServerClientDeregisterEventCallback)(const AwaServerClientDeregisterEvent * event, void * context);
164 
165 
166 /**************************************************************************************************
167  * Server Session Management
168  *************************************************************************************************/
169 
179 AwaServerSession * AwaServerSession_New(void);
180 
192 AwaError AwaServerSession_SetIPCAsUDP(AwaServerSession * session, const char * address, unsigned short port);
193 
194 // Not yet implemented:
195 //AwaError AwaServerSession_SetIPCAsLocal(AwaServerSession * session);
196 //AwaError AwaServerSession_SetIPCAsMQTT(AwaServerSession * session /* ... */);
197 //AwaError AwaServerSession_SetIPCAsUbus(AwaServerSession * session /* ... */);
198 //AwaError AwaServerSession_SetIPCAsNanoMsg(AwaServerSession * session /* ... */);
199 //AwaError AwaServerSession_SetIPCAsREST(AwaServerSession * session /* ... */);
200 
210 AwaError AwaServerSession_SetDefaultTimeout(AwaServerSession * session, AwaTimeout timeout);
211 
219 AwaError AwaServerSession_Connect(AwaServerSession * session);
220 
234 AwaError AwaServerSession_Refresh(AwaServerSession * session);
235 
246 bool AwaServerSession_IsObjectDefined(const AwaServerSession * session, AwaObjectID objectID);
247 
256 const AwaObjectDefinition * AwaServerSession_GetObjectDefinition(const AwaServerSession * session, AwaObjectID objectID);
257 
267 
276 AwaError AwaServerSession_Process(AwaServerSession * session, AwaTimeout timeout);
277 
284 AwaError AwaServerSession_DispatchCallbacks(AwaServerSession * session);
285 
298 AwaError AwaServerSession_Disconnect(AwaServerSession * session);
299 
308 AwaError AwaServerSession_Free(AwaServerSession ** session);
309 
322 AwaError AwaServerSession_PathToIDs(const AwaServerSession * session, const char * path, AwaObjectID * objectID, AwaObjectInstanceID * objectInstanceID, AwaResourceID * resourceID);
323 
324 
325 /**************************************************************************************************
326  * List Clients Operation
327  *************************************************************************************************/
328 
341 AwaServerListClientsOperation * AwaServerListClientsOperation_New(const AwaServerSession * session);
342 
353 AwaError AwaServerListClientsOperation_Perform(AwaServerListClientsOperation * operation, AwaTimeout timeout);
354 
365 const AwaServerListClientsResponse * AwaServerListClientsOperation_GetResponse(const AwaServerListClientsOperation * operation, const char * clientID);
366 
376 AwaRegisteredEntityIterator * AwaServerListClientsResponse_NewRegisteredEntityIterator(const AwaServerListClientsResponse * response);
377 
386 AwaError AwaServerListClientsOperation_Free(AwaServerListClientsOperation ** operation);
387 
395 bool AwaClientIterator_Next(AwaClientIterator * iterator);
396 
403 const char * AwaClientIterator_GetClientID(const AwaClientIterator * iterator);
404 
410 void AwaClientIterator_Free(AwaClientIterator ** iterator);
411 
421 AwaClientIterator * AwaServerListClientsOperation_NewClientIterator(const AwaServerListClientsOperation * operation);
422 
430 bool AwaRegisteredEntityIterator_Next(AwaRegisteredEntityIterator * iterator);
431 
438 const char * AwaRegisteredEntityIterator_GetPath(const AwaRegisteredEntityIterator * iterator);
439 
445 void AwaRegisteredEntityIterator_Free(AwaRegisteredEntityIterator ** iterator);
446 
447 
448 /**************************************************************************************************
449  * Object & Resource Definition Operation
450  *************************************************************************************************/
451 
471 AwaServerDefineOperation * AwaServerDefineOperation_New(const AwaServerSession * session);
472 
488 AwaError AwaServerDefineOperation_Add(AwaServerDefineOperation * operation, const AwaObjectDefinition * objectDefinition);
489 
490 // Future: support per-client definitions:
491 //AwaError AwaServerDefineOperation_AddWithClient(AwaServerDefineOperation * operation, const char * clientID, const AwaObjectDefinition * objectDefinition);
492 
493 /*
494  * @brief Process the Define operation by sending it to the Core.
495  * If successful, the object definition is also added to the session.
496  * @param[in] operation The Define operation to process.
497  * @param[in] timeout The function will wait at least as long as this value for a response.
498  * @return AwaError_Success on success.
499  * @return AwaError_Timeout if no response is received after the timeout duration expires.
500  * @return Various errors on failure.
501  */
502 AwaError AwaServerDefineOperation_Perform(AwaServerDefineOperation * operation, AwaTimeout timeout);
503 
511 AwaError AwaServerDefineOperation_Free(AwaServerDefineOperation ** operation);
512 
521 const AwaServerDefineResponse * AwaServerDefineOperation_GetResponse(const AwaServerDefineOperation * operation);
522 
532 AwaPathIterator * AwaServerDefineResponse_NewPathIterator(const AwaServerDefineResponse * response);
533 
544 const AwaPathResult * AwaServerDefineResponse_GetPathResult(const AwaServerDefineResponse * response, const char * path);
545 
554 bool AwaServerDefineResponse_ContainsPath(const AwaServerDefineResponse * response, const char * path);
555 
556 
557 /**************************************************************************************************
558  * Object & Resource Retrieval Operation
559  *************************************************************************************************/
560 
573 AwaServerReadOperation * AwaServerReadOperation_New(const AwaServerSession * session);
574 
591 AwaError AwaServerReadOperation_AddPath(AwaServerReadOperation * operation, const char * clientID, const char * path);
592 
603 AwaError AwaServerReadOperation_Perform(AwaServerReadOperation * operation, AwaTimeout timeout);
604 
614 AwaError AwaServerReadOperation_Free(AwaServerReadOperation ** operation);
615 
625 AwaClientIterator * AwaServerReadOperation_NewClientIterator(const AwaServerReadOperation * operation);
626 
638 const AwaServerReadResponse * AwaServerReadOperation_GetResponse(const AwaServerReadOperation * operation, const char * clientID);
639 
649 AwaPathIterator * AwaServerReadResponse_NewPathIterator(const AwaServerReadResponse * response);
650 
661 const AwaPathResult * AwaServerReadResponse_GetPathResult(const AwaServerReadResponse * response, const char * path);
662 
672 bool AwaServerReadResponse_ContainsPath(const AwaServerReadResponse * response, const char * path);
673 
684 bool AwaServerReadResponse_HasValue(const AwaServerReadResponse * response, const char * path);
685 
703 AwaError AwaServerReadResponse_GetValueAsCStringPointer (const AwaServerReadResponse * response, const char * path, const char ** value);
704 AwaError AwaServerReadResponse_GetValueAsIntegerPointer (const AwaServerReadResponse * response, const char * path, const AwaInteger ** value);
705 AwaError AwaServerReadResponse_GetValueAsFloatPointer (const AwaServerReadResponse * response, const char * path, const AwaFloat ** value);
706 AwaError AwaServerReadResponse_GetValueAsBooleanPointer (const AwaServerReadResponse * response, const char * path, const AwaBoolean ** value);
707 AwaError AwaServerReadResponse_GetValueAsTimePointer (const AwaServerReadResponse * response, const char * path, const AwaTime ** value);
708 AwaError AwaServerReadResponse_GetValueAsObjectLinkPointer (const AwaServerReadResponse * response, const char * path, const AwaObjectLink ** value);
709 AwaError AwaServerReadResponse_GetValueAsOpaquePointer (const AwaServerReadResponse * response, const char * path, const AwaOpaque ** value);
727 AwaError AwaServerReadResponse_GetValueAsOpaque(const AwaServerReadResponse * response, const char * path, AwaOpaque * value);
728 
742 AwaError AwaServerReadResponse_GetValueAsObjectLink(const AwaServerReadResponse * response, const char * path, AwaObjectLink * value);
743 
761 AwaError AwaServerReadResponse_GetValuesAsStringArrayPointer (const AwaServerReadResponse * response, const char * path, const AwaStringArray ** valueArray);
762 AwaError AwaServerReadResponse_GetValuesAsIntegerArrayPointer (const AwaServerReadResponse * response, const char * path, const AwaIntegerArray ** valueArray);
763 AwaError AwaServerReadResponse_GetValuesAsFloatArrayPointer (const AwaServerReadResponse * response, const char * path, const AwaFloatArray ** valueArray);
764 AwaError AwaServerReadResponse_GetValuesAsBooleanArrayPointer (const AwaServerReadResponse * response, const char * path, const AwaBooleanArray ** valueArray);
765 AwaError AwaServerReadResponse_GetValuesAsTimeArrayPointer (const AwaServerReadResponse * response, const char * path, const AwaTimeArray ** valueArray);
766 AwaError AwaServerReadResponse_GetValuesAsOpaqueArrayPointer (const AwaServerReadResponse * response, const char * path, const AwaOpaqueArray ** valueArray);
767 AwaError AwaServerReadResponse_GetValuesAsObjectLinkArrayPointer(const AwaServerReadResponse * response, const char * path, const AwaObjectLinkArray ** valueArray);
771 /**************************************************************************************************
772  * Object & Resource Value Setting Operation
773  *************************************************************************************************/
774 
780 const char * AwaWriteMode_ToString(AwaWriteMode writeMode);
781 
787 AwaWriteMode AwaWriteMode_FromString(const char * writeModeString);
788 
801 AwaServerWriteOperation * AwaServerWriteOperation_New(const AwaServerSession * session, AwaWriteMode defaultMode);
802 
817 AwaError AwaServerWriteOperation_CreateObjectInstance(AwaServerWriteOperation * operation, const char * path);
818 
831 AwaError AwaServerWriteOperation_SetObjectInstanceWriteMode(AwaServerWriteOperation * operation, const char * path, AwaWriteMode mode);
832 
848 AwaError AwaServerWriteOperation_SetResourceWriteMode(AwaServerWriteOperation * operation, const char * path, AwaWriteMode mode);
849 
864 AwaError AwaServerWriteOperation_AddValueAsCString (AwaServerWriteOperation * operation, const char * path, const char * value);
865 AwaError AwaServerWriteOperation_AddValueAsInteger (AwaServerWriteOperation * operation, const char * path, AwaInteger value);
866 AwaError AwaServerWriteOperation_AddValueAsFloat (AwaServerWriteOperation * operation, const char * path, AwaFloat value);
867 AwaError AwaServerWriteOperation_AddValueAsBoolean (AwaServerWriteOperation * operation, const char * path, AwaBoolean value);
868 AwaError AwaServerWriteOperation_AddValueAsTime (AwaServerWriteOperation * operation, const char * path, AwaTime value);
869 AwaError AwaServerWriteOperation_AddValueAsOpaque (AwaServerWriteOperation * operation, const char * path, AwaOpaque value);
870 AwaError AwaServerWriteOperation_AddValueAsObjectLink(AwaServerWriteOperation * operation, const char * path, AwaObjectLink value);
888 AwaError AwaServerWriteOperation_AddValueAsStringArray (AwaServerWriteOperation * operation, const char * path, const AwaStringArray * array);
889 AwaError AwaServerWriteOperation_AddValueAsIntegerArray (AwaServerWriteOperation * operation, const char * path, const AwaIntegerArray * array);
890 AwaError AwaServerWriteOperation_AddValueAsFloatArray (AwaServerWriteOperation * operation, const char * path, const AwaFloatArray * array);
891 AwaError AwaServerWriteOperation_AddValueAsBooleanArray (AwaServerWriteOperation * operation, const char * path, const AwaBooleanArray * array);
892 AwaError AwaServerWriteOperation_AddValueAsTimeArray (AwaServerWriteOperation * operation, const char * path, const AwaTimeArray * array);
893 AwaError AwaServerWriteOperation_AddValueAsOpaqueArray (AwaServerWriteOperation * operation, const char * path, const AwaOpaqueArray * array);
894 AwaError AwaServerWriteOperation_AddValueAsObjectLinkArray(AwaServerWriteOperation * operation, const char * path, const AwaObjectLinkArray * array);
915 AwaError AwaServerWriteOperation_AddArrayValueAsCString (AwaServerWriteOperation * operation, const char * path, int resourceInstanceID, const char * value);
916 AwaError AwaServerWriteOperation_AddArrayValueAsInteger (AwaServerWriteOperation * operation, const char * path, int resourceInstanceID, AwaInteger value);
917 AwaError AwaServerWriteOperation_AddArrayValueAsFloat (AwaServerWriteOperation * operation, const char * path, int resourceInstanceID, AwaFloat value);
918 AwaError AwaServerWriteOperation_AddArrayValueAsBoolean (AwaServerWriteOperation * operation, const char * path, int resourceInstanceID, AwaBoolean value);
919 AwaError AwaServerWriteOperation_AddArrayValueAsTime (AwaServerWriteOperation * operation, const char * path, int resourceInstanceID, AwaTime value);
920 AwaError AwaServerWriteOperation_AddArrayValueAsOpaque (AwaServerWriteOperation * operation, const char * path, int resourceInstanceID, AwaOpaque value);
921 AwaError AwaServerWriteOperation_AddArrayValueAsObjectLink(AwaServerWriteOperation * operation, const char * path, int resourceInstanceID, AwaObjectLink value);
935 AwaError AwaServerWriteOperation_Perform(AwaServerWriteOperation * operation, const char * clientID, AwaTimeout timeout);
936 
946 const AwaServerWriteResponse * AwaServerWriteOperation_GetResponse(const AwaServerWriteOperation * operation, const char * clientID);
947 
955 AwaError AwaServerWriteOperation_Free(AwaServerWriteOperation ** operation);
956 
966 AwaClientIterator * AwaServerWriteOperation_NewClientIterator(const AwaServerWriteOperation * operation);
967 
977 AwaPathIterator * AwaServerWriteResponse_NewPathIterator(const AwaServerWriteResponse * response);
978 
989 const AwaPathResult * AwaServerWriteResponse_GetPathResult(const AwaServerWriteResponse * response, const char * path);
990 
999 bool AwaServerWriteResponse_ContainsPath(const AwaServerWriteResponse * response, const char * path);
1000 
1001 
1002 /**************************************************************************************************
1003  * Object Instance & Resource Deletion Operation
1004  *************************************************************************************************/
1005 
1012 AwaServerDeleteOperation * AwaServerDeleteOperation_New(const AwaServerSession * session);
1013 
1025 AwaError AwaServerDeleteOperation_AddPath(AwaServerDeleteOperation * operation, const char * clientID, const char * path);
1026 
1036 AwaError AwaServerDeleteOperation_Perform(AwaServerDeleteOperation * operation, AwaTimeout timeout);
1037 
1047 const AwaServerDeleteResponse * AwaServerDeleteOperation_GetResponse(const AwaServerDeleteOperation * operation, const char * clientID);
1048 
1056 AwaError AwaServerDeleteOperation_Free(AwaServerDeleteOperation ** operation);
1057 
1067 AwaClientIterator * AwaServerDeleteOperation_NewClientIterator(const AwaServerDeleteOperation * operation);
1068 
1078 AwaPathIterator * AwaServerDeleteResponse_NewPathIterator(const AwaServerDeleteResponse * response);
1079 
1090 const AwaPathResult * AwaServerDeleteResponse_GetPathResult(const AwaServerDeleteResponse * response, const char * path);
1091 
1101 bool AwaServerDeleteResponse_ContainsPath(const AwaServerDeleteResponse * response, const char * path);
1102 
1103 
1104 /**************************************************************************************************
1105  * Resource Execute Operation
1106  *************************************************************************************************/
1107 
1117 AwaServerExecuteOperation * AwaServerExecuteOperation_New(const AwaServerSession * session);
1118 
1130 AwaError AwaServerExecuteOperation_AddPath(AwaServerExecuteOperation * operation, const char * clientID, const char * path, const AwaExecuteArguments * arguments);
1131 
1143 AwaError AwaServerExecuteOperation_Perform(AwaServerExecuteOperation * operation, AwaTimeout timeout);
1144 
1154 const AwaServerExecuteResponse * AwaServerExecuteOperation_GetResponse(const AwaServerExecuteOperation * operation, const char * clientID);
1155 
1163 AwaError AwaServerExecuteOperation_Free(AwaServerExecuteOperation ** operation);
1164 
1174 AwaClientIterator * AwaServerExecuteOperation_NewClientIterator(const AwaServerExecuteOperation * operation);
1175 
1185 AwaPathIterator * AwaServerExecuteResponse_NewPathIterator(const AwaServerExecuteResponse * response);
1186 
1197 const AwaPathResult * AwaServerExecuteResponse_GetPathResult(const AwaServerExecuteResponse * response, const char * path);
1198 
1208 bool AwaServerExecuteResponse_ContainsPath(const AwaServerExecuteResponse * response, const char * path);
1209 
1210 
1211 /**************************************************************************************************
1212  * Write-Attributes Operation
1213  *************************************************************************************************/
1214 
1233 AwaServerWriteAttributesOperation * AwaServerWriteAttributesOperation_New(const AwaServerSession * session);
1234 
1252 AwaError AwaServerWriteAttributesOperation_AddAttributeAsInteger (AwaServerWriteAttributesOperation * operation, const char * clientID, const char * path, const char * link, AwaInteger value);
1253 AwaError AwaServerWriteAttributesOperation_AddAttributeAsFloat (AwaServerWriteAttributesOperation * operation, const char * clientID, const char * path, const char * link, AwaFloat value);
1254 // not yet implemented:
1255 //AwaError AwaServerWriteAttributesOperation_AddAttributeAsCString (AwaServerWriteAttributesOperation * operation, const char * path, const char * link, const char * value);
1256 //AwaError AwaServerWriteAttributesOperation_AddAttributeAsBoolean (AwaServerWriteAttributesOperation * operation, const char * path, const char * link, AwaBoolean value);
1257 //AwaError AwaServerWriteAttributesOperation_AddAttributeAsTime (AwaServerWriteAttributesOperation * operation, const char * path, const char * link, AwaTime value);
1258 //AwaError AwaServerWriteAttributesOperation_AddAttributeAsOpaque (AwaServerWriteAttributesOperation * operation, const char * path, const char * link, AwaOpaque value);
1259 //AwaError AwaServerWriteAttributesOperation_AddAttributeAsObjectLink(AwaServerWriteAttributesOperation * operation, const char * path, const char * link, AwaObjectLink value);
1273 AwaError AwaServerWriteAttributesOperation_Perform(AwaServerWriteAttributesOperation * operation, AwaTimeout timeout);
1274 
1284 const AwaServerWriteAttributesResponse * AwaServerWriteAttributesOperation_GetResponse(const AwaServerWriteAttributesOperation * operation, const char * clientID);
1285 
1293 AwaError AwaServerWriteAttributesOperation_Free(AwaServerWriteAttributesOperation ** operation);
1294 
1304 AwaClientIterator * AwaServerWriteAttributesOperation_NewClientIterator(const AwaServerWriteAttributesOperation * operation);
1305 
1315 AwaPathIterator * AwaServerWriteAttributesResponse_NewPathIterator(const AwaServerWriteAttributesResponse * response);
1316 
1327 const AwaPathResult * AwaServerWriteAttributesResponse_GetPathResult(const AwaServerWriteAttributesResponse * response, const char * path);
1328 
1338 bool AwaServerWriteAttributesResponse_ContainsPath(const AwaServerWriteAttributesResponse * response, const char * path);
1339 
1340 
1341 /**************************************************************************************************
1342  * Discover Operation
1343  *************************************************************************************************/
1344 
1355 AwaServerDiscoverOperation * AwaServerDiscoverOperation_New(const AwaServerSession * session);
1356 
1367 AwaError AwaServerDiscoverOperation_AddPath(AwaServerDiscoverOperation * operation, const char * clientID, const char * path);
1368 
1378 AwaError AwaServerDiscoverOperation_Perform(AwaServerDiscoverOperation * operation, AwaTimeout timeout);
1379 
1389 const AwaServerDiscoverResponse * AwaServerDiscoverOperation_GetResponse(const AwaServerDiscoverOperation * operation, const char * clientID);
1390 
1398 AwaError AwaServerDiscoverOperation_Free(AwaServerDiscoverOperation ** operation);
1399 
1409 AwaClientIterator * AwaServerDiscoverOperation_NewClientIterator(const AwaServerDiscoverOperation * operation);
1410 
1420 AwaPathIterator * AwaServerDiscoverResponse_NewPathIterator(const AwaServerDiscoverResponse * response);
1421 
1432 const AwaPathResult * AwaServerDiscoverResponse_GetPathResult(const AwaServerDiscoverResponse * response, const char * path);
1433 
1443 bool AwaServerDiscoverResponse_ContainsPath(const AwaServerDiscoverResponse * response, const char * path);
1444 
1463 AwaError AwaServerDiscoverResponse_GetAttributeValueAsIntegerPointer(const AwaServerDiscoverResponse * response, const char * path, const char * link, const AwaInteger ** value);
1464 AwaError AwaServerDiscoverResponse_GetAttributeValueAsFloatPointer (const AwaServerDiscoverResponse * response, const char * path, const char * link, const AwaFloat ** value);
1465 //AwaError AwaServerDiscoverResponse_GetAttributeValueAsCStringPointer(const AwaServerDiscoverResponse * response, const char * path, const char * link, const char ** value);
1466 //AwaError AwaServerDiscoverResponse_GetAttributeValueAsBooleanPointer(const AwaServerDiscoverResponse * response, const char * path, const char * link, const AwaBoolean ** value);
1467 //AwaError AwaServerDiscoverResponse_GetAttributeValueAsTimePointer (const AwaServerDiscoverResponse * response, const char * path, const char * link, const AwaTime ** value);
1468 //AwaError AwaServerDiscoverResponse_GetAttributeValueAsOpaque (const AwaServerDiscoverResponse * response, const char * path, const char * link, AwaOpaque * value);
1469 //AwaError AwaServerDiscoverResponse_GetAttributeValueAsObjectLink (const AwaServerDiscoverResponse * response, const char * path, const char * link, AwaObjectLink * value);
1482 AwaAttributeIterator * AwaServerDiscoverResponse_NewAttributeIterator(const AwaServerDiscoverResponse * response, const char * path);
1483 
1491 bool AwaAttributeIterator_Next(AwaAttributeIterator * iterator);
1492 
1499 const char * AwaAttributeIterator_GetLink(const AwaAttributeIterator * iterator);
1500 
1506 void AwaAttributeIterator_Free(AwaAttributeIterator ** iterator);
1507 
1508 
1509 /**************************************************************************************************
1510  * Observe Operation
1511  *************************************************************************************************/
1512 
1526 AwaServerObserveOperation * AwaServerObserveOperation_New(const AwaServerSession * session);
1527 
1537 AwaError AwaServerObserveOperation_AddObservation(AwaServerObserveOperation * operation, AwaServerObservation * observation);
1538 
1548 AwaError AwaServerObserveOperation_AddCancelObservation(AwaServerObserveOperation * operation, AwaServerObservation * observation);
1549 
1562 AwaError AwaServerObserveOperation_Perform(AwaServerObserveOperation * operation, AwaTimeout timeout);
1563 
1575 const AwaServerObserveResponse * AwaServerObserveOperation_GetResponse(const AwaServerObserveOperation * operation, const char * clientID);
1576 
1585 AwaError AwaServerObserveOperation_Free(AwaServerObserveOperation ** operation);
1586 
1603 AwaServerObservation * AwaServerObservation_New(const char * clientID, const char * path, AwaServerObservationCallback callback, void * context);
1604 
1611 const char * AwaServerObservation_GetPath(AwaServerObservation * observation);
1612 
1620 AwaError AwaServerObservation_Free(AwaServerObservation ** observation);
1621 
1631 AwaClientIterator * AwaServerObserveOperation_NewClientIterator(const AwaServerObserveOperation * operation);
1632 
1642 AwaPathIterator * AwaServerObserveResponse_NewPathIterator(const AwaServerObserveResponse * response);
1643 
1654 const AwaPathResult * AwaServerObserveResponse_GetPathResult(const AwaServerObserveResponse * response, const char * path);
1655 
1665 bool AwaServerObserveResponse_ContainsPath(const AwaServerObserveResponse * response, const char * path);
1666 
1667 
1668 /**************************************************************************************************
1669  * ChangeSet Functions for Observations
1670  *************************************************************************************************/
1671 
1679 const AwaServerSession * AwaChangeSet_GetServerSession(const AwaChangeSet * changeSet);
1680 
1688 const char * AwaChangeSet_GetClientID(const AwaChangeSet * changeSet);
1689 
1690 
1691 /**************************************************************************************************
1692  * Server Events
1693  *************************************************************************************************/
1694 
1708 AwaError AwaServerSession_SetClientRegisterEventCallback(AwaServerSession * session, AwaServerClientRegisterEventCallback callback, void * context);
1709 
1723 AwaError AwaServerSession_SetClientUpdateEventCallback(AwaServerSession * session, AwaServerClientUpdateEventCallback callback, void * context);
1724 
1738 AwaError AwaServerSession_SetClientDeregisterEventCallback(AwaServerSession * session, AwaServerClientDeregisterEventCallback callback, void * context);
1739 
1749 AwaClientIterator * AwaServerClientRegisterEvent_NewClientIterator(const AwaServerClientRegisterEvent * event);
1750 
1760 AwaClientIterator * AwaServerClientUpdateEvent_NewClientIterator(const AwaServerClientUpdateEvent * event);
1761 
1771 AwaClientIterator * AwaServerClientDeregisterEvent_NewClientIterator(const AwaServerClientDeregisterEvent * event);
1772 
1783 AwaRegisteredEntityIterator * AwaServerClientRegisterEvent_NewRegisteredEntityIterator(const AwaServerClientRegisterEvent * event, const char * clientID);
1784 
1795 AwaRegisteredEntityIterator * AwaServerClientUpdateEvent_NewRegisteredEntityIterator(const AwaServerClientUpdateEvent * event, const char * clientID);
1796 
1797 
1798 #ifdef __cplusplus
1799 }
1800 #endif
1801 
1802 #endif // AWA_SERVER_H
AwaError
API Error Codes.
Definition: error.h:38
struct _AwaPathResult AwaPathResult
Definition: common.h:710
AwaError AwaServerReadResponse_GetValueAsOpaque(const AwaServerReadResponse *response, const char *path, AwaOpaque *value)
Retrieve an opaque resource&#39;s value from a Read Response.
AwaRegisteredEntityIterator * AwaServerListClientsResponse_NewRegisteredEntityIterator(const AwaServerListClientsResponse *response)
Create a new Registered Entity iterator for a List Clients Response, used to iterate through the list...
AwaServerDiscoverOperation * AwaServerDiscoverOperation_New(const AwaServerSession *session)
Allocate and return a pointer to a new Discover operation, that can be used to discover attributes at...
AwaError AwaServerWriteOperation_AddValueAsObjectLinkArray(AwaServerWriteOperation *operation, const char *path, const AwaObjectLinkArray *array)
bool AwaServerReadResponse_ContainsPath(const AwaServerReadResponse *response, const char *path)
Test if the Read Response has the specified path (resource, object instance or object) present...
AwaServerReadOperation * AwaServerReadOperation_New(const AwaServerSession *session)
Allocate and return a pointer to a new Read operation, that can be used to retrieve resource values f...
AwaError AwaServerWriteAttributesOperation_Free(AwaServerWriteAttributesOperation **operation)
Clean up a Write Attributes operation, freeing all allocated resources.
AwaError AwaServerWriteOperation_AddValueAsTimeArray(AwaServerWriteOperation *operation, const char *path, const AwaTimeArray *array)
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...
AwaClientIterator * AwaServerListClientsOperation_NewClientIterator(const AwaServerListClientsOperation *operation)
Create a new Client Iterator for a List Clients Response, used to iterate through the list of client ...
AwaError AwaServerWriteOperation_AddArrayValueAsBoolean(AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaBoolean value)
const AwaObjectDefinition * AwaServerSession_GetObjectDefinition(const AwaServerSession *session, AwaObjectID objectID)
Retrieves an object definition instance corresponding to the object identified by the given object ID...
int AwaTimeout
Represents a timeout value, in milliseconds.
Definition: common.h:70
AwaWriteMode AwaWriteMode_FromString(const char *writeModeString)
Get a Write Mode from a descriptive name of a Write Mode.
AwaError AwaServerSession_SetClientDeregisterEventCallback(AwaServerSession *session, AwaServerClientDeregisterEventCallback callback, void *context)
Sets a callback function to be called whenever a Client deregisters with the server.
AwaPathIterator * AwaServerWriteResponse_NewPathIterator(const AwaServerWriteResponse *response)
Create a new Path Iterator for a Write Response, used to iterate through the list of paths returned i...
const AwaServerDiscoverResponse * AwaServerDiscoverOperation_GetResponse(const AwaServerDiscoverOperation *operation, const char *clientID)
Obtain a Discover Response instance from a processed Discover operation.
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 corres...
struct _AwaBooleanArray AwaBooleanArray
Definition: common.h:100
AwaError AwaServerWriteAttributesOperation_Perform(AwaServerWriteAttributesOperation *operation, AwaTimeout timeout)
Process the Write Attributes operation by sending it to the Core.
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 th...
AwaError AwaServerReadResponse_GetValueAsOpaquePointer(const AwaServerReadResponse *response, const char *path, const AwaOpaque **value)
AwaError AwaServerReadOperation_Perform(AwaServerReadOperation *operation, AwaTimeout timeout)
Process the Read operation by sending it to the Core.
AwaError AwaServerWriteOperation_SetObjectInstanceWriteMode(AwaServerWriteOperation *operation, const char *path, AwaWriteMode mode)
Changes the write mode for an object instance path.
AwaError AwaServerWriteOperation_AddValueAsBooleanArray(AwaServerWriteOperation *operation, const char *path, const AwaBooleanArray *array)
const AwaServerDeleteResponse * AwaServerDeleteOperation_GetResponse(const AwaServerDeleteOperation *operation, const char *clientID)
Obtain a Delete Response instance from a processed Delete operation.
struct _AwaIntegerArray AwaIntegerArray
Definition: common.h:98
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 attribut...
AwaError AwaServerWriteOperation_AddArrayValueAsTime(AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaTime value)
AwaError AwaServerSession_DispatchCallbacks(AwaServerSession *session)
Invoke any callbacks scheduled since this function was last called.
AwaClientIterator * AwaServerDeleteOperation_NewClientIterator(const AwaServerDeleteOperation *operation)
Create a new Client Iterator for a performed Delete Operation, used to iterate through the list of cl...
indicates a write using CoAP "PUT"
Definition: server.h:95
const char * AwaWriteMode_ToString(AwaWriteMode writeMode)
Get a descriptive name for the specified Write Mode.
AwaError AwaServerObservation_Free(AwaServerObservation **observation)
Shut down an Observation, freeing any allocated memory.
AwaError AwaServerWriteOperation_AddValueAsObjectLink(AwaServerWriteOperation *operation, const char *path, AwaObjectLink value)
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.
bool AwaServerSession_IsObjectDefined(const AwaServerSession *session, AwaObjectID objectID)
Determines whether the specified session holds a valid definition for the given object.
AwaError AwaServerWriteOperation_Perform(AwaServerWriteOperation *operation, const char *clientID, AwaTimeout timeout)
Process the Write Operation by sending it to the Core.
AwaError AwaServerDeleteOperation_Perform(AwaServerDeleteOperation *operation, AwaTimeout timeout)
Process the Delete operation by sending it to the Core.
AwaError AwaServerDefineOperation_Free(AwaServerDefineOperation **operation)
Clean up a Define operation, freeing all allocated resources.
bool AwaAttributeIterator_Next(AwaAttributeIterator *iterator)
Determine whether the Attribute Iterator has not reached the end of a list of attributes.
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 ...
bool AwaServerDiscoverResponse_ContainsPath(const AwaServerDiscoverResponse *response, const char *path)
Test if the Discover Response has the specified path (resource, object instance or object) present...
struct _AwaFloatArray AwaFloatArray
Definition: common.h:99
AwaError AwaServerObserveOperation_Perform(AwaServerObserveOperation *operation, AwaTimeout timeout)
Process the Observe operation by sending it to the Core, notifying the Core to begin or cancel observ...
AwaClientIterator * AwaServerDiscoverOperation_NewClientIterator(const AwaServerDiscoverOperation *operation)
Create a new Client Iterator for a performed Discover Operation, used to iterate through the list of ...
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...
AwaPathIterator * AwaServerDeleteResponse_NewPathIterator(const AwaServerDeleteResponse *response)
Create a new Path Iterator for a Delete Response, used to iterate through the list of resource paths ...
AwaObjectDefinitionIterator * AwaServerSession_NewObjectDefinitionIterator(const AwaServerSession *session)
Retrieves a new object definition iterator that can be used to iterate through the set of defined obj...
AwaError AwaServerSession_SetClientRegisterEventCallback(AwaServerSession *session, AwaServerClientRegisterEventCallback callback, void *context)
Sets a callback function to be called whenever a Client registers with the server.
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...
struct _AwaOpaqueArray AwaOpaqueArray
Definition: common.h:101
AwaClientIterator * AwaServerReadOperation_NewClientIterator(const AwaServerReadOperation *operation)
Create a new Client Iterator for a performed Read Operation, used to iterate through the list of clie...
const AwaServerReadResponse * AwaServerReadOperation_GetResponse(const AwaServerReadOperation *operation, const char *clientID)
Obtain a Read Response instance from a processed Read operation.
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 th...
AwaPathIterator * AwaServerExecuteResponse_NewPathIterator(const AwaServerExecuteResponse *response)
Create a new Path Iterator for an Execute Response, used to iterate through the list of resource path...
bool AwaBoolean
Corresponds to the LWM2M Boolean type.
Definition: types.h:71
AwaServerDeleteOperation * AwaServerDeleteOperation_New(const AwaServerSession *session)
Allocate and return a pointer to a new Delete operation, that can be used to delete optional resource...
AwaError AwaServerReadResponse_GetValuesAsOpaqueArrayPointer(const AwaServerReadResponse *response, const char *path, const AwaOpaqueArray **valueArray)
AwaError AwaServerWriteOperation_AddValueAsIntegerArray(AwaServerWriteOperation *operation, const char *path, const AwaIntegerArray *array)
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 ...
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...
bool AwaClientIterator_Next(AwaClientIterator *iterator)
Determine whether the Client Iterator has not reached the end of a set of clients.
bool AwaServerWriteResponse_ContainsPath(const AwaServerWriteResponse *response, const char *path)
Test if the Write Response has the specified path to a resource or object present.
AwaError AwaServerReadResponse_GetValueAsFloatPointer(const AwaServerReadResponse *response, const char *path, const AwaFloat **value)
A utility struct used to convey data pointer and size of an opaque data block.
Definition: types.h:81
void AwaAttributeIterator_Free(AwaAttributeIterator **iterator)
Clean up a Attribute Iterator, freeing all allocated resources.
indicates a write using CoAP "POST"
Definition: server.h:96
AwaServerExecuteOperation * AwaServerExecuteOperation_New(const AwaServerSession *session)
Allocate and return a pointer to a new Execute operation, that can be used to trigger executable reso...
AwaClientIterator * AwaServerClientDeregisterEvent_NewClientIterator(const AwaServerClientDeregisterEvent *event)
Create a new Client Iterator from a Client Deregister Event, used to iterate through the list of clie...
AwaError AwaServerReadResponse_GetValuesAsTimeArrayPointer(const AwaServerReadResponse *response, const char *path, const AwaTimeArray **valueArray)
AwaError AwaServerObserveOperation_Free(AwaServerObserveOperation **operation)
Clean up an Observe operation, freeing all allocated resources.
AwaClientIterator * AwaServerObserveOperation_NewClientIterator(const AwaServerObserveOperation *operation)
Create a new Client Iterator for a performed Observe Operation, used to iterate through the list of c...
void(* AwaServerClientDeregisterEventCallback)(const AwaServerClientDeregisterEvent *event, void *context)
A user-specified callback handler for Server Notifications which will be fired on client deregister...
Definition: server.h:163
struct _AwaTimeArray AwaTimeArray
Definition: common.h:102
int AwaObjectInstanceID
Definition: types.h:44
AwaError AwaServerWriteOperation_AddArrayValueAsOpaque(AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaOpaque value)
bool AwaServerWriteAttributesResponse_ContainsPath(const AwaServerWriteAttributesResponse *response, const char *path)
Test if the Write Attributes Response has the specified path (resource, object instance or object) pr...
AwaClientIterator * AwaServerWriteAttributesOperation_NewClientIterator(const AwaServerWriteAttributesOperation *operation)
Create a new Client Iterator for a performed Write Attributes Operation, used to iterate through the ...
struct _AwaChangeSet AwaChangeSet
Definition: common.h:734
AwaError AwaServerReadResponse_GetValuesAsFloatArrayPointer(const AwaServerReadResponse *response, const char *path, const AwaFloatArray **valueArray)
const AwaServerWriteResponse * AwaServerWriteOperation_GetResponse(const AwaServerWriteOperation *operation, const char *clientID)
Obtain a Write Response instance from a processed Write Operation.
AwaPathIterator * AwaServerWriteAttributesResponse_NewPathIterator(const AwaServerWriteAttributesResponse *response)
Create a new Path Iterator for a Write Attributes Response, used to iterate through the list of paths...
AwaError AwaServerWriteOperation_AddValueAsTime(AwaServerWriteOperation *operation, const char *path, AwaTime value)
AwaError AwaServerReadResponse_GetValueAsObjectLink(const AwaServerReadResponse *response, const char *path, AwaObjectLink *value)
Retrieve an object link resource&#39;s value from a Read Response.
AwaError AwaServerWriteOperation_AddValueAsFloatArray(AwaServerWriteOperation *operation, const char *path, const AwaFloatArray *array)
const char * AwaClientIterator_GetClientID(const AwaClientIterator *iterator)
Retrieve the ID from the current client in the Client Iterator.
AwaError AwaServerDeleteOperation_Free(AwaServerDeleteOperation **operation)
Clean up a Delete operation, freeing all allocated resources.
AwaError AwaServerWriteOperation_AddValueAsFloat(AwaServerWriteOperation *operation, const char *path, AwaFloat value)
AwaError AwaServerWriteOperation_AddValueAsOpaqueArray(AwaServerWriteOperation *operation, const char *path, const AwaOpaqueArray *array)
AwaPathIterator * AwaServerObserveResponse_NewPathIterator(const AwaServerObserveResponse *response)
Create a new Path Iterator for an Observe Response, used to iterate through the list of object...
AwaError AwaServerReadResponse_GetValuesAsIntegerArrayPointer(const AwaServerReadResponse *response, const char *path, const AwaIntegerArray **valueArray)
bool AwaRegisteredEntityIterator_Next(AwaRegisteredEntityIterator *iterator)
Determine whether the Registered Entity Iterator has not reached the end of a list of registered enti...
AwaError AwaServerWriteOperation_AddArrayValueAsCString(AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, const char *value)
AwaError AwaServerReadResponse_GetValueAsCStringPointer(const AwaServerReadResponse *response, const char *path, const char **value)
void(* AwaServerObservationCallback)(const AwaChangeSet *changeSet, void *context)
A user-specified callback handler for an Observation which will be fired on AwaServerSession_Dispatch...
Definition: server.h:142
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 o...
AwaError AwaServerSession_Connect(AwaServerSession *session)
Connect a session (configured with an IPC mechanism) to the Core.
AwaError AwaServerListClientsOperation_Free(AwaServerListClientsOperation **operation)
Clean up a List Clients operation, freeing all allocated resources.
AwaError AwaServerSession_Process(AwaServerSession *session, AwaTimeout timeout)
Process any incoming requests from a LWM2M Client.
struct _AwaObjectDefinitionIterator AwaObjectDefinitionIterator
Definition: common.h:348
AwaError AwaServerReadResponse_GetValuesAsBooleanArrayPointer(const AwaServerReadResponse *response, const char *path, const AwaBooleanArray **valueArray)
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.
AwaError AwaServerWriteAttributesOperation_AddAttributeAsInteger(AwaServerWriteAttributesOperation *operation, const char *clientID, const char *path, const char *link, AwaInteger value)
AwaPathIterator * AwaServerDiscoverResponse_NewPathIterator(const AwaServerDiscoverResponse *response)
Create a new Path Iterator for a Discover Response, used to iterate through the list of paths retriev...
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 n...
AwaError AwaServerExecuteOperation_Free(AwaServerExecuteOperation **operation)
Clean up an Execute operation, freeing all allocated resources.
void(* AwaServerClientRegisterEventCallback)(const AwaServerClientRegisterEvent *event, void *context)
A user-specified callback handler for Server Notifications which will be fired on client registration...
Definition: server.h:149
AwaError AwaServerWriteOperation_AddArrayValueAsObjectLink(AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaObjectLink value)
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...
AwaServerDefineOperation * AwaServerDefineOperation_New(const AwaServerSession *session)
Allocate and return a pointer to a new Define operation, that can be used to define Objects and Resou...
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 th...
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...
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 notif...
AwaError AwaServerWriteOperation_AddValueAsInteger(AwaServerWriteOperation *operation, const char *path, AwaInteger value)
bool AwaServerReadResponse_HasValue(const AwaServerReadResponse *response, const char *path)
Test if the Read Response has a value for the specified resource path.
double AwaFloat
Corresponds to the LWM2M Float type.
Definition: types.h:66
const char * AwaRegisteredEntityIterator_GetPath(const AwaRegisteredEntityIterator *iterator)
Retrieve the path to the current registered entity in the Registered Entity Iterator.
struct _ObjectDefinition AwaObjectDefinition
Definition: common.h:346
bool AwaServerExecuteResponse_ContainsPath(const AwaServerExecuteResponse *response, const char *path)
Test if the Execute Response has the specified resource path present.
struct _AwaStringArray AwaStringArray
Definition: common.h:97
AwaError AwaServerReadResponse_GetValueAsObjectLinkPointer(const AwaServerReadResponse *response, const char *path, const AwaObjectLink **value)
int AwaObjectID
Definition: types.h:43
AwaWriteMode
Supported write modes.
Definition: server.h:93
AwaError AwaServerSession_Free(AwaServerSession **session)
Shut down an existing session, freeing any allocated memory.
Reserved value.
Definition: server.h:97
AwaServerWriteAttributesOperation * AwaServerWriteAttributesOperation_New(const AwaServerSession *session)
Allocate and return a pointer to a new Write Attributes operation, that can be used to modify when no...
AwaError AwaServerWriteOperation_AddValueAsOpaque(AwaServerWriteOperation *operation, const char *path, AwaOpaque value)
AwaError AwaServerReadResponse_GetValueAsBooleanPointer(const AwaServerReadResponse *response, const char *path, const AwaBoolean **value)
AwaError AwaServerWriteOperation_SetResourceWriteMode(AwaServerWriteOperation *operation, const char *path, AwaWriteMode mode)
Changes the write mode for a resource path.
const char * AwaAttributeIterator_GetLink(const AwaAttributeIterator *iterator)
Retrieve the link name associated with the current attribute in the Attribute Iterator.
AwaError AwaServerReadResponse_GetValuesAsStringArrayPointer(const AwaServerReadResponse *response, const char *path, const AwaStringArray **valueArray)
int AwaResourceID
Definition: types.h:45
AwaError AwaServerSession_SetDefaultTimeout(AwaServerSession *session, AwaTimeout timeout)
Set IPC connect timeout.
const AwaServerSession * AwaChangeSet_GetServerSession(const AwaChangeSet *changeSet)
Retrieve the corresponding session for a ChangeSet.
AwaError AwaServerReadResponse_GetValuesAsObjectLinkArrayPointer(const AwaServerReadResponse *response, const char *path, const AwaObjectLinkArray **valueArray)
AwaError AwaServerDiscoverOperation_Perform(AwaServerDiscoverOperation *operation, AwaTimeout timeout)
Process the Discover operation by sending it to the Core.
AwaClientIterator * AwaServerExecuteOperation_NewClientIterator(const AwaServerExecuteOperation *operation)
Create a new Client Iterator for a performed Execute Operation, used to iterate through the list of c...
const AwaServerListClientsResponse * AwaServerListClientsOperation_GetResponse(const AwaServerListClientsOperation *operation, const char *clientID)
Obtain a List Clients Response instance from a processed List Clients operation.
AwaError AwaServerListClientsOperation_Perform(AwaServerListClientsOperation *operation, AwaTimeout timeout)
Process the List Clients operation by sending it to the Core.
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 t...
AwaError AwaServerReadResponse_GetValueAsTimePointer(const AwaServerReadResponse *response, const char *path, const AwaTime **value)
AwaError AwaServerWriteOperation_AddValueAsCString(AwaServerWriteOperation *operation, const char *path, const char *value)
AwaError AwaServerExecuteOperation_Perform(AwaServerExecuteOperation *operation, AwaTimeout timeout)
Process the Execute operation by sending it to the Core.
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 d...
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 ...
AwaServerSession * AwaServerSession_New(void)
Initialise a new session of the Awa subsystem.
const AwaServerExecuteResponse * AwaServerExecuteOperation_GetResponse(const AwaServerExecuteOperation *operation, const char *clientID)
Obtain an Execute Response instance from a processed Execute operation.
AwaError AwaServerSession_Disconnect(AwaServerSession *session)
When a session is no longer required, or if the application intends to sleep for some time...
AwaError AwaServerWriteOperation_AddArrayValueAsInteger(AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaInteger value)
AwaError AwaServerDefineOperation_Perform(AwaServerDefineOperation *operation, AwaTimeout timeout)
int64_t AwaInteger
Corresponds to the LWM2M 64-bit Integer type.
Definition: types.h:61
AwaPathIterator * AwaServerDefineResponse_NewPathIterator(const AwaServerDefineResponse *response)
Create a new Path Iterator for a Define Response, used to iterate through the list of paths returned ...
Provides declarations and definitions that are common to the Awa LWM2M API and Static API...
void AwaClientIterator_Free(AwaClientIterator **iterator)
Clean up a Client Iterator, freeing all allocated resources.
struct _AwaObjectLinkArray AwaObjectLinkArray
Definition: common.h:103
AwaError AwaServerSession_Refresh(AwaServerSession *session)
Object and Resource Definitions are assembled by the application and sent to the server daemon for st...
bool AwaServerDefineResponse_ContainsPath(const AwaServerDefineResponse *response, const char *path)
Test if the Define Response has the specified path to a resource or object present.
AwaError AwaServerWriteOperation_AddValueAsBoolean(AwaServerWriteOperation *operation, const char *path, AwaBoolean value)
void AwaRegisteredEntityIterator_Free(AwaRegisteredEntityIterator **iterator)
Clean up a Registered Entity Iterator, freeing all allocated resources.
AwaError AwaServerDiscoverResponse_GetAttributeValueAsFloatPointer(const AwaServerDiscoverResponse *response, const char *path, const char *link, const AwaFloat **value)
AwaError AwaServerWriteOperation_Free(AwaServerWriteOperation **operation)
Clean up a Write Operation, freeing all allocated resources.
AwaError AwaServerDiscoverResponse_GetAttributeValueAsIntegerPointer(const AwaServerDiscoverResponse *response, const char *path, const char *link, const AwaInteger **value)
bool AwaServerDeleteResponse_ContainsPath(const AwaServerDeleteResponse *response, const char *path)
Test if the Delete Response has the specified path (object instance or object) present.
AwaError AwaServerWriteOperation_AddArrayValueAsFloat(AwaServerWriteOperation *operation, const char *path, int resourceInstanceID, AwaFloat value)
const char * AwaServerObservation_GetPath(AwaServerObservation *observation)
Retrieve the path from an Observation.
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 ...
const char * AwaChangeSet_GetClientID(const AwaChangeSet *changeSet)
Retrieve the corresponding client ID for a ChangeSet.
int64_t AwaTime
Corresponds to the LWM2M Time type.
Definition: types.h:76
AwaError AwaServerWriteOperation_AddValueAsStringArray(AwaServerWriteOperation *operation, const char *path, const AwaStringArray *array)
AwaError AwaServerSession_SetIPCAsUDP(AwaServerSession *session, const char *address, unsigned short port)
Configure the IPC mechanism used by the API to communicate with the Core.
bool AwaServerObserveResponse_ContainsPath(const AwaServerObserveResponse *response, const char *path)
Test if the Observe Response has the specified object, object instance or resource path present...
const AwaServerDefineResponse * AwaServerDefineOperation_GetResponse(const AwaServerDefineOperation *operation)
Obtain a Server Define Response instance from a processed Server Define operation.
AwaClientIterator * AwaServerClientRegisterEvent_NewClientIterator(const AwaServerClientRegisterEvent *event)
Create a new Client Iterator from a Client Register Event, used to iterate through the list of client...
const AwaServerObserveResponse * AwaServerObserveOperation_GetResponse(const AwaServerObserveOperation *operation, const char *clientID)
Obtain an Observe Response instance from a processed Observe operation.
AwaError AwaServerWriteAttributesOperation_AddAttributeAsFloat(AwaServerWriteAttributesOperation *operation, const char *clientID, const char *path, const char *link, AwaFloat value)
void(* AwaServerClientUpdateEventCallback)(const AwaServerClientUpdateEvent *event, void *context)
A user-specified callback handler for Server Notifications which will be fired on client update...
Definition: server.h:156
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...
AwaClientIterator * AwaServerWriteOperation_NewClientIterator(const AwaServerWriteOperation *operation)
Create a new Client Iterator for a Write Response, used to iterate through the list of client endpoin...
AwaError AwaServerDiscoverOperation_Free(AwaServerDiscoverOperation **operation)
Clean up a Discover operation, freeing all allocated resources.
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 ...
const AwaServerWriteAttributesResponse * AwaServerWriteAttributesOperation_GetResponse(const AwaServerWriteAttributesOperation *operation, const char *clientID)
Obtain a Write Attributes Response instance from a processed Write Attributes operation.
AwaError AwaServerReadResponse_GetValueAsIntegerPointer(const AwaServerReadResponse *response, const char *path, const AwaInteger **value)
AwaPathIterator * AwaServerReadResponse_NewPathIterator(const AwaServerReadResponse *response)
Create a new Path Iterator for a Read Response, used to iterate through the list of resource paths re...
struct _AwaPathIterator AwaPathIterator
Definition: common.h:617
AwaClientIterator * AwaServerClientUpdateEvent_NewClientIterator(const AwaServerClientUpdateEvent *event)
Create a new Client Iterator from a Client Update Event, used to iterate through the list of client e...
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 retri...
AwaError AwaServerReadOperation_Free(AwaServerReadOperation **operation)
Clean up a Read operation, freeing all allocated resources.