modify "is_observable->properties", & remove tizen_info accepted/tizen/mobile/20151201.031626 accepted/tizen/tv/20151201.031650 accepted/tizen/wearable/20151201.031713 submit/tizen/20151130.235229
authoryoungman <yman.jung@samsung.com>
Fri, 27 Nov 2015 00:32:03 +0000 (09:32 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Mon, 30 Nov 2015 23:51:26 +0000 (08:51 +0900)
Change-Id: Ifd1d67c3a550e844219451ab2a76828151ea47b1
Signed-off-by: youngman <yman.jung@samsung.com>
27 files changed:
common/ic-dbus.xml
daemon/icd-dbus.c
daemon/icd-ioty-ocprocess.c
daemon/icd-ioty-ocprocess.h
daemon/icd-ioty-type.c
daemon/icd-ioty-type.h
daemon/icd-ioty.c
daemon/icd-ioty.h
daemon/icd-payload.c
daemon/icd.c
doc/iotcon_doc.h
lib/icl-dbus-type.c
lib/icl-device.c
lib/icl-device.h
lib/icl-remote-resource.c
lib/icl-remote-resource.h
lib/include/iotcon-client.h
lib/include/iotcon-constant.h
lib/include/iotcon-remote-resource.h
lib/include/iotcon-resource.h
lib/include/iotcon-types.h
lib/include/iotcon.h
packaging/iotcon.conf.in
test/iotcon-test-basic-client.c
test/iotcon-test-basic-server.c
test/iotcon-test-encap-client.c
test/iotcon-test-iface-client.c

index a05ea44b74bccd9fd48aa8b302e7680ece0e11fb..ecdd2dccafbb25aba9e738fe469b855c72159489 100644 (file)
@@ -45,6 +45,7 @@
                        <arg type="s" name="host_address" direction="in"/>
                        <arg type="i" name="connectivity" direction="in"/>
                        <arg type="s" name="type" direction="in"/>
+                       <arg type="b" name="is_secure" direction="in"/>
                        <arg type="x" name="signal_number" direction="out"/>
                        <arg type="i" name="ret" direction="out"/>
                </method>
                        <arg type="x" name="signal_number" direction="out"/>
                        <arg type="i" name="ret" direction="out"/>
                </method>
-               <method name="getTizenInfo">
-                       <arg type="s" name="host_address" direction="in"/>
-                       <arg type="i" name="connectivity" direction="in"/>
-                       <arg type="(ssi)" name="ret" direction="out"/>
-               </method>
                <method name="subscribePresence">
                        <arg type="s" name="host_address" direction="in"/>
                        <arg type="i" name="connectivity" direction="in"/>
index 02ad9c502f4822ce285235e33527a7aae6292cb6..ef959ba77b722c600df66e45628ede3ce06c38b5 100644 (file)
@@ -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",
index 46dda1192545fef593f5036f907abcfbdf1ad099..6cc37879cc3edff71b2cecf46736b7b531ccf038 100644 (file)
@@ -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;
 }
-
index e2174545a5d0633bc5973f6072182305a0c5ba6f..11e57d0d09a3516c674e59f4fb6e73b36cfb8ba6 100644 (file)
@@ -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);
 
index 8eef6f9a0e57a090241c1fb122896e64661cbe4d..08fffdf17d87bea74a963e9877113e1b1f057eeb 100644 (file)
@@ -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;
+}
index fa04cf78c4f79fe159aad7bbab2ea384c68ca8f5..1193870a08296e8fe4798358671a782cffb58d32 100644 (file)
@@ -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__*/
index d972ab89c3e50f3d891a511ca553decc4606ad23..f15c1d3ea84bf8cfb0e5d4f5076256640503669f 100644 (file)
 
 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()
 {
index ef7e71badd48e12ad899071d48558cf772ecbad3..0c00274d3b604c5e92d6df9296af98e1e2f71853 100644 (file)
 
 #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);
 
index 3937b3f87282e545f187a679b10b0d22f75f7cec..008b544af9bdb5e89dd8a65d55628d31bb557ad1 100644 (file)
@@ -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;
index 9a57719ba9017b664c9d51d3d0710227d02ac3be..c411c9dc789a5e34a656f6feb6014562f5d7431a 100644 (file)
@@ -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);
index 5fcffaf06a667d43bcd2cdc9e8274149adeeaa61..7712c22853e288c5bb3164e6e86c5a687d4cb2ec 100644 (file)
@@ -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;
 }
