From: Anisha Aggarwal Date: Tue, 23 Aug 2016 21:02:06 +0000 (-0700) Subject: Port simpleserverHQ and simpleclientHQ to Windows X-Git-Tag: 1.2.0+RC3~230 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0b9d913da33348286ab6fa94127a5106b344fbf;p=platform%2Fupstream%2Fiotivity.git Port simpleserverHQ and simpleclientHQ to Windows Change-Id: I481987321f27b52780d6c907886dd1d1276039c8 Signed-off-by: Anisha Aggarwal Reviewed-on: https://gerrit.iotivity.org/gerrit/10829 Reviewed-by: David Antler Tested-by: jenkins-iotivity Reviewed-by: Jon A. Cruz --- diff --git a/resource/examples/SConscript b/resource/examples/SConscript index ba49690..5dc7ff5 100644 --- a/resource/examples/SConscript +++ b/resource/examples/SConscript @@ -95,12 +95,12 @@ example_names = [ 'simpleserver', 'simpleclient', 'simpleclientserver', 'directpairingclient', - 'devicediscoveryserver', 'devicediscoveryclient' + 'devicediscoveryserver', 'devicediscoveryclient', + 'simpleserverHQ', 'simpleclientHQ', ] if target_os not in ['windows', 'msys_nt']: example_names += [ - 'simpleserverHQ', 'simpleclientHQ', 'fridgeserver', 'fridgeclient', 'presenceserver', 'presenceclient', 'roomserver', 'roomclient', diff --git a/resource/examples/simpleclientHQ.cpp b/resource/examples/simpleclientHQ.cpp index b8a571c..be585fc 100644 --- a/resource/examples/simpleclientHQ.cpp +++ b/resource/examples/simpleclientHQ.cpp @@ -23,7 +23,9 @@ #include #include #include +#ifdef HAVE_PTHREAD_H #include +#endif #include #include #include "OCPlatform.h" @@ -220,7 +222,7 @@ void postLightRepresentation(std::shared_ptr resource) // callback handler on PUT request void onPut(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode) { - if(eCode == SUCCESS_RESPONSE) + if(eCode == SUCCESS_RESPONSE || eCode == OC_STACK_RESOURCE_CHANGED) { std::cout << "PUT request was successful" << std::endl; diff --git a/resource/examples/simpleserverHQ.cpp b/resource/examples/simpleserverHQ.cpp index 607b45f..3adef4e 100644 --- a/resource/examples/simpleserverHQ.cpp +++ b/resource/examples/simpleserverHQ.cpp @@ -25,7 +25,9 @@ #include +#ifdef HAVE_PTHREAD_H #include +#endif #include #include diff --git a/run.bat b/run.bat index 717429f..861d851 100644 --- a/run.bat +++ b/run.bat @@ -68,7 +68,13 @@ if "!CURRENT_ARG!"=="server" ( ) else if "!CURRENT_ARG!"=="client" ( cd %BUILD_DIR%\resource\examples %DEBUG% simpleclient.exe -) else if "!CURRENT_ARG!"=="mediaclient" ( +) else if "!CURRENT_ARG!"=="serverhq" ( + cd %BUILD_DIR%\resource\examples + %DEBUG% simpleserverHQ.exe +) else if "!CURRENT_ARG!"=="clienthq" ( + cd %BUILD_DIR%\resource\examples + %DEBUG% simpleclientHQ.exe +)else if "!CURRENT_ARG!"=="mediaclient" ( cd %BUILD_DIR%\resource\examples %DEBUG% mediaclient.exe ) else if "!CURRENT_ARG!"=="mediaserver" (