1 //******************************************************************
\r
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
\r
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
7 // Licensed under the Apache License, Version 2.0 (the "License");
\r
8 // you may not use this file except in compliance with the License.
\r
9 // You may obtain a copy of the License at
\r
11 // http://www.apache.org/licenses/LICENSE-2.0
\r
13 // Unless required by applicable law or agreed to in writing, software
\r
14 // distributed under the License is distributed on an "AS IS" BASIS,
\r
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 // See the License for the specific language governing permissions and
\r
17 // limitations under the License.
\r
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
21 #include "NSProviderTopic.h"
\r
23 NSTopicList * NSGetTopics(char *consumerId)
\r
25 NS_LOG(DEBUG, "NSGetTopics()");
\r
27 NSTopicList * topicList;
\r
29 if(consumerId == NULL)
\r
31 NS_LOG(DEBUG, "All registered topic list");
\r
35 NS_LOG_V(DEBUG, "Subscribed topic list for consumerId(%s)", consumerId);
\r
38 NS_LOG(DEBUG, "NSGetTopics() NS_OK");
\r
42 bool NSIsTopicSubscribed(char * consumerId, char * topic)
\r
44 //TODO: implement function
\r
48 void * NSTopicSchedule(void * ptr)
\r
52 NS_LOG(DEBUG, "Create NSTopicSchedule");
\r
55 while (NSIsRunning[TOPIC_SCHEDULER])
\r
57 sem_wait(&NSSemaphore[TOPIC_SCHEDULER]);
\r
58 pthread_mutex_lock(&NSMutex[TOPIC_SCHEDULER]);
\r
60 if (NSHeadMsg[TOPIC_SCHEDULER] != NULL)
\r
62 NSTask *node = NSHeadMsg[TOPIC_SCHEDULER];
\r
63 NSHeadMsg[TOPIC_SCHEDULER] = node->nextTask;
\r
65 switch (node->taskType)
\r
67 case TASK_SEND_TOPICS:
\r
68 NS_LOG(DEBUG, "CASE TASK_SEND_TOPICS : ");
\r
70 case TASK_SUBSCRIBE_TOPICS:
\r
71 NS_LOG(DEBUG, "CASE TASK_SUBSCRIBE_TOPICS : ");
\r
73 case TASK_REGISTER_TOPICS:
\r
74 NS_LOG(DEBUG, "CASE TASK_REGISTER_TOPICS : ");
\r
83 pthread_mutex_unlock(&NSMutex[TOPIC_SCHEDULER]);
\r
86 NS_LOG(DEBUG, "Destroy NSTopicSchedule");
\r