Modify PPM linux sample application
authorYounghyunJoo <yh_.joo@samsung.com>
Fri, 17 Apr 2015 06:14:37 +0000 (15:14 +0900)
committerUze Choi <uzchoi@samsung.com>
Mon, 20 Apr 2015 10:26:42 +0000 (10:26 +0000)
After CA merging, it has not find resource problem.
Fix this error.

Change-Id: I0e76e1a0c7523d3ac47bab6e06236fa662274e8b
Signed-off-by: YounghyunJoo <yh_.joo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/762
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/protocol-plugin/sample-app/linux/mqtt/mqttclient.cpp

index 67119d9..679667f 100644 (file)
@@ -350,6 +350,7 @@ int main(int argc, char *argv[])
     std::string key = "Name";
     std::string  state = "";
     std::string  id = "";
+    std::ostringstream requestURI;
 
     if (argc == 1)
     {
@@ -392,7 +393,8 @@ int main(int argc, char *argv[])
         // makes it so that all boolean values are printed as 'true/false' in this stream
         std::cout.setf(std::ios::boolalpha);
         // Find all resources
-        OCPlatform::findResource("", "coap://224.0.1.187/oc/core?rt=core.fan", OC_WIFI, &foundResourceFan);
+        requestURI << OC_WELL_KNOWN_QUERY << "?rt=core.fan";
+        OCPlatform::findResource("", requestURI.str(), OC_WIFI, &foundResourceFan);
         std::cout << "Finding Resource... " << std::endl;
         while (true)
         {