index dcb7242ca882e965f0eeaa78a4bbbfaec43804bb..3cb9ea25bf1c9192bd5932dfd820aa9aab0a4b21 100644 (file)
@@ -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;
 }
index aaa909fd42e31bbca9762065856ce2cafef8c723..15ccd47ca8f162418860987a31a2d4b7d81bf425 100644 (file)
@@ -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;
-}
index 2f6c0ecacb642c63499c6caaa970afd81a282494..203c6fc09de23dfdedceebbc8470875d542c5e2e 100644 (file)
@@ -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__ */
index 5db3dc44a408fc8d70c2e549d203cab642d10296..e905fefbbfcb3f19d7e538f57a9ff88f22fd8c4d 100644 (file)
@@ -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;
 }
index d36727a921c841f91f6f42861b0b478b2b222633..f14f97212c912cbb47d69b40ba51e4d88b3b3f1c 100644 (file)
@@ -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;
index fbbf00811cfab3fb4887f527a033801b2e849725..bc0198850688c808066f2dda81f411f066a43711 100644 (file)
@@ -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);
 
@@ -509,80 +511,6 @@ int iotcon_get_platform_info(const char *host_address,
 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);
-
 /**
  * @}
  */
index 70fd963b6ac236abd65ca4a9844f08ca6f79ce78..479a73d4f74187e2f48ef6e96e33be03f8c58fcf 100644 (file)
@@ -207,16 +207,6 @@ typedef enum {
        IOTCON_PLATFORM_INFO_SYSTEM_TIME, /**< Indicates reference time for the device */
 } 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.
  *
index 7b6ed0801934ee147797f54771c37b63476f2555..cd56c5a412f2450a580bbd3a64889524ad7a795c 100644 (file)
@@ -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);
index 7c49c1ba7f50487ace4ca464c5d77db99c226125..f9c8b1f128fefb9ae078cbe36e5254b5f39ffc5d 100644 (file)
@@ -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
index e3bb8ec301110e4f752539f25b440c95ec8323be..b5e90a9262c058805d485c690fec86422da226f1 100644 (file)
@@ -147,14 +147,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
index ee37e1b8c910dfed1289907a728c7bc55c4eec38..73aa6dae6ba6681820a2888da72c93ff95416bff 100644 (file)
@@ -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.
index 42c0d966718a1f911a06756ed34fd222725bfa30..9782337947d3802b35d65d821336c5be9523e782 100644 (file)
@@ -59,9 +59,6 @@
                <check send_destination="@DBUS_INTERFACE@"
                                send_interface="@DBUS_INTERFACE@" send_member="getPlatformInfo"
                                privilege="http://tizen.org/privilege/internet"/>
-               <check send_destination="@DBUS_INTERFACE@"
-                               send_interface="@DBUS_INTERFACE@" send_member="getTizenInfo"
-                               privilege="http://tizen.org/privilege/internet"/>
                <check send_destination="@DBUS_INTERFACE@"
                                send_interface="@DBUS_INTERFACE@" send_member="subscribePresence"
                                privilege="http://tizen.org/privilege/internet"/>
index 62ef31c5099c1323b44dae360a9743179e2f1cc6..6fa5e3021ca3ad6a5d785d41c88fe89408f820c5 100644 (file)
@@ -178,8 +178,8 @@ static void _on_response_post(iotcon_remote_resource_h resource,
                return;
        }
 
-       ret = iotcon_remote_resource_create(host, connectivity_type, created_uri_path, true,
-                       types, ifaces, &new_door_resource);
+       ret = iotcon_remote_resource_create(host, connectivity_type, created_uri_path,
+                       IOTCON_RESOURCE_NO_PROPERTY, types, ifaces, &new_door_resource);
        if (IOTCON_ERROR_NONE != ret) {
                ERR("iotcon_remote_resource_create() Fail(%d)", ret);
                return;
@@ -376,35 +376,6 @@ static int _device_id_compare(const void *a, const void *b)
        return strcmp(a, b);
 }
 
