Fix bug for sample and remove unused functions.
authorKIM JungYong <jyong2.kim@samsung.com>
Sun, 4 Sep 2016 07:36:47 +0000 (16:36 +0900)
committerUze Choi <uzchoi@samsung.com>
Tue, 6 Sep 2016 10:27:34 +0000 (10:27 +0000)
1) Bug of consumer sample app is fixed.
2) Unused function of consumer service is removed.

Change-Id: Idc7f7decdde34d8067177d84410af979f173a279
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11361
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification/examples/linux/notificationconsumer.c
service/notification/src/consumer/NSConsumerCommon.c
service/notification/src/consumer/NSConsumerCommon.h

index 3d96209..5a77ea0 100644 (file)
@@ -73,7 +73,7 @@ void onProviderChanged(NSProvider * provider, NSProviderState response)
     if (response == NS_DISCOVERED)
     {
         printf("notification resource discovered\n");
-        printf("subscribe result %d\n", NSSubscribe(provider));
+        printf("subscribe result %d\n", NSSubscribe(provider->providerId));
         printf("startSubscribing\n");
     }
 
index 3f00281..bc80124 100644 (file)
@@ -475,33 +475,6 @@ void NSRemoveProvider(NSProvider * prov)
     NSOICFree(prov);
 }
 
-NSSyncInfo_internal * NSCopySyncInfo(NSSyncInfo_internal * syncInfo)
-{
-    NS_VERIFY_NOT_NULL(syncInfo, NULL);
-
-    NSProviderConnectionInfo * connections = NSCopyProviderConnections(syncInfo->connection);
-    NS_VERIFY_NOT_NULL(connections, NULL);
-
-    NSSyncInfo_internal * newSyncInfo = (NSSyncInfo_internal *)OICMalloc(sizeof(NSSyncInfo_internal));
-    NS_VERIFY_NOT_NULL_WITH_POST_CLEANING(newSyncInfo, NULL, NSRemoveConnections(connections));
-
-    OICStrcpy(newSyncInfo->providerId, sizeof(char) * NS_DEVICE_ID_LENGTH, syncInfo->providerId);
-    newSyncInfo->messageId = syncInfo->messageId;
-    newSyncInfo->state = syncInfo->state;
-    newSyncInfo->connection = connections;
-
-    return newSyncInfo;
-}
-
-void NSRemoveSyncInfo(NSSyncInfo_internal * syncInfo)
-{
-    NS_VERIFY_NOT_NULL_V(syncInfo);
-
-    NSRemoveConnections(syncInfo->connection);
-
-    NSOICFree(syncInfo);
-}
-
 OCStackResult NSInvokeRequest(OCDoHandle * handle,
         OCMethod method, const OCDevAddr * addr,
         const char * queryUrl, OCPayload * payload,
index b386281..ea1dea8 100644 (file)
@@ -137,9 +137,6 @@ NSProvider * NSCopyProvider(NSProvider_internal *);
 void NSRemoveProvider_internal(NSProvider_internal *);
 void NSRemoveProvider(NSProvider *);
 
-NSSyncInfo_internal * NSCopySyncInfo(NSSyncInfo_internal *);
-void NSRemoveSyncInfo(NSSyncInfo_internal *);
-
 NSTopicLL * NSCopyTopicNode(NSTopicLL *);
 void NSRemoveTopicNode(NSTopicLL *);
 NSResult NSInsertTopicNode(NSTopicLL *, NSTopicLL *);