Macro RD_CLIENT is replaced with WITH_CLOUD.
The codes related to cloud service is not compiled according to
the conditional compilation with the marcro.
modify topic notification filter for remote message
This patch is bug-fix which adds topic notification filter for remote msg.
Change-Id: Ib61957dac3a193706386be5e121e5efdb2bbada8
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11311
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
NS_LOG(DEBUG, "CASE TASK_REGISTER_RESOURCE : ");\r
NSRegisterResource();\r
break;\r
-#ifdef RD_CLIENT\r
+#if(defined WITH_CLOUD && defined RD_CLIENT)\r
case TASK_PUBLISH_RESOURCE:\r
NS_LOG(DEBUG, "CASE TASK_PUBLISH_PESOURCE : ");\r
NSPublishResourceToCloud((char*)node->taskData);\r
return NS_OK;\r
}\r
\r
-NSResult NSProviderEnableRemoteService(char * serverAddress)\r
+NSResult NSProviderEnableRemoteService(char *serverAddress)\r
{\r
+#if(defined WITH_CLOUD && defined RD_CLIENT)\r
NS_LOG(DEBUG, "NSProviderEnableRemoteService - IN");\r
pthread_mutex_lock(&nsInitMutex);\r
\r
pthread_mutex_unlock(&nsInitMutex);\r
return NS_FAIL;\r
}\r
- NS_LOG(DEBUG, "Check the remote server login");\r
NS_LOG_V(DEBUG, "Remote server address: %s", serverAddress);\r
-#ifdef RD_CLIENT\r
NS_LOG(DEBUG, "Request to publish resource");\r
NSPushQueue(DISCOVERY_SCHEDULER, TASK_PUBLISH_RESOURCE, serverAddress);\r
-#endif\r
\r
pthread_mutex_unlock(&nsInitMutex);\r
NS_LOG(DEBUG, "NSProviderEnableRemoteService - OUT");\r
return NS_OK;\r
+#endif\r
+ NS_LOG_V(DEBUG, "Not logged in remote server: %s", serverAddress);\r
+ return NS_FAIL;\r
}\r
\r
NSResult NSProviderDisableRemoteService(char *serverAddress)\r
{\r
+#if(defined WITH_CLOUD && defined RD_CLIENT)\r
NS_LOG(DEBUG, "NSProviderDisableRemoteService - IN");\r
pthread_mutex_lock(&nsInitMutex);\r
\r
return NS_FAIL;\r
}\r
NS_LOG_V(DEBUG, "Remote server address: %s", serverAddress);\r
-#ifdef RD_CLIENT\r
+\r
NS_LOG(DEBUG, "Delete remote server info");\r
NSDeleteRemoteServerAddress(serverAddress);\r
-#endif\r
\r
pthread_mutex_unlock(&nsInitMutex);\r
NS_LOG(DEBUG, "NSProviderDisableRemoteService - OUT");\r
return NS_OK;\r
+#endif\r
+ NS_LOG_V(DEBUG, "Not logged in remote server : %s", serverAddress);\r
+ return NS_FAIL;\r
}\r
\r
NSResult NSSendMessage(NSMessage * msg)\r
}
}
-#ifdef RD_CLIENT
+#if(defined WITH_CLOUD && defined RD_CLIENT)
if(subData->remote_messageObId != 0)
{
- if(NSProviderIsTopicSubScribed(consumerTopicList->head, subData->id, msg->topic))
+ if(msg->topic)
{
- obArray[obCount++] = subData->remote_messageObId;
+ NS_LOG_V(DEBUG, "this is topic message via remote server: %s", msg->topic);
+ if(NSProviderIsTopicSubScribed(consumerTopicList->head, subData->id, msg->topic))
+ {
+ obArray[obCount++] = subData->remote_messageObId;
+ }
}
else
{
obArray[obCount++] = subData->syncObId;
}
-#ifdef RD_CLIENT
+#if(defined WITH_CLOUD && defined RD_CLIENT)
if(subData->remote_syncObId != 0)
{
obArray[obCount++] = subData->remote_syncObId;
NSSyncResource NotificationSyncResource;
NSTopicResource NotificationTopicResource;
-#ifdef RD_CLIENT
+#if(defined WITH_CLOUD && defined RD_CLIENT)
#define DEFAULT_CONTEXT_VALUE 0x99
OCStackApplicationResult NSHandlePublishCb(void *ctx, OCDoHandle handle,
\r
bool iSRemoteServer = false;\r
\r
-#ifdef RD_CLIEND\r
+#if(defined WITH_CLOUD && defined RD_CLIENT)\r
iSRemoteServer = NSIsRemoteServerAddress(entityHandlerRequest->devAddr.addr);\r
if(iSRemoteServer)\r
{\r
subData->remote_syncObId = subData->syncObId = 0;\r
bool isRemoteServer = false;\r
\r
-#ifdef RD_CLIENT\r
+#if(defined WITH_CLOUD && defined RD_CLIENT)\r
isRemoteServer = NSIsRemoteServerAddress(entityHandlerRequest->devAddr.addr);\r
if(isRemoteServer)\r
{\r
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
#include "NSProviderSystem.h"\r
\r
+#if(defined WITH_CLOUD && defined RD_CLIENT)\r
#define MAX_SERVER_ADDRESS 32\r
-static NSConnectionState NSProviderConnectionState;\r
-\r
-#ifdef RD_CLIENT\r
static char NSRemoteServerAddress[MAX_SERVER_ADDRESS] = {0,};\r
#endif\r
\r
+static NSConnectionState NSProviderConnectionState;\r
+\r
NSProviderInfo * providerInfo;\r
bool NSPolicy = true;\r
\r
return NSProviderConnectionState;\r
}\r
\r
-#ifdef RD_CLIENT\r
+#if(defined WITH_CLOUD && defined RD_CLIENT)\r
void NSSetRemoteServerAddress(char *serverAddress)\r
{\r
\r
obArray[obCount++] = subData->messageObId;\r
}\r
\r
-#ifdef RD_CLIENT\r
+#if(defined WITH_CLOUD && defined RD_CLIENT)\r
if(subData->remote_messageObId != 0)\r
{\r
obArray[obCount++] = subData->remote_messageObId;\r
}\r
#endif\r
-\r
}\r
it = it->next;\r
}\r