Converted integer to string to get int data from payload 98/82398/1
authorkmook <kmook.choi@samsung.com>
Wed, 3 Aug 2016 06:27:21 +0000 (15:27 +0900)
committerkmook <kmook.choi@samsung.com>
Wed, 3 Aug 2016 06:27:21 +0000 (15:27 +0900)
Change-Id: I4610aa6c827cef5bab94e5644466d75008412f20
Signed-off-by: kmook <kmook.choi@samsung.com>
daemon/service_provider/AppCommServiceInfo.h
daemon/service_provider/AppCommServiceProvider.cpp
daemon/service_provider/RemoteAppControlServiceProvider.cpp

index 2c2e58c..d6041da 100755 (executable)
@@ -218,18 +218,18 @@ namespace conv {
 
                        void publishResponse(int error, string result_type, Client *client)
                        {
-                               bool isHost = client->isHost();
-                               int connecttime = client->getConnectTime();
-
                                if ((*requestObj) != NULL) {
                                        _D(RED("publishing_response"));
                                        Json result;
                                        Json payload;
                                        Json description;
 
+                                       string isHostStr = to_string(client->isHost());
+                                       string connectTimeStr = to_string(client->getConnectTime());
+
                                        payload.set(NULL, CONV_JSON_RESULT_TYPE, result_type);
-                                       payload.set(NULL, CONV_JSON_CLIENT_IS_HOST, isHost);
-                                       payload.set(NULL, CONV_JSON_CLIENT_CONNECT_TIME, connecttime);
+                                       payload.set(NULL, CONV_JSON_CLIENT_IS_HOST, isHostStr.c_str());
+                                       payload.set(NULL, CONV_JSON_CLIENT_CONNECT_TIME, connectTimeStr.c_str());
                                        payload.set(NULL, CONV_JSON_CLIENT_CLIENT_ID, client->getId());
 
                                        description = (*requestObj)->getDescription();
index d9c1016..0122069 100755 (executable)
@@ -345,10 +345,12 @@ int conv::AppCommServiceProvider::readRequest(Request* requestObj)
                                        for (auto cs_itr = cl.begin(); cs_itr != cl.end(); cs_itr++) {
                                                cs_index++;
                                                Json client;
+                                               string isHostStr = to_string((*cs_itr).isHost());
+                                               string connectTimeStr = to_string((*cs_itr).getConnectTime());
 
                                                client.set(NULL, CONV_JSON_CLIENT_ID, (*cs_itr).getId());
-                                               client.set(NULL, CONV_JSON_IS_HOST, (*cs_itr).isHost());
-                                               client.set(NULL, CONV_JSON_CONNECT_TIME, (*cs_itr).getConnectTime());
+                                               client.set(NULL, CONV_JSON_IS_HOST, isHostStr.c_str());
+                                               client.set(NULL, CONV_JSON_CONNECT_TIME, connectTimeStr.c_str());
                                                Channel* cha = NULL;
                                                cha = (*cs_itr).getChannel();
 
index 898388b..1de98b9 100755 (executable)
@@ -515,10 +515,11 @@ static void __on_response(iotcon_remote_resource_h resource, iotcon_error_e err,
                if (cb_info.requestObj == NULL) {
                        _E("listener_cb is not registered");
                } else {
+                       string resultStr = to_string(appctl_result);
                        payload.set(NULL, CONV_JSON_RESULT_TYPE, CONV_JSON_ON_PUBLISH);
                        payload.set(NULL, CONV_JSON_APP_CONTROL_REPLY, appctl_char);
                        payload.set(NULL, CONV_JSON_APP_CONTROL_REQUEST, appctl_request_char);
-                       payload.set(NULL, CONV_JSON_APP_CONTROL_RESULT, appctl_result);
+                       payload.set(NULL, CONV_JSON_APP_CONTROL_RESULT, resultStr.c_str());
                        result.set(NULL, CONV_JSON_DESCRIPTION, cb_info.requestObj->getDescription());
                        result.set(NULL, CONV_JSON_PAYLOAD, payload);