From 06d09a4f3980c7131eb25bf7e52278875710df43 Mon Sep 17 00:00:00 2001 From: ChaJiwon Date: Fri, 25 Sep 2015 13:24:08 +0900 Subject: [PATCH] fixed the jira IOT-742 Temperature Resource Creation Fail - modify temperature resourceType (core.TemperatrueSensor -> oic.r.temperaturesensor) Change-Id: Icbb9402055ae09e2e732a85a31ef1e1a81c46b44 Signed-off-by: ChaJiwon Reviewed-on: https://gerrit.iotivity.org/gerrit/3077 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- .../examples/linux/SampleResourceClient.cpp | 2 +- .../examples/linux/SampleResourceServer.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/service/resource-encapsulation/examples/linux/SampleResourceClient.cpp b/service/resource-encapsulation/examples/linux/SampleResourceClient.cpp index 1f9db08..9fb178d 100644 --- a/service/resource-encapsulation/examples/linux/SampleResourceClient.cpp +++ b/service/resource-encapsulation/examples/linux/SampleResourceClient.cpp @@ -416,7 +416,7 @@ void discoverResource() switch (processUserInput()) { case REQUEST_TEMP: - resourceType = "core.TemperatureSensor"; + resourceType = "oic.r.temperaturesensor"; break; case REQUEST_LIGHT: resourceType = "core.light"; diff --git a/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp b/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp index 983b375..2097b03 100644 --- a/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp +++ b/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp @@ -50,7 +50,7 @@ constexpr int QUIT = 3; std::string resourceUri = "/a/TempSensor"; -std::string resourceType = "core.TemperatureSensor"; +std::string resourceType = "oic.r.temperaturesensor"; std::string resourceInterface = "oic.if."; std::string attributeKey = "Temperature"; int isPresenceOn = PRESENCE_ON; @@ -145,7 +145,7 @@ void initServer() { case REQUEST_TEMP: resourceUri = "/a/TempSensor"; - resourceType = "core.TemperatureSensor"; + resourceType = "oic.r.temperaturesensor"; break; case REQUEST_LIGHT: resourceUri = "/a/light"; @@ -301,7 +301,7 @@ void process() while(true) { - if(resourceType == "core.TemperatureSensor") + if(resourceType == "oic.r.temperaturesensor") { displayControlTemperatureMenu(); if (selectControlTemperatureMenu() == QUIT) return; @@ -320,15 +320,15 @@ int main(void) { process(); server = NULL; + + if(isPresenceOn == PRESENCE_ON) + { + stopPresence(); + } } catch (const std::exception& e) { std::cout << "main exception : " << e.what() << std::endl; } - - if(isPresenceOn == PRESENCE_ON) - { - stopPresence(); - } std::cout << "Stopping the Server" << std::endl; } -- 2.7.4