bug fixes for samle App, initialize code for Subscription. 79/10579/2
authorjaesick.shin <jaesick.shin@samsung.com>
Thu, 18 Aug 2016 05:41:24 +0000 (14:41 +0900)
committerUze Choi <uzchoi@samsung.com>
Thu, 18 Aug 2016 10:55:15 +0000 (10:55 +0000)
1. startProvider invalid set in sample App.
2. not initialize observe ids of subscription list.

Change-Id: I91551ac3b6a6b1b19d98a6ed9ab0e4ec5563c661
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10579
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification/examples/linux/notificationprovider.c
service/notification/src/provider/NSProviderSubscription.c

index e300564..d2f348c 100644 (file)
@@ -164,7 +164,7 @@ int main()
     int num;\r
     pthread_t processThread;\r
 \r
-    printf("NSStartProvider()");\r
+    printf("NSStartProvider()\n\n");\r
 \r
     // open oic_db\r
     static OCPersistentStorage ps = {server_fopen, fread, fwrite, fclose, unlink};\r
@@ -212,7 +212,7 @@ int main()
             {\r
                 printf("NSStartProvider(Accepter: Provider)");\r
                 NSProviderConfig config;\r
-                config.policy = false;\r
+                config.policy = true;\r
                 config.subRequestCallback = subscribeRequestCallback;\r
                 config.syncInfoCallback = syncCallback;\r
                 config.userInfo = OICStrdup("OCF_NOTIFICATION");\r
index 8f5f355..b9b3592 100644 (file)
@@ -319,6 +319,9 @@ NSResult NSSendSubscriptionResponse(OCEntityHandlerRequest *entityHandlerRequest
         OICStrcpy(subData->id, UUID_STRING_SIZE, id);\r
 \r
         subData->isWhite = true;\r
+        subData->remote_messageObId = 0;\r
+        subData->remote_syncObId = 0;\r
+        subData->syncObId = 0;\r
         subData->messageObId = entityHandlerRequest->obsInfo.obsId;\r
 \r
         element->data = (void*) subData;\r