Added option to set target client id in app-comm service 89/105589/1 accepted/tizen/3.0/common/20161221.180806 accepted/tizen/3.0/mobile/20161221.010110 accepted/tizen/3.0/tv/20161221.005619 accepted/tizen/3.0/wearable/20161221.005642 submit/tizen_3.0/20161220.004602
authorkmook <kmook.choi@samsung.com>
Mon, 19 Dec 2016 05:21:11 +0000 (14:21 +0900)
committerKyoung-Mook Choi <kmook.choi@samsung.com>
Mon, 19 Dec 2016 05:21:44 +0000 (21:21 -0800)
Change-Id: I6335e86c95ccab12dda34eb5302bf5879cb4a40f
Signed-off-by: kmook <kmook.choi@samsung.com>
common/Types.h
daemon/service_provider/AppCommServiceProvider.cpp

index bd8cf9c4d644f9d3a8b435ba14ed438f1f6c4a71..637a5002aa1cb916f7377b1ae112dc6ccf0844b3 100644 (file)
@@ -179,6 +179,7 @@ enum AccessControlState {
 #define CONV_JSON_CLIENT_CONNECT_TIME                  "client_connect_time"
 #define CONV_JSON_CLIENT_CLIENT_ID                             "client_id"
 #define CONV_JSON_SECURE_MODE                                  "secure_mode"
+#define CONV_JSON_TARGET_CLIENT_ID                             "target_client_id"
 
 #define CONV_JSON_ON_START                                             "onStart"
 #define CONV_JSON_ON_CONNECT                                   "onConnect"
index 8cce18fab1410c078975704d10b363e0db104059..48ab640731780f7c3b8ec4beb93b9e2400bc9ea3 100755 (executable)
@@ -428,9 +428,16 @@ int conv::AppCommServiceProvider::publishRequest(Request* requestObj)
 
                                Json payload;
                                requestObj->getPayloadFromDescription(&payload);
+                               string targetClient;
 
-                               (*iter)->application->publish("d2d_service_message", payload.str().c_str(), requestObj->getBinary(), requestObj->getBinaryLength(), NULL);
-                               _D("publishing done");
+                               payload.get(NULL, CONV_JSON_TARGET_CLIENT_ID, &targetClient);
+
+                               if (targetClient.empty()) {
+                                       (*iter)->application->publish("d2d_service_message", payload.str().c_str(), requestObj->getBinary(), requestObj->getBinaryLength(), NULL);
+                                       _D("publishing broadcast done");
+                               } else {
+                                       (*iter)->application->publish("d2d_service_message", payload.str().c_str(), targetClient.c_str(), requestObj->getBinary(), requestObj->getBinaryLength(), NULL);
+                               }
                                return CONV_ERROR_NONE;
                        }
                }