From 2b758007f09e7f7379924b1e19898ca8b8ea6ee2 Mon Sep 17 00:00:00 2001 From: "jk.pu" Date: Fri, 1 Apr 2016 22:29:25 +0900 Subject: [PATCH] [Iotcon] apply latest widl change. Change-Id: I0573deb8abc45b3bda44a9fb9c3341846a1990f2 Signed-off-by: jk.pu --- src/iotcon/iotcon_api.js | 5 +++++ src/iotcon/iotcon_utils.cc | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/iotcon/iotcon_api.js b/src/iotcon/iotcon_api.js index 29e64820..ed8776db 100644 --- a/src/iotcon/iotcon_api.js +++ b/src/iotcon/iotcon_api.js @@ -1065,6 +1065,10 @@ Server.prototype.createResource = function() { name: 'resourceTypes', type: types.ARRAY, values: types.STRING + }, { + name: 'resourceInterfaces', + type: types.ARRAY, + values: types.STRING }, { name: 'dictionary', type: types.DICTIONARY, @@ -1075,6 +1079,7 @@ Server.prototype.createResource = function() { var callArgs = args.dictionary || {}; callArgs.uriPath = args.uriPath; callArgs.resourceTypes = args.resourceTypes; + callArgs.resourceInterfaces = args.resourceInterfaces; var result = native.callSync('IotconServer_createResource', callArgs); diff --git a/src/iotcon/iotcon_utils.cc b/src/iotcon/iotcon_utils.cc index cb54b694..e5b3723d 100644 --- a/src/iotcon/iotcon_utils.cc +++ b/src/iotcon/iotcon_utils.cc @@ -158,7 +158,7 @@ int IotconUtils::GetProperties(const picojson::object& args) { properties |= (observable.is() ? observable.get() : false) ? IOTCON_RESOURCE_OBSERVABLE : IOTCON_RESOURCE_NO_PROPERTY; const auto& discoverable = IotconUtils::GetArg(args, kIsDiscoverable); - properties |= (discoverable.is() ? discoverable.get() : false) ? IOTCON_RESOURCE_DISCOVERABLE : IOTCON_RESOURCE_NO_PROPERTY; + properties |= (discoverable.is() ? discoverable.get() : true) ? IOTCON_RESOURCE_DISCOVERABLE : IOTCON_RESOURCE_NO_PROPERTY; const auto& active = IotconUtils::GetArg(args, kIsActive); properties |= (active.is() ? active.get() : false) ? IOTCON_RESOURCE_ACTIVE : IOTCON_RESOURCE_NO_PROPERTY; @@ -634,7 +634,7 @@ common::TizenResult IotconUtils::RequestToJson(iotcon_request_h request, if (!result) { LogAndReturnTizenError(result, ("iotcon_request_get_observe_type() failed")); } - out->insert(std::make_pair(kRequestType, picojson::value{FromObserveType(observe_type)})); + out->insert(std::make_pair(kObserveType, picojson::value{FromObserveType(observe_type)})); } } else { LoggerW("Request handle is null, ignoring"); -- 2.34.1