From 0d785eda0ab57474f88bc5522f83f0c5cd3398eb Mon Sep 17 00:00:00 2001 From: youngman Date: Fri, 27 Nov 2015 09:32:03 +0900 Subject: [PATCH] modify "is_observable->properties", & remove tizen_info Change-Id: Ifd1d67c3a550e844219451ab2a76828151ea47b1 Signed-off-by: youngman --- common/ic-dbus.xml | 6 +- daemon/icd-dbus.c | 8 +-- daemon/icd-ioty-ocprocess.c | 136 ----------------------------------- daemon/icd-ioty-ocprocess.h | 6 -- daemon/icd-ioty-type.c | 24 +++++++ daemon/icd-ioty-type.h | 2 + daemon/icd-ioty.c | 131 ++++----------------------------- daemon/icd-ioty.h | 22 ++---- daemon/icd-payload.c | 11 +-- daemon/icd.c | 8 --- doc/iotcon_doc.h | 2 +- lib/icl-dbus-type.c | 4 +- lib/icl-device.c | 93 ------------------------ lib/icl-device.h | 5 -- lib/icl-remote-resource.c | 25 +++---- lib/icl-remote-resource.h | 3 +- lib/include/iotcon-client.h | 76 +------------------- lib/include/iotcon-constant.h | 10 --- lib/include/iotcon-remote-resource.h | 33 +++++---- lib/include/iotcon-resource.h | 2 +- lib/include/iotcon-types.h | 8 --- lib/include/iotcon.h | 4 +- packaging/iotcon.conf.in | 3 - test/iotcon-test-basic-client.c | 48 ++----------- test/iotcon-test-basic-server.c | 2 +- test/iotcon-test-encap-client.c | 2 +- test/iotcon-test-iface-client.c | 2 +- 27 files changed, 107 insertions(+), 569 deletions(-) diff --git a/common/ic-dbus.xml b/common/ic-dbus.xml index a05ea44..ecdd2dc 100644 --- a/common/ic-dbus.xml +++ b/common/ic-dbus.xml @@ -45,6 +45,7 @@ + @@ -93,11 +94,6 @@ - - - - - diff --git a/daemon/icd-dbus.c b/daemon/icd-dbus.c index 02ad9c5..ef959ba 100644 --- a/daemon/icd-dbus.c +++ b/daemon/icd-dbus.c @@ -510,7 +510,8 @@ static gboolean _dbus_handle_find_resource(icDbus *object, GDBusMethodInvocation *invocation, const gchar *host_address, gint connectivity, - const gchar *type) + const gchar *type, + bool is_secure) { int ret; const gchar *sender; @@ -519,7 +520,8 @@ static gboolean _dbus_handle_find_resource(icDbus *object, sender = g_dbus_method_invocation_get_sender(invocation); signal_number = icd_dbus_generate_signal_number(); - ret = icd_ioty_find_resource(host_address, connectivity, type, signal_number, sender); + ret = icd_ioty_find_resource(host_address, connectivity, type, is_secure, + signal_number, sender); if (IOTCON_ERROR_NONE != ret) ERR("icd_ioty_find_resource() Fail(%d)", ret); @@ -862,8 +864,6 @@ static void _dbus_on_bus_acquired(GDBusConnection *conn, const gchar *name, G_CALLBACK(_dbus_handle_get_device_info), NULL); g_signal_connect(icd_dbus_object, "handle-get-platform-info", G_CALLBACK(_dbus_handle_get_platform_info), NULL); - g_signal_connect(icd_dbus_object, "handle-get-tizen-info", - G_CALLBACK(icd_ioty_get_tizen_info), NULL); g_signal_connect(icd_dbus_object, "handle-start-presence", G_CALLBACK(_dbus_handle_start_presence), NULL); g_signal_connect(icd_dbus_object, "handle-stop-presence", diff --git a/daemon/icd-ioty-ocprocess.c b/daemon/icd-ioty-ocprocess.c index 46dda11..6cc3787 100644 --- a/daemon/icd-ioty-ocprocess.c +++ b/daemon/icd-ioty-ocprocess.c @@ -83,13 +83,6 @@ struct icd_info_context { }; -struct icd_tizen_info_context { - OCRequestHandle request_h; - OCResourceHandle resource_h; - GDBusMethodInvocation *invocation; -}; - - struct icd_observe_context { int64_t signal_number; int res; @@ -1066,134 +1059,6 @@ OCStackApplicationResult icd_ioty_ocprocess_info_cb(void *ctx, OCDoHandle handle } -static int _worker_tizen_info_handler(void *context) -{ - int ret; - char *device_name; - char *tizen_device_id; - OCStackResult result; - OCRepPayload *payload; - OCEntityHandlerResponse response = {0}; - struct icd_tizen_info_context *ctx = context; - - response.requestHandle = ctx->request_h; - response.resourceHandle = ctx->resource_h; - response.ehResult = OC_EH_OK; - - /* Get Tizen Info */ - ret = icd_ioty_tizen_info_get_property(&device_name, &tizen_device_id); - if (IOTCON_ERROR_NONE != ret) { - ERR("icd_ioty_tizen_info_get_property() Fail(%d)", ret); - response.ehResult = OC_EH_ERROR; - } - - /* payload */ - payload = OCRepPayloadCreate(); - OCRepPayloadSetUri(payload, ICD_IOTY_TIZEN_INFO_URI); - OCRepPayloadAddResourceType(payload, ICD_IOTY_TIZEN_INFO_TYPE); - OCRepPayloadAddInterface(payload, IC_INTERFACE_DEFAULT); - - OCRepPayloadSetPropString(payload, ICD_IOTY_TIZEN_INFO_DEVICE_NAME, - ic_utils_dbus_encode_str(device_name)); - OCRepPayloadSetPropString(payload, ICD_IOTY_TIZEN_INFO_TIZEN_DEVICE_ID, - ic_utils_dbus_encode_str(tizen_device_id)); - response.payload = (OCPayload*)payload; - - icd_ioty_csdk_lock(); - result = OCDoResponse(&response); - icd_ioty_csdk_unlock(); - - if (OC_STACK_OK != result) { - ERR("OCDoResponse() Fail(%d)", result); - free(ctx); - return IOTCON_ERROR_IOTIVITY; - } - - free(ctx); - return IOTCON_ERROR_NONE; -} - - -OCEntityHandlerResult icd_ioty_ocprocess_tizen_info_handler(OCEntityHandlerFlag flag, - OCEntityHandlerRequest *request, void *user_data) -{ - int ret; - struct icd_tizen_info_context *tizen_info_ctx; - - if ((0 == (OC_REQUEST_FLAG & flag)) || (OC_REST_GET != request->method)) { - ERR("Prohibited Action"); - return OC_EH_FORBIDDEN; - } - - tizen_info_ctx = calloc(1, sizeof(struct icd_tizen_info_context)); - if (NULL == tizen_info_ctx) { - ERR("calloc() Fail(%d)", errno); - return OC_EH_ERROR; - } - - tizen_info_ctx->request_h = request->requestHandle; - tizen_info_ctx->resource_h = request->resource; - - ret = _ocprocess_worker_start(_worker_tizen_info_handler, tizen_info_ctx); - if (IOTCON_ERROR_NONE != ret) { - ERR("_ocprocess_worker_start() Fail(%d)", ret); - free(tizen_info_ctx); - return OC_EH_ERROR; - } - - return OC_EH_OK; -} - - -OCStackApplicationResult icd_ioty_ocprocess_get_tizen_info_cb(void *ctx, - OCDoHandle handle, OCClientResponse *resp) -{ - int res; - char *device_name; - char *tizen_device_id; - GVariant *tizen_info; - OCRepPayload *payload; - OCRepPayloadValue *val; - - RETV_IF(NULL == ctx, OC_STACK_DELETE_TRANSACTION); - - if (NULL == resp->payload) { - ERR("payload is empty"); - icd_ioty_complete_error(ICD_TIZEN_INFO, ctx, IOTCON_ERROR_IOTIVITY); - return OC_STACK_DELETE_TRANSACTION; - } - - payload = (OCRepPayload*)resp->payload; - val = payload->values; - if (NULL == val) { - ERR("Invalid payload"); - icd_ioty_complete_error(ICD_TIZEN_INFO, ctx, IOTCON_ERROR_IOTIVITY); - return OC_STACK_DELETE_TRANSACTION; - } - device_name = val->str; - - val = val->next; - if (NULL == val) { - ERR("Invalid Payload"); - icd_ioty_complete_error(ICD_TIZEN_INFO, ctx, IOTCON_ERROR_IOTIVITY); - return OC_STACK_DELETE_TRANSACTION; - } - - tizen_device_id = val->str; - - if (OC_STACK_OK == resp->result) - res = IOTCON_RESPONSE_OK; - else - res = IOTCON_RESPONSE_ERROR; - - tizen_info = g_variant_new("(ssi)", device_name, tizen_device_id, res); - - icd_ioty_complete(ICD_TIZEN_INFO, ctx, tizen_info); - - return OC_STACK_DELETE_TRANSACTION; -} - - static int _worker_encap_get_cb(void *context) { int ret; @@ -1346,4 +1211,3 @@ OCStackApplicationResult icd_ioty_ocprocess_encap_presence_cb(void *ctx, return OC_STACK_KEEP_TRANSACTION; } - diff --git a/daemon/icd-ioty-ocprocess.h b/daemon/icd-ioty-ocprocess.h index e217454..11e57d0 100644 --- a/daemon/icd-ioty-ocprocess.h +++ b/daemon/icd-ioty-ocprocess.h @@ -50,12 +50,6 @@ OCStackApplicationResult icd_ioty_ocprocess_presence_cb(void *ctx, OCDoHandle ha OCStackApplicationResult icd_ioty_ocprocess_info_cb(void *ctx, OCDoHandle handle, OCClientResponse *resp); -OCEntityHandlerResult icd_ioty_ocprocess_tizen_info_handler(OCEntityHandlerFlag flag, - OCEntityHandlerRequest *request, void *user_data); - -OCStackApplicationResult icd_ioty_ocprocess_get_tizen_info_cb(void *ctx, - OCDoHandle handle, OCClientResponse* resp); - OCStackApplicationResult icd_ioty_ocprocess_encap_get_cb(void *ctx, OCDoHandle handle, OCClientResponse* resp); diff --git a/daemon/icd-ioty-type.c b/daemon/icd-ioty-type.c index 8eef6f9..08fffdf 100644 --- a/daemon/icd-ioty-type.c +++ b/daemon/icd-ioty-type.c @@ -174,3 +174,27 @@ int icd_ioty_get_host_address(OCDevAddr *dev_addr, char **host_address, int *con } +int icd_ioty_oic_properties_to_properties(int oic_properties) +{ + int prop = IOTCON_RESOURCE_NO_PROPERTY; + + if (OC_DISCOVERABLE & oic_properties) + prop |= IOTCON_RESOURCE_DISCOVERABLE; + + if (OC_OBSERVABLE & oic_properties) + prop |= IOTCON_RESOURCE_OBSERVABLE; + + if (OC_ACTIVE & oic_properties) + prop |= IOTCON_RESOURCE_ACTIVE; + + if (OC_SLOW & oic_properties) + prop |= IOTCON_RESOURCE_SLOW; + + if (OC_SECURE & oic_properties) + prop |= IOTCON_RESOURCE_SECURE; + + if (OC_EXPLICIT_DISCOVERABLE & oic_properties) + prop |= IOTCON_RESOURCE_EXPLICIT_DISCOVERABLE; + + return prop; +} diff --git a/daemon/icd-ioty-type.h b/daemon/icd-ioty-type.h index fa04cf7..1193870 100644 --- a/daemon/icd-ioty-type.h +++ b/daemon/icd-ioty-type.h @@ -27,4 +27,6 @@ int icd_ioty_get_dev_addr(const char *host_address, int conn_type, OCDevAddr *de int icd_ioty_get_host_address(OCDevAddr *dev_addr, char **host_address, int *conn_type); +int icd_ioty_oic_properties_to_properties(int oic_properties); + #endif /*__IOT_CONNECTIVITY_MANAGER_DAEMON_IOTIVITY_TYPE_H__*/ diff --git a/daemon/icd-ioty.c b/daemon/icd-ioty.c index d972ab8..f15c1d3 100644 --- a/daemon/icd-ioty.c +++ b/daemon/icd-ioty.c @@ -40,20 +40,12 @@ static int icd_remote_resource_time_interval = ICD_REMOTE_RESOURCE_DEFAULT_TIME_INTERVAL; -static const char *ICD_SYSTEM_INFO_TIZEN_ID = "http://tizen.org/system/tizenid"; static const char *ICD_SYSTEM_INFO_PLATFORM_NAME = "http://tizen.org/system/platform.name"; static const char *ICD_SYSTEM_INFO_PLATFORM_VERSION = "http://tizen.org/feature/platform.version"; static const char *ICD_SYSTEM_INFO_MANUF_NAME = "http://tizen.org/system/manufacturer"; static const char *ICD_SYSTEM_INFO_MODEL_NAME = "http://tizen.org/system/model_name"; static const char *ICD_SYSTEM_INFO_BUILD_STRING = "http://tizen.org/system/build.string"; -typedef struct { - char *device_name; - char *tizen_device_id; -} icd_tizen_info_s; - -static icd_tizen_info_s icd_tizen_info = {0}; - static GHashTable *icd_ioty_encap_table; static GHashTable *icd_ioty_presence_table; @@ -415,20 +407,27 @@ static void _ioty_free_signal_context(void *data) } -int icd_ioty_find_resource(const char *host_address, int conn_type, - const char *resource_type, int64_t signal_number, const char *bus_name) +int icd_ioty_find_resource(const char *host_address, + int conn_type, + const char *resource_type, + bool is_secure, + int64_t signal_number, + const char *bus_name) { int len; + char *coap_str; OCStackResult result; icd_sig_ctx_s *context; char uri[PATH_MAX] = {0}; OCCallbackData cbdata = {0}; OCConnectivityType oic_conn_type; + coap_str = is_secure? ICD_IOTY_COAPS:ICD_IOTY_COAP; + if (IC_STR_EQUAL == strcmp(IC_STR_NULL, host_address)) { len = snprintf(uri, sizeof(uri), "%s", OC_RSRVD_WELL_KNOWN_URI); } else { - len = snprintf(uri, sizeof(uri), ICD_IOTY_COAP"%s%s", host_address, + len = snprintf(uri, sizeof(uri), "%s%s%s", coap_str, host_address, OC_RSRVD_WELL_KNOWN_URI); } if (len <= 0 || sizeof(uri) <= len) { @@ -526,11 +525,8 @@ void icd_ioty_complete(int type, GDBusMethodInvocation *invocation, GVariant *va case ICD_CRUD_DELETE: ic_dbus_complete_delete(icd_dbus_get_object(), invocation, value); break; - case ICD_TIZEN_INFO: - ic_dbus_complete_get_tizen_info(icd_dbus_get_object(), invocation, value); - break; default: - INFO("Invalid type(%d)", type); + INFO("Invalid Type(%d)", type); } } @@ -565,10 +561,8 @@ void icd_ioty_complete_error(int type, GDBusMethodInvocation *invocation, int re value = g_variant_new("(a(qs)i)", &options, ret_val); ic_dbus_complete_delete(icd_dbus_get_object(), invocation, value); break; - case ICD_TIZEN_INFO: - value = g_variant_new("(ssi)", IC_STR_NULL, IC_STR_NULL, ret_val); - ic_dbus_complete_get_tizen_info(icd_dbus_get_object(), invocation, value); - break; + default: + INFO("Invalid Type(%d)", type); } } @@ -910,21 +904,6 @@ int icd_ioty_get_info(int type, const char *host_address, int conn_type, return IOTCON_ERROR_NONE; } -static int _icd_ioty_get_tizen_id(char **tizen_device_id) -{ - int ret; - char *tizen_id = NULL; - - ret = system_info_get_platform_string(ICD_SYSTEM_INFO_TIZEN_ID, &tizen_id); - if (SYSTEM_INFO_ERROR_NONE != ret) { - ERR("system_info_get_platform_string() Fail(%d)", ret); - return IOTCON_ERROR_SYSTEM; - } - *tizen_device_id = tizen_id; - - return IOTCON_ERROR_NONE; -} - static int _ioty_set_device_info() { int ret; @@ -949,9 +928,6 @@ static int _ioty_set_device_info() return icd_ioty_convert_error(ret); } - free(icd_tizen_info.device_name); - icd_tizen_info.device_name = device_name; - return IOTCON_ERROR_NONE; } @@ -1068,87 +1044,6 @@ int icd_ioty_set_platform_info() return IOTCON_ERROR_NONE; } -int icd_ioty_set_tizen_info() -{ - int result; - OCStackResult ret; - OCResourceHandle handle; - char *tizen_device_id = NULL; - - result = _icd_ioty_get_tizen_id(&tizen_device_id); - if (IOTCON_ERROR_NONE != result) { - ERR("_icd_ioty_get_tizen_id() Fail(%d)", result); - return result; - } - - icd_tizen_info.tizen_device_id = tizen_device_id; - DBG("tizen_device_id : %s", icd_tizen_info.tizen_device_id); - - icd_ioty_csdk_lock(); - ret = OCCreateResource(&handle, - ICD_IOTY_TIZEN_INFO_TYPE, - IC_INTERFACE_DEFAULT, - ICD_IOTY_TIZEN_INFO_URI, - icd_ioty_ocprocess_tizen_info_handler, - NULL, - OC_EXPLICIT_DISCOVERABLE); - icd_ioty_csdk_unlock(); - if (OC_STACK_OK != ret) { - ERR("OCCreateResource() Fail(%d)", ret); - return icd_ioty_convert_error(ret); - } - - return IOTCON_ERROR_NONE; -} - - -gboolean icd_ioty_get_tizen_info(icDbus *object, GDBusMethodInvocation *invocation, - const gchar *host_address, int conn_type) -{ - int ret; - OCStackResult result; - OCDevAddr dev_addr = {0}; - OCCallbackData cbdata = {0}; - OCConnectivityType oic_conn_type; - - cbdata.cb = icd_ioty_ocprocess_get_tizen_info_cb; - cbdata.context = invocation; - - oic_conn_type = icd_ioty_conn_type_to_oic_conn_type(conn_type); - - ret = icd_ioty_get_dev_addr(host_address, conn_type, &dev_addr); - if (IOTCON_ERROR_NONE != ret) { - ERR("icd_ioty_get_dev_addr() Fail(%d)", ret); - icd_ioty_complete_error(ICD_TIZEN_INFO, invocation, IOTCON_ERROR_IOTIVITY); - return TRUE; - } - - icd_ioty_csdk_lock(); - result = OCDoResource(NULL, OC_REST_GET, ICD_IOTY_TIZEN_INFO_URI, &dev_addr, NULL, - oic_conn_type, OC_LOW_QOS, &cbdata, NULL, 0); - icd_ioty_csdk_unlock(); - - if (OC_STACK_OK != result) { - ERR("OCDoResource() Fail(%d)", result); - icd_ioty_complete_error(ICD_TIZEN_INFO, invocation, icd_ioty_convert_error(result)); - return TRUE; - } - - return TRUE; -} - - -int icd_ioty_tizen_info_get_property(char **device_name, char **tizen_device_id) -{ - RETV_IF(NULL == device_name, IOTCON_ERROR_INVALID_PARAMETER); - RETV_IF(NULL == tizen_device_id, IOTCON_ERROR_INVALID_PARAMETER); - - *device_name = icd_tizen_info.device_name; - *tizen_device_id = icd_tizen_info.tizen_device_id; - - return IOTCON_ERROR_NONE; -} - static void _icd_ioty_presence_table_create() { diff --git a/daemon/icd-ioty.h b/daemon/icd-ioty.h index ef7e71b..0c00274 100644 --- a/daemon/icd-ioty.h +++ b/daemon/icd-ioty.h @@ -31,13 +31,6 @@ #define ICD_MULTICAST_ADDRESS "224.0.1.187:5683" -/* TODO Define Tizen Information Resource(uri, resource type) */ -#define ICD_IOTY_TIZEN_INFO_URI "/org/tizen/iot/d" -#define ICD_IOTY_TIZEN_INFO_TYPE "org.tizen.iot.d" - -#define ICD_IOTY_TIZEN_INFO_DEVICE_NAME "device_name" -#define ICD_IOTY_TIZEN_INFO_TIZEN_DEVICE_ID "tizen_device_id" - typedef struct { int64_t signal_number; char *bus_name; @@ -69,7 +62,6 @@ enum { ICD_CRUD_DELETE, ICD_DEVICE_INFO, ICD_PLATFORM_INFO, - ICD_TIZEN_INFO, ICD_ENCAP_MONITORING, ICD_ENCAP_CACHING, ICD_PRESENCE, @@ -100,8 +92,12 @@ int icd_ioty_notify(OCResourceHandle handle, GVariant *msg, GVariant *observers) int icd_ioty_send_response(GVariant *resp); -int icd_ioty_find_resource(const char *host_address, int conn_type, - const char *resource_type, int64_t signal_number, const char *bus_name); +int icd_ioty_find_resource(const char *host_address, + int conn_type, + const char *resource_type, + bool is_secure, + int64_t signal_number, + const char *bus_name); void icd_ioty_complete(int type, GDBusMethodInvocation *invocation, GVariant *value); void icd_ioty_complete_error(int type, GDBusMethodInvocation *invocation, int ret_val); @@ -128,12 +124,6 @@ int icd_ioty_get_info(int type, const char *host_address, int conn_type, int icd_ioty_set_device_info(); int icd_ioty_set_platform_info(); -int icd_ioty_set_tizen_info(); - -gboolean icd_ioty_get_tizen_info(icDbus *object, GDBusMethodInvocation *invocation, - const gchar *host_address, int conn_type); - -int icd_ioty_tizen_info_get_property(char **device_name, char **tizen_device_id); OCDoHandle icd_ioty_presence_table_get_handle(const char *host_address); diff --git a/daemon/icd-payload.c b/daemon/icd-payload.c index 3937b3f..008b544 100644 --- a/daemon/icd-payload.c +++ b/daemon/icd-payload.c @@ -26,6 +26,7 @@ #include "ic-utils.h" #include "icd.h" #include "icd-ioty.h" +#include "icd-ioty-type.h" #include "icd-payload.h" union icd_state_value_u { @@ -55,7 +56,7 @@ GVariant** icd_payload_res_to_gvariant(OCPayload *payload, OCDevAddr *dev_addr) OCRandomUuidResult random_res; OCDiscoveryPayload *discovered; struct OCResourcePayload *resource; - int i, is_observable, ret, res_count; + int i, properties, ret, res_count; char device_id[UUID_STRING_SIZE] = {0}; discovered = (OCDiscoveryPayload*)payload; @@ -111,14 +112,16 @@ GVariant** icd_payload_res_to_gvariant(OCPayload *payload, OCDevAddr *dev_addr) node = node->next; } - /* is_observable */ - is_observable = resource->bitmap & OC_OBSERVABLE; + /* Resource Properties */ + properties = icd_ioty_oic_properties_to_properties(resource->bitmap); /* port */ port = (resource->port)? resource->port:dev_addr->port; + /* TODO + * Check "resource->secure" and "resource->bitmap" */ value[i] = g_variant_new("(ssiasibsi)", resource->uri, device_id, ifaces, &types, - is_observable, resource->secure, dev_addr->addr, port); + properties, resource->secure, dev_addr->addr, port); DBG("found resource[%d] : %s", i, g_variant_print(value[i], FALSE)); resource = resource->next; diff --git a/daemon/icd.c b/daemon/icd.c index 9a57719..c411c9d 100644 --- a/daemon/icd.c +++ b/daemon/icd.c @@ -60,14 +60,6 @@ int main(int argc, char **argv) return -1; } - ret = icd_ioty_set_tizen_info(); - if (IOTCON_ERROR_NONE != ret) { - ERR("icd_ioty_set_tizen_info() Fail(%d)", ret); - icd_ioty_deinit(thread); - icd_dbus_deinit(id); - return -1; - } - g_main_loop_run(loop); icd_ioty_deinit(thread); diff --git a/doc/iotcon_doc.h b/doc/iotcon_doc.h index 5fcffaf..7712c22 100644 --- a/doc/iotcon_doc.h +++ b/doc/iotcon_doc.h @@ -230,7 +230,7 @@ static void _found_resource(iotcon_remote_resource_h resource, iotcon_error_e re const char *type = "org.tizen.door"; ret = iotcon_find_resource(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, type, - _found_resource, NULL); + false, _found_resource, NULL); if (IOTCON_ERROR_NONE != ret) return; } diff --git a/lib/icl-dbus-type.c b/lib/icl-dbus-type.c index dcb7242..3cb9ea2 100644 --- a/lib/icl-dbus-type.c +++ b/lib/icl-dbus-type.c @@ -116,6 +116,7 @@ GVariant* icl_dbus_response_to_gvariant(struct icl_resource_response *response) GVariant* icl_dbus_remote_resource_to_gvariant(struct icl_remote_resource *resource) { FN_CALL; + bool is_secure; GVariant *value; GHashTableIter iter; GVariantBuilder options; @@ -130,8 +131,9 @@ GVariant* icl_dbus_remote_resource_to_gvariant(struct icl_remote_resource *resou } } + is_secure = resource->properties & IOTCON_RESOURCE_SECURE; value = g_variant_new("(ssba(qs)i)", resource->uri_path, resource->host_address, - resource->is_secure, &options, resource->connectivity_type); + is_secure, &options, resource->connectivity_type); return value; } diff --git a/lib/icl-device.c b/lib/icl-device.c index aaa909f..15ccd47 100644 --- a/lib/icl-device.c +++ b/lib/icl-device.c @@ -57,11 +57,6 @@ typedef struct { int timeout_id; } icl_platform_info_s; -typedef struct { - iotcon_tizen_info_cb cb; - void *user_data; -} icl_tizen_info_s; - API int iotcon_device_info_get_property(iotcon_device_info_h device_info, iotcon_device_info_e property, char **value) @@ -370,91 +365,3 @@ API int iotcon_get_platform_info(const char *host_address, return ret; } - - -static void _icl_tizen_info_cb(GObject *object, GAsyncResult *g_async_res, - gpointer user_data) -{ - int res; - GVariant *result; - char *device_name; - char *tizen_device_id; - GError *error = NULL; - struct icl_tizen_info info = {0}; - icl_tizen_info_s *cb_container = user_data; - iotcon_tizen_info_cb cb = cb_container->cb; - - ic_dbus_call_get_tizen_info_finish(IC_DBUS(object), &result, g_async_res, &error); - if (error) { - ERR("ic_dbus_call_get_tizen_info_finish() Fail(%s)", error->message); - if (cb) { - int ret = icl_dbus_convert_dbus_error(error->code); - cb(&info, ret, cb_container->user_data); - } - g_error_free(error); - /* TODO contain time out error */ - free(cb_container); - return; - } - - g_variant_get(result, "(&s&si)", &device_name, &tizen_device_id, &res); - - if (IOTCON_ERROR_NONE == res && NULL != ic_utils_dbus_decode_str(tizen_device_id)) { - info.device_name = ic_utils_dbus_decode_str(device_name); - info.tizen_device_id = tizen_device_id; - } - - if (cb) - cb(&info, res, cb_container->user_data); - - free(cb_container); -} - - -API int iotcon_get_tizen_info(const char *host_address, - iotcon_connectivity_type_e connectivity_type, - iotcon_tizen_info_cb cb, - void *user_data) -{ - icl_tizen_info_s *cb_container; - - RETV_IF(NULL == icl_dbus_get_object(), IOTCON_ERROR_DBUS); - RETV_IF(NULL == host_address, IOTCON_ERROR_INVALID_PARAMETER); - RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER); - - cb_container = calloc(1, sizeof(icl_tizen_info_s)); - if (NULL == cb_container) { - ERR("calloc() Fail(%d)", errno); - return IOTCON_ERROR_OUT_OF_MEMORY; - } - - cb_container->cb = cb; - cb_container->user_data = user_data; - - ic_dbus_call_get_tizen_info(icl_dbus_get_object(), host_address, connectivity_type, - NULL, _icl_tizen_info_cb, cb_container); - - return IOTCON_ERROR_NONE; -} - - -API int iotcon_tizen_info_get_property(iotcon_tizen_info_h tizen_info, - iotcon_tizen_info_e property, char **value) -{ - RETV_IF(NULL == tizen_info, IOTCON_ERROR_INVALID_PARAMETER); - RETV_IF(NULL == value, IOTCON_ERROR_INVALID_PARAMETER); - - switch (property) { - case IOTCON_TIZEN_INFO_DEVICE_NAME: - *value = tizen_info->device_name; - break; - case IOTCON_TIZEN_INFO_TIZEN_DEVICE_ID: - *value = tizen_info->tizen_device_id; - break; - default: - ERR("Invalid property(%d)", property); - return IOTCON_ERROR_INVALID_PARAMETER; - } - - return IOTCON_ERROR_NONE; -} diff --git a/lib/icl-device.h b/lib/icl-device.h index 2f6c0ec..203c6fc 100644 --- a/lib/icl-device.h +++ b/lib/icl-device.h @@ -39,9 +39,4 @@ struct icl_platform_info { char *system_time; }; -struct icl_tizen_info { - char *device_name; - char *tizen_device_id; -}; - #endif /* __IOT_CONNECTIVITY_MANAGER_LIBRARY_DEVICE_H__ */ diff --git a/lib/icl-remote-resource.c b/lib/icl-remote-resource.c index 5db3dc4..e905fef 100644 --- a/lib/icl-remote-resource.c +++ b/lib/icl-remote-resource.c @@ -98,6 +98,7 @@ static gboolean _icl_timeout_find_resource(gpointer p) API int iotcon_find_resource(const char *host_address, iotcon_connectivity_type_e connectivity_type, const char *resource_type, + bool is_secure, iotcon_found_resource_cb cb, void *user_data) { @@ -119,6 +120,7 @@ API int iotcon_find_resource(const char *host_address, ic_utils_dbus_encode_str(host_address), connectivity_type, ic_utils_dbus_encode_str(resource_type), + is_secure, &signal_number, &ret, NULL, @@ -167,7 +169,7 @@ API int iotcon_find_resource(const char *host_address, API int iotcon_remote_resource_create(const char *host_address, iotcon_connectivity_type_e connectivity_type, const char *uri_path, - bool is_observable, + int properties, iotcon_resource_types_h resource_types, int resource_ifs, iotcon_remote_resource_h *resource_handle) @@ -189,7 +191,7 @@ API int iotcon_remote_resource_create(const char *host_address, resource->host_address = ic_utils_strdup(host_address); resource->connectivity_type = connectivity_type; resource->uri_path = ic_utils_strdup(uri_path); - resource->is_observable = is_observable; + resource->properties = properties; resource->types = icl_resource_types_ref(resource_types); resource->ifaces = resource_ifs; @@ -268,8 +270,7 @@ API int iotcon_remote_resource_clone(iotcon_remote_resource_h src, resource->host_address = ic_utils_strdup(src->host_address); resource->connectivity_type = src->connectivity_type; resource->device_id = ic_utils_strdup(src->device_id); - resource->is_secure = src->is_secure; - resource->is_observable = src->is_observable; + resource->properties = src->properties; if (src->header_options) { ret = iotcon_options_foreach(src->header_options, @@ -375,13 +376,13 @@ API int iotcon_remote_resource_get_interfaces(iotcon_remote_resource_h resource, } -API int iotcon_remote_resource_is_observable(iotcon_remote_resource_h resource, - bool *observable) +API int iotcon_remote_resource_get_properties(iotcon_remote_resource_h resource, + int *properties) { RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); - RETV_IF(NULL == observable, IOTCON_ERROR_INVALID_PARAMETER); + RETV_IF(NULL == properties, IOTCON_ERROR_INVALID_PARAMETER); - *observable = resource->is_observable; + *properties = resource->properties; return IOTCON_ERROR_NONE; } @@ -424,10 +425,10 @@ static iotcon_remote_resource_h _icl_remote_resource_from_gvariant(GVariant *pay char host_addr[PATH_MAX] = {0}; iotcon_resource_types_h res_types; char *uri_path, *device_id, *res_type, *addr; - int ifaces, is_observable, is_secure, port; + int ifaces, properties, is_secure, port; g_variant_get(payload, "(&s&siasib&si)", &uri_path, &device_id, &ifaces, &types_iter, - &is_observable, &is_secure, &addr, &port); + &properties, &is_secure, &addr, &port); switch (connectivity_type) { case IOTCON_CONNECTIVITY_IPV6: @@ -451,7 +452,7 @@ static iotcon_remote_resource_h _icl_remote_resource_from_gvariant(GVariant *pay iotcon_resource_types_add(res_types, res_type); ret = iotcon_remote_resource_create(host_addr, connectivity_type, uri_path, - !!is_observable, res_types, ifaces, &resource); + properties, res_types, ifaces, &resource); if (res_types) iotcon_resource_types_destroy(res_types); @@ -467,7 +468,7 @@ static iotcon_remote_resource_h _icl_remote_resource_from_gvariant(GVariant *pay return NULL; } resource->connectivity_type = connectivity_type; - resource->is_secure = is_secure; + resource->properties = properties; return resource; } diff --git a/lib/icl-remote-resource.h b/lib/icl-remote-resource.h index d36727a..f14f972 100644 --- a/lib/icl-remote-resource.h +++ b/lib/icl-remote-resource.h @@ -33,8 +33,7 @@ struct icl_remote_resource { char *uri_path; char *host_address; char *device_id; - bool is_secure; - bool is_observable; + int properties; iotcon_options_h header_options; iotcon_resource_types_h types; int ifaces; diff --git a/lib/include/iotcon-client.h b/lib/include/iotcon-client.h index fbbf008..bc01988 100644 --- a/lib/include/iotcon-client.h +++ b/lib/include/iotcon-client.h @@ -335,6 +335,7 @@ typedef void (*iotcon_found_resource_cb)(iotcon_remote_resource_h resource, * @param[in] host_address The address or addressable name of server * @param[in] connectivity_type The connectivity type * @param[in] resource_type The resource type specified as a filter for the resource + * @param[in] is_secure The flag for secure communication with the server * @param[in] cb The callback function to invoke * @param[in] user_data The user data to pass to the function * @@ -354,6 +355,7 @@ typedef void (*iotcon_found_resource_cb)(iotcon_remote_resource_h resource, int iotcon_find_resource(const char *host_address, iotcon_connectivity_type_e connectivity_type, const char *resource_type, + bool is_secure, iotcon_found_resource_cb cb, void *user_data); @@ -510,80 +512,6 @@ int iotcon_platform_info_get_property(iotcon_platform_info_h platform_info, iotcon_platform_info_e property, char **value); /** - * @brief Specifies the type of function passed to iotcon_get_tizen_info(). - * @details The @a result could be one of #iotcon_error_e. - * - * @since_tizen 3.0 - * - * @param[in] tizen_info The information of tizen device from remote server. - * @param[in] result The result code (0 on success, other wise a negative error value) - * @param[in] user_data The user data to pass to the function - * - * @pre iotcon_get_tizen_info() will invoke this callback function. - * - * @see iotcon_get_tizen_info() - * @see iotcon_tizen_info_get_property() - */ -typedef void (*iotcon_tizen_info_cb)(iotcon_tizen_info_h tizen_info, - iotcon_error_e result, void *user_data); - -/** - * @brief Gets the tizen device information of remote server, asynchronously. - * @details Request tizen device information to server and pass the information by calling - * iotcon_tizen_info_cb().\n - * If succeed to getting tizen information, iotcon_tizen_info_cb() will be invoked with - * information. - * - * @since_tizen 3.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/internet - * - * @param[in] host_address The host address of remote server - * @param[in] connectivity_type The connectivity type - * @param[in] cb The callback function to invoke - * @param[in] user_data The user data to pass to the function - * - * @return 0 on success, otherwise a negative error value. - * @retval #IOTCON_ERROR_NONE Successful - * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #IOTCON_ERROR_DBUS Dbus error - * @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory - * @retval #IOTCON_ERROR_PERMISSION_DENIED Permission denied - * - * @pre iotcon_connect() should be called to connect a connection to the iotcon. - * @post iotcon_tizen_info_cb() will be invoked. - * - * @see iotcon_tizen_info_cb() - * @see iotcon_tizen_info_get_property() - * @see iotcon_set_timeout() - */ -int iotcon_get_tizen_info(const char *host_address, - iotcon_connectivity_type_e connectivity_type, - iotcon_tizen_info_cb cb, - void *user_data); - -/** - * @brief Gets tizen device properties from the tizen device information handle - * - * @since_tizen 3.0 - * - * @remarks @a value must not be released using free(). - * - * @param[in] tizen_info The handle of the tizen device information - * @param[in] property The properties of the tizen device information - * @param[out] value The value of the property - * - * @return 0 on success, otherwise a negative error value. - * @retval #IOTCON_ERROR_NONE Successful - * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter - * - * @see iotcon_tizen_info_cb() - * @see iotcon_get_tizen_info() - */ -int iotcon_tizen_info_get_property(iotcon_tizen_info_h tizen_info, - iotcon_tizen_info_e property, char **value); - -/** * @} */ diff --git a/lib/include/iotcon-constant.h b/lib/include/iotcon-constant.h index 70fd963..479a73d 100644 --- a/lib/include/iotcon-constant.h +++ b/lib/include/iotcon-constant.h @@ -208,16 +208,6 @@ typedef enum { } iotcon_platform_info_e; /** - * @brief Enumeration for properties of tizen device information. - * - * @since_tizen 3.0 - */ -typedef enum { - IOTCON_TIZEN_INFO_DEVICE_NAME = 0, /**< Indicates human friendly name for device */ - IOTCON_TIZEN_INFO_TIZEN_DEVICE_ID, /**< Indicates randomly generated id value for tizen device */ -} iotcon_tizen_info_e; - -/** * @brief Enumeration for states of remote resource. * * @since_tizen 3.0 diff --git a/lib/include/iotcon-remote-resource.h b/lib/include/iotcon-remote-resource.h index 7b6ed08..cd56c5a 100644 --- a/lib/include/iotcon-remote-resource.h +++ b/lib/include/iotcon-remote-resource.h @@ -80,7 +80,7 @@ static void _find_light_resource() int ret; ret = iotcon_find_resource(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, - "org.tizen.light", _on_find, NULL); + "org.tizen.light", false, _on_find, NULL); if (IOTCON_ERROR_NONE != ret) return; } @@ -99,7 +99,9 @@ static void _find_light_resource() * API can be used without discovering the object in advance.\n * To use this API, you should provide all of the details required to correctly contact and * observe the object.\n - * If not, you should discover the resource object manually. + * If not, you should discover the resource object manually.\n + * The @a properties can contain multiple properties like + * IOTCON_RESOURCE_DISCOVERABLE | IOTCON_RESOURCE_OBSERVABLE. * * @since_tizen 3.0 * @@ -110,6 +112,7 @@ static void _find_light_resource() * @param[in] connectivity_type The connectivity type * @param[in] uri_path The URI path of the resource. * @param[in] is_observable Allow observation + * @param[in] properties The properties of the resource * @param[in] resource_types The resource type of the resource. For example, "core.light" * @param[in] resource_ifaces The resource interfaces (whether it is collection etc) * @param[out] remote_resource Generated resource handle @@ -127,7 +130,7 @@ static void _find_light_resource() int iotcon_remote_resource_create(const char *host_address, iotcon_connectivity_type_e connectivity_type, const char *uri_path, - bool is_observable, + int properties, iotcon_resource_types_h resource_types, int resource_ifaces, iotcon_remote_resource_h *remote_resource); @@ -559,7 +562,7 @@ int iotcon_remote_resource_stop_monitoring(iotcon_remote_resource_h resource); * @see iotcon_remote_resource_get_device_id() * @see iotcon_remote_resource_get_types() * @see iotcon_remote_resource_get_interfaces() - * @see iotcon_remote_resource_is_observable() + * @see iotcon_remote_resource_get_properties() * @see iotcon_remote_resource_set_options() */ int iotcon_remote_resource_get_uri_path(iotcon_remote_resource_h resource, @@ -583,7 +586,7 @@ int iotcon_remote_resource_get_uri_path(iotcon_remote_resource_h resource, * @see iotcon_remote_resource_get_device_id() * @see iotcon_remote_resource_get_types() * @see iotcon_remote_resource_get_interfaces() - * @see iotcon_remote_resource_is_observable() + * @see iotcon_remote_resource_get_properties() * @see iotcon_remote_resource_set_options() */ int iotcon_remote_resource_get_connectivity_type(iotcon_remote_resource_h resource, @@ -608,7 +611,7 @@ int iotcon_remote_resource_get_connectivity_type(iotcon_remote_resource_h resour * @see iotcon_remote_resource_get_device_id() * @see iotcon_remote_resource_get_types() * @see iotcon_remote_resource_get_interfaces() - * @see iotcon_remote_resource_is_observable() + * @see iotcon_remote_resource_get_properties() * @see iotcon_remote_resource_set_options() */ int iotcon_remote_resource_get_host_address(iotcon_remote_resource_h resource, @@ -633,7 +636,7 @@ int iotcon_remote_resource_get_host_address(iotcon_remote_resource_h resource, * @see iotcon_remote_resource_get_connectivity_type() * @see iotcon_remote_resource_get_types() * @see iotcon_remote_resource_get_interfaces() - * @see iotcon_remote_resource_is_observable() + * @see iotcon_remote_resource_get_properties() * @see iotcon_remote_resource_set_options() */ int iotcon_remote_resource_get_device_id(iotcon_remote_resource_h resource, @@ -658,7 +661,7 @@ int iotcon_remote_resource_get_device_id(iotcon_remote_resource_h resource, * @see iotcon_remote_resource_get_connectivity_type() * @see iotcon_remote_resource_get_device_id() * @see iotcon_remote_resource_get_interfaces() - * @see iotcon_remote_resource_is_observable() + * @see iotcon_remote_resource_get_properties() * @see iotcon_remote_resource_set_options() */ int iotcon_remote_resource_get_types(iotcon_remote_resource_h resource, @@ -683,7 +686,7 @@ int iotcon_remote_resource_get_types(iotcon_remote_resource_h resource, * @see iotcon_remote_resource_get_connectivity_type() * @see iotcon_remote_resource_get_device_id() * @see iotcon_remote_resource_get_types() - * @see iotcon_remote_resource_is_observable() + * @see iotcon_remote_resource_get_properties() * @see iotcon_remote_resource_set_options() */ int iotcon_remote_resource_get_interfaces(iotcon_remote_resource_h resource, int *ifaces); @@ -691,10 +694,12 @@ int iotcon_remote_resource_get_interfaces(iotcon_remote_resource_h resource, int /** * @brief Checks whether the remote resource is observable or not. * + * @details The @a properties can contain multiple properties like + * IOTCON_RESOURCE_DISCOVERABLE | IOTCON_RESOURCE_OBSERVABLE. * @since_tizen 3.0 * * @param[in] resource The handle of the resource - * @param[out] observable The value of observable + * @param[out] properties The Properties of the resource * * @return 0 on success, otherwise a negative error value. * @retval #IOTCON_ERROR_NONE Successful @@ -708,8 +713,8 @@ int iotcon_remote_resource_get_interfaces(iotcon_remote_resource_h resource, int * @see iotcon_remote_resource_get_interfaces() * @see iotcon_remote_resource_set_options() */ -int iotcon_remote_resource_is_observable(iotcon_remote_resource_h resource, - bool *observable); +int iotcon_remote_resource_get_properties(iotcon_remote_resource_h resource, + int *properties); /** @@ -733,7 +738,7 @@ int iotcon_remote_resource_is_observable(iotcon_remote_resource_h resource, * @see iotcon_remote_resource_get_types() * @see iotcon_remote_resource_get_interfaces() * @see iotcon_remote_resource_set_options() - * @see iotcon_remote_resource_is_observable() + * @see iotcon_remote_resource_get_properties() */ int iotcon_remote_resource_get_options(iotcon_remote_resource_h resource, iotcon_options_h *options); @@ -757,7 +762,7 @@ int iotcon_remote_resource_get_options(iotcon_remote_resource_h resource, * @see iotcon_remote_resource_get_types() * @see iotcon_remote_resource_get_interfaces() * @see iotcon_remote_resource_get_options() - * @see iotcon_remote_resource_is_observable() + * @see iotcon_remote_resource_get_properties() */ int iotcon_remote_resource_set_options(iotcon_remote_resource_h resource, iotcon_options_h options); diff --git a/lib/include/iotcon-resource.h b/lib/include/iotcon-resource.h index 7c49c1b..f9c8b1f 100644 --- a/lib/include/iotcon-resource.h +++ b/lib/include/iotcon-resource.h @@ -170,7 +170,7 @@ typedef void (*iotcon_request_handler_cb)(iotcon_resource_h resource, * @param[in] uri_path The URI path of the resource. * @param[in] res_types The list of type of the resource. * @param[in] ifaces The interfaces of the resource. - * @param[in] properties The property of the resource. + * @param[in] properties The properties of the resource. * @param[in] cb The request handler callback function * @param[in] user_data The user data to pass to the callback function * @param[out] resource_handle The handle of the resource diff --git a/lib/include/iotcon-types.h b/lib/include/iotcon-types.h index e3bb8ec..b5e90a9 100644 --- a/lib/include/iotcon-types.h +++ b/lib/include/iotcon-types.h @@ -148,14 +148,6 @@ typedef struct icl_device_info* iotcon_device_info_h; typedef struct icl_platform_info* iotcon_platform_info_h; /** - * @brief The handle of tizen device information. - * @details @a iotcon_tizen_info_h is a handle of tizen device information. - * - * @since_tizen 3.0 - */ -typedef struct icl_tizen_info* iotcon_tizen_info_h; - -/** * @brief The handle of resource types * @details @a iotcon_resource_types_h is an opaque data structure to have list * of resource types. A resource type is datatype of string. diff --git a/lib/include/iotcon.h b/lib/include/iotcon.h index ee37e1b..73aa6da 100644 --- a/lib/include/iotcon.h +++ b/lib/include/iotcon.h @@ -74,7 +74,7 @@ void iotcon_disconnect(void); /** * @brief Gets the timeout seconds of asynchronous API. * @details This API get the timeout of iotcon_get_device_info(), - * iotcon_get_platform_info(), iotcon_get_tizen_info(), iotcon_find_resource(), + * iotcon_get_platform_info(), iotcon_find_resource(), * iotcon_remote_resource_get(), iotcon_remote_resource_put(), * iotcon_remote_resource_post() and iotcon_remote_resource_delete(). * @@ -95,7 +95,7 @@ int iotcon_get_timeout(int *timeout_seconds); /** * @brief Sets the timeout seconds of asynchrous APIs. * @details This API set the timeout of iotcon_get_device_info(), - * iotcon_get_platform_info(), iotcon_get_tizen_info(), iotcon_find_resource(), + * iotcon_get_platform_info(), iotcon_find_resource(), * iotcon_remote_resource_get(), iotcon_remote_resource_put(), * iotcon_remote_resource_post() and iotcon_remote_resource_delete().\n * Default timeout interval value is 30. diff --git a/packaging/iotcon.conf.in b/packaging/iotcon.conf.in index 42c0d96..9782337 100644 --- a/packaging/iotcon.conf.in +++ b/packaging/iotcon.conf.in @@ -60,9 +60,6 @@ send_interface="@DBUS_INTERFACE@" send_member="getPlatformInfo" privilege="http://tizen.org/privilege/internet"/> - type, - IOTCON_INTERFACE_DEFAULT, (IOTCON_RESOURCE_DISCOVERABLE | IOTCON_RESOURCE_OBSERVABLE), door); + IOTCON_INTERFACE_DEFAULT, IOTCON_RESOURCE_NO_PROPERTY, door); if (NULL == new_door_handle) { ERR("_create_door_resource() Fail"); return -1; diff --git a/test/iotcon-test-encap-client.c b/test/iotcon-test-encap-client.c index ca4d3a8..d7f4d7b 100644 --- a/test/iotcon-test-encap-client.c +++ b/test/iotcon-test-encap-client.c @@ -234,7 +234,7 @@ int main(int argc, char **argv) /* find door typed resources */ ret = iotcon_find_resource(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, - DOOR_RESOURCE_TYPE, _found_resource, &resource); + DOOR_RESOURCE_TYPE, false, _found_resource, &resource); if (IOTCON_ERROR_NONE != ret) { ERR("iotcon_find_resource() Fail(%d)", ret); iotcon_disconnect(); diff --git a/test/iotcon-test-iface-client.c b/test/iotcon-test-iface-client.c index f2a2ee9..f43312d 100644 --- a/test/iotcon-test-iface-client.c +++ b/test/iotcon-test-iface-client.c @@ -390,7 +390,7 @@ int main(int argc, char **argv) /* find room typed resources */ ret = iotcon_find_resource(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, - ROOM_RESOURCE_TYPE, _found_resource, NULL); + ROOM_RESOURCE_TYPE, false, _found_resource, NULL); if (IOTCON_ERROR_NONE != ret) { ERR("iotcon_find_resource() Fail(%d)", ret); iotcon_disconnect(); -- 2.7.4