Imported Upstream version 0.9.2
[platform/upstream/iotivity.git] / resource / examples / presenceclient.cpp
index 305bfe5..3755b57 100644 (file)
@@ -35,7 +35,7 @@ std::shared_ptr<OCResource> curResource;
 std::mutex resourceLock;
 static int TEST_CASE = 0;
 
-static OCConnectivityType connectivityType = OC_IPV4;
+static OCConnectivityType connectivityType = CT_ADAPTER_IP;
 
 /**
  * List of methods that can be inititated from the client
@@ -63,9 +63,8 @@ void printUsage()
               << std::endl;
     std::cout << "-t 6 : Discover Resources and Initiate Multicast Presence with two Filters"
             << std::endl;
-    std::cout<<"ConnectivityType: Default IPv4" << std::endl;
-    std::cout << "-c 0 : Send message with IPv4" << std::endl;
-    std::cout << "-c 1 : Send message with IPv6" << std::endl;
+    std::cout<<"ConnectivityType: Default IP" << std::endl;
+    std::cout << "-c 0 : Send message with IP" << std::endl;
 }
 
 // Callback to presence
@@ -221,26 +220,18 @@ int main(int argc, char* argv[]) {
                     {
                         if(optionSelected == 0)
                         {
-                            connectivityType = OC_IPV4;
-                        }
-                        else if(optionSelected == 1)
-                        {
-                            // TODO: re-enable IPv4/IPv6 command line selection when IPv6
-                            // is supported
-                            //connectivityType = OC_IPV6;
-                            connectivityType = OC_IPV4;
-                            std::cout << "IPv6 not currently supported. Using default IPv4"
-                                    << std::endl;
+                            std::cout << "Using IP."<< std::endl;
+                            connectivityType = CT_ADAPTER_IP;
                         }
                         else
                         {
-                            std::cout << "Invalid connectivity type selected. Using default IPv4"
+                            std::cout << "Invalid connectivity type selected. Using default IP"
                                 << std::endl;
                         }
                     }
                     else
                     {
-                        std::cout << "Invalid connectivity type selected. Using default IPv4"
+                        std::cout << "Invalid connectivity type selected. Using default IP"
                             << std::endl;
                     }
                     break;
@@ -252,7 +243,7 @@ int main(int argc, char* argv[]) {
     }
     catch(std::exception& )
     {
-        std::cout << "Invalid input argument. Using IPv4 as connectivity type"
+        std::cout << "Invalid input argument. Using IP as connectivity type"
             << std::endl;
     }
 
@@ -340,10 +331,10 @@ int main(int argc, char* argv[]) {
         else
         {
             // Find all resources
-            requestURI << OC_MULTICAST_DISCOVERY_URI;
+            requestURI << OC_RSRVD_WELL_KNOWN_URI;
 
             result = OCPlatform::findResource("", requestURI.str(),
-                    OC_ALL, &foundResource);
+                    CT_DEFAULT, &foundResource);
             if(result == OC_STACK_OK)
             {
                 std::cout << "Finding Resource... " << std::endl;