Merge branch 'master' into ra.to.merge
[contrib/iotivity.git] / resource / csdk / stack / samples / linux / SimpleClientServer / ocserver.cpp
index 66441a0..d8908ba 100644 (file)
@@ -932,15 +932,44 @@ int main(int argc, char* argv[])
 {
     pthread_t threadId;
     pthread_t threadId_presence;
-    int opt;
 
-    while ((opt = getopt(argc, argv, "o:")) != -1)
+#ifdef RA_ADAPTER
+    OCRAInfo_t rainfo = {.hostname = "localhost", .port = 5222,
+        .xmpp_domain = "localhost", .username = "test1", .password = "intel123",
+        .resource = "", .user_jid = ""};
+#endif
+
+    int opt = 0;
+    while ((opt = getopt(argc, argv, "o:s:p:d:u:w:r:j:")) != -1)
     {
         switch(opt)
         {
             case 'o':
                 gObserveNotifyType = atoi(optarg);
                 break;
+#ifdef RA_ADAPTER
+            case 's':
+                rainfo.hostname = optarg;
+                break;
+            case 'p':
+                rainfo.port = atoi(optarg);
+                break;
+            case 'd':
+                rainfo.xmpp_domain = optarg;
+                break;
+            case 'u':
+                rainfo.username = optarg;
+                break;
+            case 'w':
+                rainfo.password = optarg;
+                break;
+            case 'j':
+                rainfo.user_jid = optarg;
+                break;
+            case 'r':
+                rainfo.resource = optarg;
+                break;
+#endif
             default:
                 PrintUsage();
                 return -1;
@@ -952,6 +981,7 @@ int main(int argc, char* argv[])
         PrintUsage();
         return -1;
     }
+
 #ifdef RA_ADAPTER
     OCRAInfo_t rainfo;
     rainfo.hostname = "localhost";