User Tools

Site Tools


notification_service_-_programming_guide

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
notification_service_-_programming_guide [2017/01/09 03:36]
Chihyun Cho
notification_service_-_programming_guide [2017/04/06 14:17] (current)
Koenraad Verheyden Updated code samples to reflect current API.
Line 73: Line 73:
     printf("​NS_APP Consumer Device ID: %s\n", consumer->​consumerId);​     printf("​NS_APP Consumer Device ID: %s\n", consumer->​consumerId);​
  
-NSAcceptSubscription(consumer,​ true);+    ​NSAcceptSubscription(consumer->​consumerId, true);
 } }
 </​code>​ </​code>​
Line 148: Line 148:
 </​code>​ </​code>​
  
-**To subscribe interest topics**, first step is topic registration from provider application. Here the APIs, NSProviderAddTopic ​and NSProviderDeleteTopic, are used to register and deregister, respectively.+**To subscribe interest topics**, first step is topic registration from provider application. Here the APIs, NSProviderRegisterTopic ​and NSProviderUnregisterTopic, are used to register and deregister, respectively.
 <​code>​ <​code>​
 // Add and delete provider’s topic list // Add and delete provider’s topic list
 case 5: case 5:
     printf("​NSProviderAddTopic\n"​);​     printf("​NSProviderAddTopic\n"​);​
-    ​NSProviderAddTopic("​OCF_TOPIC1"​);​ +    ​NSProviderRegisterTopic("​OCF_TOPIC1"​);​ 
-    ​NSProviderAddTopic("​OCF_TOPIC2"​);​ +    ​NSProviderRegisterTopic("​OCF_TOPIC2"​);​ 
-    ​NSProviderAddTopic("​OCF_TOPIC3"​);​ +    ​NSProviderRegisterTopic("​OCF_TOPIC3"​);​ 
-    ​NSProviderAddTopic("​OCF_TOPIC4"​);​+    ​NSProviderRegisterTopic("​OCF_TOPIC4"​);​
     break;     break;
  
 case 6: case 6:
     printf("​NSProviderDeleteTopic\n"​);​     printf("​NSProviderDeleteTopic\n"​);​
-    ​NSProviderDeleteTopic("​OCF_TOPIC2"​);​+    ​NSProviderUnregisterTopic("​OCF_TOPIC2"​);​
     break;     break;
 </​code>​ </​code>​
Line 171: Line 171:
     if(g_provider)     if(g_provider)
     {     {
-        ​NSConsumerGetInterestTopics(g_provider);​+        ​g_topicLL = NSConsumerGetTopicList(g_provider->​providerId);
     }     }
     break;     break;
Line 179: Line 179:
     printf("​4. Select Topics\n"​);​     printf("​4. Select Topics\n"​);​
  
-    if (g_provider && ​g_provider->​topicLL)+    if (g_provider && ​g_topicLL)
     {     {
-        NSTopicLL * iter = g_provider->​topicLL;+        NSTopicLL * iter = g_topicLL;
         int i = 0;         int i = 0;
         while (iter)         while (iter)
Line 190: Line 190:
             iter = iter->​next;​             iter = iter->​next;​
         }         }
-    NSConsumerSelectInterestTopics(g_provider);​+        NSConsumerUpdateTopicList(g_provider->​providerId,​ g_topicLL);
     }     }
     break;     break;
notification_service_-_programming_guide.txt · Last modified: 2017/04/06 14:17 by Koenraad Verheyden