[iotcon] fix set deviceName, set/get timeInterval 16/89816/3
authorjk.pu <jk.pu@samsung.com>
Tue, 27 Sep 2016 06:23:24 +0000 (15:23 +0900)
committerHyunjin Park <hj.na.park@samsung.com>
Fri, 30 Sep 2016 09:40:25 +0000 (02:40 -0700)
Change-Id: I491d892c953f3df3109be5c328c438870be17215
Signed-off-by: jk.pu <jk.pu@samsung.com>
src/iotcon/iotcon_api.js
src/iotcon/iotcon_instance.cc

index 10f5a54a86cb2ac3e20a8d51595ab28581a804da..4cd400b7273558167d583495a048ca29faacca52 100644 (file)
@@ -691,10 +691,7 @@ function RemoteResource(data) {
     },
     timeInterval: {
       get: function() {
-        /* TODO Uncomment when the interface of the function iotcon_remote_resource_get_time_interval is changed
         var callArgs = prepareResourceInfo(this, true);
-        */
-        var callArgs = {};
 
         var result = native.callSync('IotconRemoteResource_getTimeInterval', callArgs);
         if (native.isSuccess(result)) {
@@ -703,13 +700,8 @@ function RemoteResource(data) {
         return null;
       }.bind(this),
       set: function(val) {
-        /* TODO Uncomment when the interface of the function iotcon_remote_resource_set_time_interval is changed
         var callArgs = prepareResourceInfo(this, true);
         callArgs[timeInterval] = converter.toLong(val);
-        */
-        var callArgs = {
-          timeInterval: converter.toLong(val)
-        };
 
         native.callSync('IotconRemoteResource_setTimeInterval', callArgs);
       }.bind(this),
@@ -1222,7 +1214,7 @@ function Server() {
       },
       set: function(v) {
         if (v) {
-          var deviceName = converter.toString(v);
+          var deviceName = v;
 
           var callArgs = {
             deviceName: deviceName
index 8476d4d2304973e9be482f26ec4d4972436a97c1..46d618e34e4b7cf665dff490c477038c0b523d2d 100644 (file)
@@ -1122,7 +1122,6 @@ common::TizenResult IotconInstance::RemoteResourceGetTimeInterval(const picojson
   if (!res) {
     LogAndReturnTizenError(res, ("iotcon_remote_resource_get_checking_interval() failed"));
   }
-
   return common::TizenSuccess{picojson::value(static_cast<double>(time_interval))};
 }
 
@@ -1145,10 +1144,7 @@ common::TizenResult IotconInstance::RemoteResourceSetTimeInterval(const picojson
     LogAndReturnTizenError(res, ("iotcon_remote_resource_set_checking_interval() failed"));
   }
 
-  // TODO Uncomment when the interface of the function iotcon_remote_resource_set_time_interval is changed
-  // return common::TizenSuccess{IotconClientManager::GetInstance().StoreRemoteResource(ptr)};
-
-  return common::TizenSuccess{};
+ return common::TizenSuccess{IotconClientManager::GetInstance().StoreRemoteResource(ptr)};
 }
 
 bool IotconInstance::ResourceFoundCallback(iotcon_remote_resource_h resource,