-static void _request_tizen_info(iotcon_tizen_info_h info, iotcon_error_e result,
-               void *user_data)
-{
-       int ret;
-       char *device_name = NULL;
-       char *tizen_device_id = NULL;
-
-       RETM_IF(IOTCON_ERROR_NONE != result,
-                       "_request_tizen_info Response error(%d)", result);
-
-       ret = iotcon_tizen_info_get_property(info, IOTCON_TIZEN_INFO_DEVICE_NAME,
-                       &device_name);
-       if (IOTCON_ERROR_NONE != ret) {
-               ERR("iotcon_tizen_info_get_property() Fail(%d)", ret);
-               return;
-       }
-
-       ret = iotcon_tizen_info_get_property(info, IOTCON_TIZEN_INFO_TIZEN_DEVICE_ID,
-                       &tizen_device_id);
-       if (IOTCON_ERROR_NONE != ret) {
-               ERR("iotcon_tizen_info_get_property() Fail(%d)", ret);
-               return;
-       }
-
-       INFO("This is Tizen Device.");
-       INFO("- Device name : %s", device_name);
-       INFO("- Tizen Device ID : %s", tizen_device_id);
-}
-
 static void _on_response(iotcon_remote_resource_h resource, iotcon_error_e err,
                iotcon_request_type_e request_type, iotcon_response_h response, void *user_data)
 {
@@ -535,15 +506,6 @@ static void _found_resource(iotcon_remote_resource_h resource, iotcon_error_e re
                return;
        }
 
-       /* request tizen info */
-       ret = iotcon_get_tizen_info(resource_host, connectivity_type, _request_tizen_info, NULL);
-       if (IOTCON_ERROR_NONE != ret) {
-               ERR("iotcon_get_tizen_info() Fail(%d)", ret);
-               device_id_list = g_list_remove(device_id_list, door_resource_device_id);
-               free(door_resource_device_id);
-               return;
-       }
-
        ret = iotcon_add_presence_cb(resource_host, connectivity_type, DOOR_RESOURCE_TYPE,
                        _presence_handler, NULL, &presence_handle);
        if (IOTCON_ERROR_NONE != ret) {
@@ -566,8 +528,8 @@ static void _found_resource(iotcon_remote_resource_h resource, iotcon_error_e re
                        return;
                }
 
-               ret = iotcon_remote_resource_observe_register(resource_clone, IOTCON_OBSERVE_IGNORE_OUT_OF_ORDER, NULL,
-                               _on_observe, NULL);
+               ret = iotcon_remote_resource_observe_register(resource_clone,
+                               IOTCON_OBSERVE_IGNORE_OUT_OF_ORDER, NULL, _on_observe, NULL);
 
                if (IOTCON_ERROR_NONE != ret) {
                        ERR("iotcon_remote_resource_observe_register() Fail(%d)", ret);
@@ -622,7 +584,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, NULL);
+                       DOOR_RESOURCE_TYPE, false, _found_resource, NULL);
        if (IOTCON_ERROR_NONE != ret) {
                ERR("iotcon_find_resource() Fail(%d)", ret);
                iotcon_disconnect();
index 69f5e059c4dad485809b4d1eeb68bcd9342b0443..21d63f2c8491574960c81518dc72480ae45ec11b 100644 (file)
@@ -354,7 +354,7 @@ static int _request_handler_post(door_resource_s *door, iotcon_request_h request
        }
 
        new_door_handle = _create_door_resource(DOOR_RESOURCE_URI2, door->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;
index ca4d3a8312f507938446d000f925e3e52bfb191c..d7f4d7b23836418088fe6b3daaa8f3d960dbb962 100644 (file)
@@ -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();
index f2a2ee9947d95ddb9164feb558a0db410f8558e0..f43312ded1c705a4496c76f8a83886b1bd48ffd2 100644 (file)
@@ -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();