+ NS_LOG(DEBUG, "Create secured resource");
+ resourceProperties = OC_DISCOVERABLE | OC_SECURE;
+ }
+ else
+ {
+ resourceProperties = OC_DISCOVERABLE;
+ }
+
+ if (OCCreateResource(&NotificationResource.handle, NS_ROOT_TYPE, NS_INTERFACE_BASELINE,
+ NS_ROOT_URI, NSEntityHandlerNotificationCb, NULL,
+ resourceProperties) != OC_STACK_OK)
+ {
+ NS_LOG(ERROR, "Fail to Create Notification Resource");
+ return NS_ERROR;
+ }
+
+ if (OCBindResourceInterfaceToResource(NotificationResource.handle, NS_INTERFACE_READ)
+ != OC_STACK_OK)
+ {
+ NS_LOG(ERROR, "Fail to bind Notification Resource Type");