int last_get_result;
-static bool _request_device_info(iotcon_device_info_h info, iotcon_error_e result,
- void *user_data)
-{
- int ret;
- char *device_id = NULL;
-
- LOG_DEBUG("device info found");
-
- ret = iotcon_device_info_get_property(info, IOTCON_DEVICE_INFO_ID, &device_id);
- if (IOTCON_ERROR_NONE != ret) {
- return false;
- }
-
- LOG_DEBUG("device_id : %s", device_id);
-
- comp_context_t *comp_ctx = comp_context_get_context();
- comp_ctx->device_uuid = g_strdup(device_id);
-
- /*
- "Group device" resource
- The Group device resource is only one per device.
- resource type is core.comp.group.device
- This resource has device information as an attribute.
- The resource uri is /comp/group/device + certain uuid.
- ex) /comp/group/device123123
- */
- //comp_iot_add_resource(FN_RESOURCE_TYPE_GROUP_DEVICE, comp_ctx->device_uuid);
-
- return false;
-}
-
int comp_iot_initialize()
{
+ char *device_id = NULL;
char data_dir[MAX_FILE_PATH_LEN] = {0,};
snprintf(data_dir, MAX_FILE_PATH_LEN, "%s/network/%s",
}
LOG_DEBUG("iotcon_initialize : %s", get_error_message(ret));
- ret = iotcon_find_device_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_ALL,
- NULL, _request_device_info, NULL);
- if (IOTCON_ERROR_NONE != ret) {
- LOG_ERR("iotcon_find_device_info: Failed %s", get_error_message(ret));
- return false;
- }
+ OicUuid_t uuid;
+ ret = GetDoxmDeviceID(&uuid);
+ if (OC_STACK_OK != ret)
+ LOG_DEBUG("GetDoxmDevOwnerId failed = [%d][%s]", ret, get_error_message(ret));
+
+ ret = ConvertUuidToStr(&uuid, &device_id);
+ if (OC_STACK_OK != ret)
+ LOG_DEBUG("ConvertUuidToStr failed = [%d][%s]", ret, get_error_message(ret));
+
+ LOG_DEBUG("device_id : %s", device_id);
+
+ comp_context_t *comp_ctx = comp_context_get_context();
+ comp_ctx->device_uuid = g_strdup(device_id);
/* Do Self-Ownership Transfer */
ret = OCConfigSelfOwnership();