Changed client data format in listener_cb 34/82334/1
authorkmook <kmook.choi@samsung.com>
Wed, 3 Aug 2016 03:28:16 +0000 (12:28 +0900)
committerkmook <kmook.choi@samsung.com>
Wed, 3 Aug 2016 03:28:16 +0000 (12:28 +0900)
Change-Id: Iac0ad6ec6f9a163717badb2054d48bed9ebad456
Signed-off-by: kmook <kmook.choi@samsung.com>
common/Types.h
daemon/service_provider/AppCommServiceInfo.h
daemon/service_provider/AppCommServiceProvider.cpp

index 4eadafe..38b99d0 100644 (file)
@@ -151,6 +151,9 @@ enum request_type {
 #define CONV_JSON_CHANNEL_URI                  "channelUri"
 #define CONV_JSON_CLIENT_LIST                  "client_list"
 #define CONV_JSON_ERROR_MESSAGE                        "error_message"
+#define CONV_JSON_CLIENT_IS_HOST               "client_is_host"
+#define CONV_JSON_CLIENT_CONNECT_TIME  "client_connect_time"
+#define CONV_JSON_CLIENT_CLIENT_ID             "client_id"
 
 #define CONV_JSON_ON_START                             "onStart"
 #define CONV_JSON_ON_CONNECT                   "onConnect"
index 32cff12..2c2e58c 100755 (executable)
@@ -225,16 +225,12 @@ namespace conv {
                                        _D(RED("publishing_response"));
                                        Json result;
                                        Json payload;
-                                       Json client_json;
                                        Json description;
 
-                                       client_json.set(NULL, CONV_JSON_IS_HOST, isHost);
-                                       client_json.set(NULL, CONV_JSON_CONNECT_TIME, connecttime);
-                                       client_json.set(NULL, CONV_JSON_CLIENT_ID, client->getId());
-
                                        payload.set(NULL, CONV_JSON_RESULT_TYPE, result_type);
-//                                     payload.set(NULL, CONV_JSON_CLIENT, client_json);
-                                       payload.set(NULL, CONV_JSON_CLIENT, client_json.dupCstr());
+                                       payload.set(NULL, CONV_JSON_CLIENT_IS_HOST, isHost);
+                                       payload.set(NULL, CONV_JSON_CLIENT_CONNECT_TIME, connecttime);
+                                       payload.set(NULL, CONV_JSON_CLIENT_CLIENT_ID, client->getId());
 
                                        description = (*requestObj)->getDescription();
 
index 0bb9413..d9c1016 100755 (executable)
@@ -356,7 +356,7 @@ int conv::AppCommServiceProvider::readRequest(Request* requestObj)
                                                        client.set(NULL, CONV_JSON_CHANNEL_URI, cha->getChannelUri(NULL).c_str());
 
 //                                             result.appendArray(NULL, CONV_JSON_CLIENT_LIST, client);
-                                               result.appendArray(NULL, CONV_JSON_CLIENT_LIST, client.dupCstr());
+                                               result.set(NULL, CONV_JSON_CLIENT_LIST, client.dupCstr());
                                        }
                                        sendReadResponse(result, CONV_JSON_GET_CLIENTS, CONV_ERROR_NONE, svcInfo->registeredRequest);