Skip to content

Commit f411cd5

Browse files
author
bartlomiej.zarnowski
committed
Optional Digital input counter & reset resource created in Presence IPSO object
Signed-off-by: bartlomiej.zarnowski <bartlomiej.zarnowski@imgtec.com>
1 parent 26de17b commit f411cd5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lwm2m-client-ipso-presence.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ AwaError PresenceObject_DefineObjectsAndResources(AwaStaticClient *awaClient, Aw
153153
}
154154

155155
error = AwaStaticClient_DefineResource(awaClient, IPSO_PRESENCE_OBJECT, IPSO_PRESENCE_DIGITAL_INPUT_COUNTER_RESET, "Digital Input Counter Reset",
156-
AwaResourceType_Opaque, 0, 1, AwaResourceOperations_Execute);
156+
AwaResourceType_None, 0, 1, AwaResourceOperations_Execute);
157157
AwaStaticClient_SetResourceOperationHandler(awaClient, IPSO_PRESENCE_OBJECT, IPSO_PRESENCE_DIGITAL_INPUT_COUNTER_RESET, PresenceObject_Handler);
158158
if (error != AwaError_Success)
159159
{
@@ -182,6 +182,18 @@ AwaError PresenceObject_DefineObjectsAndResources(AwaStaticClient *awaClient, Aw
182182
}
183183

184184
AwaStaticClient_CreateObjectInstance(awaClient, IPSO_PRESENCE_OBJECT, 0);
185+
error = AwaStaticClient_CreateResource(awaClient, IPSO_PRESENCE_OBJECT, 0, IPSO_PRESENCE_DIGITAL_INPUT_COUNTER_RESET);
186+
if (error != AwaError_Success)
187+
{
188+
printf("Failed to create resource 'Digital Input Counter Reset'\n");
189+
return error;
190+
}
191+
error = AwaStaticClient_CreateResource(awaClient, IPSO_PRESENCE_OBJECT, 0, IPSO_PRESENCE_DIGITAL_INPUT_COUNTER);
192+
if (error != AwaError_Success)
193+
{
194+
printf("Failed to create resource 'Digital Input Counter'\n");
195+
return error;
196+
}
185197
return AwaError_Success;
186198
}
187199

0 commit comments

Comments
 (0)