When consumer service get topic to provider, consumer id is excepted.
Consumer id is added on request get topic.
linux sample app is updated for print topic.
Change-Id: I383c2032856e034e80241cc49b1601fece04d230
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11625
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
if(g_provider)
{
g_topicLL = NSConsumerGetTopicList(g_provider->providerId);
+ printProviderTopicList(g_topicLL);
}
break;
case 4:
while (iter)
{
iter->state = (i++)%2;
- printf("Topic Name: %s\t Topic State: %d\n", iter->topicName, iter->state);
iter = iter->next;
}
- NSConsumerUpdateTopicList(g_provider->providerId, g_topicLL);
+ NSResult ret = NSConsumerUpdateTopicList(g_provider->providerId, g_topicLL);
+ if (ret == NS_OK)
+ {
+ printProviderTopicList(g_topicLL);
+ }
+ else
+ {
+ printf("Update fail\n");
+ }
}
break;
case 5:
}
NS_LOG(DEBUG, "get topic query");
- char * query = NULL;
- if (task->taskType == TASK_CONSUMER_REQ_TOPIC_LIST)
- {
- query = OICStrdup(topicUri);
- }
- else if (task->taskType == TASK_CONSUMER_GET_TOPIC_LIST)
- {
- query = NSMakeRequestUriWithConsumerId(topicUri);
- }
+ char * query = NSMakeRequestUriWithConsumerId(topicUri);
+
NS_VERIFY_NOT_NULL_V(query);
NS_LOG_V(DEBUG, "topic query : %s", query);