/** To represent resource type with presence.*/
#define OC_RSRVD_RESOURCE_TYPE_PRESENCE "oic.wk.ad"
+/** To represent resource type with device.*/
+#define OC_RSRVD_RESOURCE_TYPE_DEVICE "oic.wk.d"
+
+/** To represent resource type with platform.*/
+#define OC_RSRVD_RESOURCE_TYPE_PLATFORM "oic.wk.p"
+
/** To represent interface.*/
#define OC_RSRVD_INTERFACE "if"
/** To represent default interface.*/
#define OC_RSRVD_INTERFACE_DEFAULT "oic.if.baseline"
+/** To represent read-only interface.*/
+#define OC_RSRVD_INTERFACE_READ "oic.if.r"
+
/** To represent ll interface.*/
#define OC_RSRVD_INTERFACE_LL "oic.if.ll"
OCResource *headResource = NULL;
static OCResource *tailResource = NULL;
+static OCResourceHandle platformResource = {0};
+static OCResourceHandle deviceResource = {0};
#ifdef WITH_PRESENCE
static OCPresenceState presenceState = OC_PRESENCE_UNINITIALIZED;
static PresenceResource presenceResource;
void* defaultDeviceHandlerCallbackParameter = NULL;
static const char COAP_TCP[] = "coap+tcp:";
-
//-----------------------------------------------------------------------------
// Macros
//-----------------------------------------------------------------------------
result = SRMInitSecureResources();
}
#endif
+
+ if(result == OC_STACK_OK)
+ {
+ result = OCCreateResource(&deviceResource,
+ OC_RSRVD_RESOURCE_TYPE_DEVICE,
+ OC_RSRVD_INTERFACE_DEFAULT,
+ OC_RSRVD_DEVICE_URI,
+ NULL,
+ NULL,
+ OC_DISCOVERABLE);
+ }
+
+ if(result == OC_STACK_OK)
+ {
+ result = OCCreateResource(&platformResource,
+ OC_RSRVD_RESOURCE_TYPE_PLATFORM,
+ OC_RSRVD_INTERFACE_DEFAULT,
+ OC_RSRVD_PLATFORM_URI,
+ NULL,
+ NULL,
+ OC_DISCOVERABLE);
+ }
+
return result;
}