projects
/
platform
/
upstream
/
iotivity.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 0.9.2
[platform/upstream/iotivity.git]
/
service
/
notification-manager
/
SampleApp
/
tizen
/
NMSampleApp
/
src
/
main.cpp
diff --git
a/service/notification-manager/SampleApp/tizen/NMSampleApp/src/main.cpp
b/service/notification-manager/SampleApp/tizen/NMSampleApp/src/main.cpp
index
8ec9645
..
227772b
100644
(file)
--- a/
service/notification-manager/SampleApp/tizen/NMSampleApp/src/main.cpp
+++ b/
service/notification-manager/SampleApp/tizen/NMSampleApp/src/main.cpp
@@
-46,16
+46,15
@@
static void start_hosting(int seconds)
logMessage = logMessage + "Interface Name : " + reinterpret_cast<char *>(interfaceName) + "<br>";
printLog(DLOG_INFO, logMessage);
logMessage = logMessage + "Interface Name : " + reinterpret_cast<char *>(interfaceName) + "<br>";
printLog(DLOG_INFO, logMessage);
- if (O
CInit((char *) NULL, 0, OC_CLIENT_SERVER
) != OC_STACK_OK)
+ if (O
ICStartCoordinate(
) != OC_STACK_OK)
{
{
- logMessage = "O
CStack init error
<br>";
+ logMessage = "O
ICStartCoordinate FAILED
<br>";
printLog(DLOG_ERROR, logMessage);
return;
}
printLog(DLOG_ERROR, logMessage);
return;
}
- OICStartCoordinate();
g_quitFlag = 0;
g_quitFlag = 0;
- logMessage = "OICStartCoordinate done successfully";
+ logMessage = "OICStartCoordinate done successfully
<br>
";
printLog(DLOG_INFO, logMessage);
while (!g_quitFlag)
printLog(DLOG_INFO, logMessage);
while (!g_quitFlag)
@@
-70,15
+69,13
@@
static void start_hosting(int seconds)
sleep(seconds);
}
sleep(seconds);
}
- OICStopCoordinate();
- logMessage = "OICStopCoordinate done successfully <br>";
- printLog(DLOG_INFO, logMessage);
-
- if (OCStop() != OC_STACK_OK)
+ if (OICStopCoordinate() != OC_STACK_OK)
{
{
- logMessage = "O
CStack stop error
<br>";
+ logMessage = "O
ICStopCoordinate FAILED
<br>";
printLog(DLOG_ERROR, logMessage);
}
printLog(DLOG_ERROR, logMessage);
}
+ logMessage = "OICStopCoordinate done successfully <br>";
+ printLog(DLOG_INFO, logMessage);
LOGI("start EXIT");
}
LOGI("start EXIT");
}
@@
-88,7
+85,15
@@
void stop_hosting()
string logMessage = "Terminating Resource Hosting <br>";
printLog(DLOG_INFO, logMessage);
string logMessage = "Terminating Resource Hosting <br>";
printLog(DLOG_INFO, logMessage);
- g_quitFlag = 1;
+ if(!g_quitFlag)
+ {
+ g_quitFlag = 1;
+ }
+ else
+ {
+ string logMessage = "Resource Hosting already terminated <br>";
+ printLog(DLOG_INFO, logMessage);
+ }
LOGI("stop_hosting EXIT");
}
LOGI("stop_hosting EXIT");
}