while scons builds, cloud service code is
not required without WITH_CLOUD option in scons options.
It was modified as follows, #ifdef WITH_CLOUD #endif in code.
we should modify cpp_wrapper layer.
so, this commit makes the related build script of cpp_wrapper being commented out.
Change-Id: I9172b32e9242cc8d9ed038f024437dbd3b28da43
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9921
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
if not env.get('RELEASE'):
notification_env.PrependUnique(LIBS = ['gcov'])
notification_env.AppendUnique(CCFLAGS = ['--coverage'])
if not env.get('RELEASE'):
notification_env.PrependUnique(LIBS = ['gcov'])
notification_env.AppendUnique(CCFLAGS = ['--coverage'])
+
+if env.get('WITH_CLOUD') == True:
+ notification_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
######################################################################
# Source files and Targets
######################################################################
# Source files and Targets
'service/notification', 'NSConsumerInterface.h')
# Go to build Unit test
'service/notification', 'NSConsumerInterface.h')
# Go to build Unit test
-# if target_os == 'linux':
-#SConscript('unittest/SConscript')
+if target_os == 'linux':
+ SConscript('unittest/SConscript')
# Go to build sample apps
SConscript('examples/SConscript')
# Go to build sample apps
SConscript('examples/SConscript')
SConscript('android/SConscript')
# Go to build c++ wrapper
SConscript('android/SConscript')
# Go to build c++ wrapper
-SConscript('cpp-wrapper/SConscript')
\ No newline at end of file
+#SConscript('cpp-wrapper/SConscript')
\ No newline at end of file
printf("NS_APP Sync State: %d\n", sync->state);\r
}\r
\r
printf("NS_APP Sync State: %d\n", sync->state);\r
}\r
\r
OCStackApplicationResult CloudLoginoutCallback(void *ctx,\r
OCDoHandle handle, OCClientResponse *clientResponse)\r
{\r
OCStackApplicationResult CloudLoginoutCallback(void *ctx,\r
OCDoHandle handle, OCClientResponse *clientResponse)\r
{\r
\r
return OC_STACK_KEEP_TRANSACTION;\r
}\r
\r
return OC_STACK_KEEP_TRANSACTION;\r
}\r
\r
FILE* server_fopen(const char *path, const char *mode)\r
{\r
\r
FILE* server_fopen(const char *path, const char *mode)\r
{\r
printf("Session Code: ");\r
gets(REMOTE_SERVER_SESSION);\r
\r
printf("Session Code: ");\r
gets(REMOTE_SERVER_SESSION);\r
\r
NSCloudLogin(REMOTE_SERVER_ADDRESS, REMOTE_SERVER_SESSION, CloudLoginoutCallback);\r
NSCloudLogin(REMOTE_SERVER_ADDRESS, REMOTE_SERVER_SESSION, CloudLoginoutCallback);\r
printf("OCCloudLogin requested");\r
break;\r
case 12:\r
printf("NSCloudLogout");\r
printf("OCCloudLogin requested");\r
break;\r
case 12:\r
printf("NSCloudLogout");\r
NSCloudLogout(REMOTE_SERVER_ADDRESS, REMOTE_SERVER_SESSION, CloudLoginoutCallback);\r
NSCloudLogout(REMOTE_SERVER_ADDRESS, REMOTE_SERVER_SESSION, CloudLoginoutCallback);\r
printf("OCCloudLogout requested");\r
break;\r
case 0:\r
printf("OCCloudLogout requested");\r
break;\r
case 0:\r
NS_LOG(DEBUG, "CASE TASK_REGISTER_RESOURCE : ");\r
NSRegisterResource();\r
break;\r
NS_LOG(DEBUG, "CASE TASK_REGISTER_RESOURCE : ");\r
NSRegisterResource();\r
break;\r
case TASK_PUBLISH_RESOURCE:\r
NS_LOG(DEBUG, "CASE TASK_PUBLISH_PESOURCE : ");\r
NSPublishResourceToCloud((char*)node->taskData);\r
break;\r
case TASK_PUBLISH_RESOURCE:\r
NS_LOG(DEBUG, "CASE TASK_PUBLISH_PESOURCE : ");\r
NSPublishResourceToCloud((char*)node->taskData);\r
break;\r
NSResult NSProviderEnableRemoteService(char *serverAddress)\r
{\r
NS_LOG(DEBUG, "NSProviderEnableRemoteService - IN");\r
NSResult NSProviderEnableRemoteService(char *serverAddress)\r
{\r
NS_LOG(DEBUG, "NSProviderEnableRemoteService - IN");\r
NS_LOG(DEBUG, "NSProviderDisableRemoteService - OUT");\r
return NS_OK;\r
}\r
NS_LOG(DEBUG, "NSProviderDisableRemoteService - OUT");\r
return NS_OK;\r
}\r
\r
NSResult NSSendMessage(NSMessage *msg)\r
{\r
\r
NSResult NSSendMessage(NSMessage *msg)\r
{\r
obArray[obCount++] = subData->messageObId;
}
obArray[obCount++] = subData->messageObId;
}
if(subData->remote_messageObId != 0)
{
obArray[obCount++] = subData->remote_messageObId;
}
if(subData->remote_messageObId != 0)
{
obArray[obCount++] = subData->remote_messageObId;
}
obArray[obCount++] = subData->syncObId;
}
obArray[obCount++] = subData->syncObId;
}
if(subData->remote_syncObId != 0)
{
obArray[obCount++] = subData->remote_syncObId;
}
if(subData->remote_syncObId != 0)
{
obArray[obCount++] = subData->remote_syncObId;
}
NSMessageResource NotificationMessageResource;
NSSyncResource NotificationSyncResource;
NSMessageResource NotificationMessageResource;
NSSyncResource NotificationSyncResource;
OCStackApplicationResult NSHandlePublishCb(void *ctx, OCDoHandle handle,
OCClientResponse *clientResponse)
{
OCStackApplicationResult NSHandlePublishCb(void *ctx, OCDoHandle handle,
OCClientResponse *clientResponse)
{
NS_LOG(DEBUG, "NSPublishResourceToCloud - OUT");
return NS_OK;
}
NS_LOG(DEBUG, "NSPublishResourceToCloud - OUT");
return NS_OK;
}
NSResult NSCreateResource(char *uri)
{
NSResult NSCreateResource(char *uri)
{
NS_LOG_V(DEBUG, "SubList ID = [%s]", subData->id);\r
\r
NS_LOG_V(DEBUG, "Consumer Address: %s", entityHandlerRequest->devAddr.addr);\r
NS_LOG_V(DEBUG, "SubList ID = [%s]", subData->id);\r
\r
NS_LOG_V(DEBUG, "Consumer Address: %s", entityHandlerRequest->devAddr.addr);\r
- if(NSIsRemoteServerAddress(entityHandlerRequest->devAddr.addr))\r
+\r
+ subData->remote_messageObId = subData->messageObId = 0;\r
+\r
+ bool iSRemoteServer = false;\r
+\r
+#ifdef WITH_CLOUD\r
+ iSRemoteServer = NSIsRemoteServerAddress(entityHandlerRequest->devAddr.addr);\r
+ if(iSRemoteServer)\r
{\r
NS_LOG(DEBUG, "Requested by remote server");\r
subData->remote_messageObId = entityHandlerRequest->obsInfo.obsId;\r
{\r
NS_LOG(DEBUG, "Requested by remote server");\r
subData->remote_messageObId = entityHandlerRequest->obsInfo.obsId;\r
- subData->messageObId = 0;\r
NS_LOG_V(DEBUG, "SubList message observation ID = [%d]", subData->remote_messageObId);\r
}\r
NS_LOG_V(DEBUG, "SubList message observation ID = [%d]", subData->remote_messageObId);\r
}\r
+#endif\r
+\r
+ if(!iSRemoteServer)\r
{\r
NS_LOG(DEBUG, "Requested by local consumer");\r
subData->messageObId = entityHandlerRequest->obsInfo.obsId;\r
{\r
NS_LOG(DEBUG, "Requested by local consumer");\r
subData->messageObId = entityHandlerRequest->obsInfo.obsId;\r
- subData->remote_messageObId = 0;\r
NS_LOG_V(DEBUG, "SubList message observation ID = [%d]", subData->messageObId);\r
}\r
NS_LOG_V(DEBUG, "SubList message observation ID = [%d]", subData->messageObId);\r
}\r
subData->isWhite = false;\r
subData->remote_syncObId = 0;\r
subData->syncObId = 0;\r
subData->isWhite = false;\r
subData->remote_syncObId = 0;\r
subData->syncObId = 0;\r
NS_LOG_V(DEBUG, "SubList ID = [%s]", subData->id);\r
\r
NS_LOG_V(DEBUG, "Consumer Address: %s", entityHandlerRequest->devAddr.addr);\r
NS_LOG_V(DEBUG, "SubList ID = [%s]", subData->id);\r
\r
NS_LOG_V(DEBUG, "Consumer Address: %s", entityHandlerRequest->devAddr.addr);\r
- if(NSIsRemoteServerAddress(entityHandlerRequest->devAddr.addr))\r
+\r
+ subData->remote_syncObId = subData->syncObId = 0;\r
+ bool isRemoteServer = false;\r
+\r
+#ifdef WITH_CLOUD\r
+ isRemoteServer = NSIsRemoteServerAddress(entityHandlerRequest->devAddr.addr);\r
+ if(isRemoteServer)\r
{\r
NS_LOG(DEBUG, "Requested by remote server");\r
subData->remote_syncObId = entityHandlerRequest->obsInfo.obsId;\r
{\r
NS_LOG(DEBUG, "Requested by remote server");\r
subData->remote_syncObId = entityHandlerRequest->obsInfo.obsId;\r
- subData->syncObId = 0;\r
NS_LOG_V(DEBUG, "SubList sync observation ID = [%d]", subData->remote_syncObId);\r
}\r
NS_LOG_V(DEBUG, "SubList sync observation ID = [%d]", subData->remote_syncObId);\r
}\r
+#endif\r
+\r
+ if(!isRemoteServer)\r
{\r
NS_LOG(DEBUG, "Requested by local consumer");\r
subData->syncObId = entityHandlerRequest->obsInfo.obsId;\r
{\r
NS_LOG(DEBUG, "Requested by local consumer");\r
subData->syncObId = entityHandlerRequest->obsInfo.obsId;\r
- subData->remote_syncObId = 0;\r
NS_LOG_V(DEBUG, "SubList sync observation ID = [%d]", subData->syncObId);\r
}\r
\r
NS_LOG_V(DEBUG, "SubList sync observation ID = [%d]", subData->syncObId);\r
}\r
\r
return NSProviderConnectionState;\r
}\r
\r
return NSProviderConnectionState;\r
}\r
\r
void NSSetRemoteServerAddress(char *serverAddress)\r
{\r
\r
void NSSetRemoteServerAddress(char *serverAddress)\r
{\r
\r
\r
void NSInitProviderInfo()\r
{\r
\r
void NSInitProviderInfo()\r
{\r