+ NS_INTERFACE_BASELINE, NS_COLLECTION_SYNC_URI, NSEntityHandlerSyncCb, NULL,
+ resourceProperties) != OC_STACK_OK)
+ {
+ NS_LOG(ERROR, "Fail to Create Notification Sync Resource");
+ return NS_ERROR;
+ }
+
+ if (OCBindResourceInterfaceToResource(NotificationSyncResource.handle,
+ NS_INTERFACE_READWRITE)
+ != OC_STACK_OK)
+ {
+ NS_LOG(ERROR, "Fail to bind Notification Sync Resource Type");
+ return NS_ERROR;
+ }
+ }
+ else if (strcmp(uri, NS_COLLECTION_TOPIC_URI) == 0)
+ {
+ (NotificationTopicResource.providerId)[0] = '\0';
+ (NotificationTopicResource.consumerId)[0] = '\0';
+ NotificationTopicResource.TopicList = NULL;
+ NotificationTopicResource.handle = NULL;
+
+ if (NSGetResourceSecurity())
+ {
+ NS_LOG(DEBUG, "Create secured resource");
+ resourceProperties = OC_RES_PROP_NONE | OC_SECURE;
+ }
+ else
+ {
+ resourceProperties = OC_RES_PROP_NONE;
+ }
+
+ if (OCCreateResource(&(NotificationTopicResource.handle), NS_COLLECTION_TOPIC_TYPE,
+ NS_INTERFACE_BASELINE, NS_COLLECTION_TOPIC_URI, NSEntityHandlerTopicCb, NULL,
+ resourceProperties) != OC_STACK_OK)
+ {
+ NS_LOG(ERROR, "Fail to Create Notification Sync Resource");
+ return NS_ERROR;
+ }
+
+ if (OCBindResourceInterfaceToResource(NotificationTopicResource.handle,
+ NS_INTERFACE_READWRITE)
+ != OC_STACK_OK)