int icd_cynara_init()
{
#ifdef TZ_VER_3
- int ret;
- ret = cynara_initialize(&_cynara, NULL);
-
+ int ret = cynara_initialize(&_cynara, NULL);
if (CYNARA_API_SUCCESS != ret) {
ERR("cynara_initialize() Fail(%d)", ret);
return IOTCON_ERROR_SYSTEM;
ret = cynara_creds_gdbus_get_client(conn, sender, CLIENT_METHOD_SMACK, &client);
if (CYNARA_API_SUCCESS != ret) {
- ERR("cynara_creds_dbus_get_client() Fail(%d)", ret);
+ ERR("cynara_creds_gdbus_get_client() Fail(%d)", ret);
return IOTCON_ERROR_SYSTEM;
}
ret = cynara_creds_gdbus_get_user(conn, sender, USER_METHOD_UID, &user);
if (CYNARA_API_SUCCESS != ret) {
- ERR("cynara_creds_dbus_get_user() Fail(%d)", ret);
+ ERR("cynara_creds_gdbus_get_user() Fail(%d)", ret);
free(client);
return IOTCON_ERROR_SYSTEM;
}
client = calloc(1, sizeof(icd_dbus_client_s));
if (NULL == client) {
- ERR("calloc(client) Fail(%d)", errno);
+ ERR("calloc() Fail(%d)", errno);
return IOTCON_ERROR_OUT_OF_MEMORY;
}
presence_handle = calloc(1, sizeof(icd_presence_handle_s));
if (NULL == presence_handle) {
- ERR("calloc(handle) Fail(%d)", errno);
+ ERR("calloc() Fail(%d)", errno);
return IOTCON_ERROR_OUT_OF_MEMORY;
}
presence_handle->handle = handle;
encap_handle = calloc(1, sizeof(icd_encap_handle_s));
if (NULL == encap_handle) {
- ERR("calloc(handle) Fail(%d)", errno);
+ ERR("calloc() Fail(%d)", errno);
return IOTCON_ERROR_OUT_OF_MEMORY;
}
encap_handle->type = type;
int ret;
char signal_name[IC_DBUS_SIGNAL_LENGTH] = {0};
- ret = snprintf(signal_name, sizeof(signal_name), "%s_%"PRIx64, signal_prefix, signal_number);
+ ret = snprintf(signal_name, sizeof(signal_name), "%s_%"PRIx64, signal_prefix,
+ signal_number);
if (ret <= 0 || sizeof(signal_name) <= ret) {
ERR("snprintf() Fail(%d)", ret);
g_variant_unref(value);
break;
case OC_OBSERVE_NO_OPTION:
default:
- ERR("Invalid action (%d)", oic_action);
+ ERR("Invalid action(%d)", oic_action);
action = IOTCON_OBSERVE_NO_TYPE;
}
return action;
{
struct icd_req_context *req_ctx = ctx;
+ RET_IF(NULL == ctx);
+
free(req_ctx->bus_name);
if (req_ctx->payload)
g_variant_unref(req_ctx->payload);
g_variant_builder_unref(req_ctx->options);
g_variant_builder_unref(req_ctx->query);
+
free(req_ctx);
}
RETV_IF(NULL == ctx, OC_STACK_KEEP_TRANSACTION);
RETV_IF(NULL == resp, OC_STACK_KEEP_TRANSACTION);
if (NULL == resp->payload)
- /* normal case : payload COULD be NULL */
- return OC_STACK_KEEP_TRANSACTION;
+ return OC_STACK_KEEP_TRANSACTION; /* normal case : payload COULD be NULL */
RETVM_IF(PAYLOAD_TYPE_DISCOVERY != resp->payload->type,
OC_STACK_KEEP_TRANSACTION, "Invalid payload type(%d)", resp->payload->type);
oc_qos = _icd_ioty_convert_qos(qos);
icd_ioty_csdk_lock();
- /* TODO : QoS is come from lib. */
+ // TODO: QoS is come from lib.
if (msg_length)
ret = OCNotifyListOfObservers(handle, obs_ids, obs_length, payload, oc_qos);
else
icd_ioty_csdk_unlock();
if (OC_STACK_OK != result) {
- ERR("OCDoResource() Fail(%d)", result);
+ ERR("OCDoResource(DISCOVER) Fail(%d)", result);
free(context->bus_name);
free(context);
return icd_ioty_convert_error(result);
free(uri);
if (OC_STACK_OK != result) {
- ERR("OCDoResource() Fail(%d)", result);
+ ERR("OCDoResource(CRUD:%d) Fail(%d)", rest_type, result);
icd_ioty_complete_error(type, invocation, icd_ioty_convert_error(result));
return TRUE;
}
icd_ioty_csdk_unlock();
if (OC_STACK_OK != result) {
- ERR("OCDoResource() Fail(%d)", result);
+ ERR("OCDoResource(OBSERVE:%d) Fail(%d)", method, result);
if (cbdata->cd)
cbdata->cd(cbdata->context);
return NULL;
icd_ioty_csdk_unlock();
if (OC_STACK_OK != result) {
- ERR("OCDoResource() Fail(%d)", result);
+ ERR("OCDoResource(DISCOVER) Fail(%d)", result);
free(context->bus_name);
free(context);
return icd_ioty_convert_error(result);
ret = system_info_get_platform_string(ICD_SYSTEM_INFO_TIZEN_ID,
&platform_info.platformID);
if (SYSTEM_INFO_ERROR_NONE != ret) {
- ERR("system_info_get_platform_string() Fail(%d)", ret);
+ ERR("system_info_get_platform_string(tizenid) Fail(%d)", ret);
_ioty_free_platform_info(platform_info);
return IOTCON_ERROR_SYSTEM;
}
ret = system_info_get_platform_string(ICD_SYSTEM_INFO_MANUF_NAME,
&platform_info.manufacturerName);
if (SYSTEM_INFO_ERROR_NONE != ret) {
- ERR("system_info_get_platform_string() Fail(%d)", ret);
+ ERR("system_info_get_platform_string(manufacturer) Fail(%d)", ret);
_ioty_free_platform_info(platform_info);
return IOTCON_ERROR_SYSTEM;
}
ret = system_info_get_platform_string(ICD_SYSTEM_INFO_MODEL_NAME,
&platform_info.modelNumber);
- WARN_IF(SYSTEM_INFO_ERROR_NONE != ret, "system_info_get_platform_string() Fail(%d)", ret);
+ if (SYSTEM_INFO_ERROR_NONE != ret)
+ WARN("system_info_get_platform_string(model_name) Fail(%d)", ret);
ret = system_info_get_platform_string(ICD_SYSTEM_INFO_PLATFORM_VERSION,
&platform_info.platformVersion);
- WARN_IF(SYSTEM_INFO_ERROR_NONE != ret, "system_info_get_platform_string() Fail(%d)", ret);
+ if (SYSTEM_INFO_ERROR_NONE != ret)
+ WARN("system_info_get_platform_string(platform.version) Fail(%d)", ret);
ret = system_info_get_platform_string(ICD_SYSTEM_INFO_BUILD_STRING,
&platform_info.firmwareVersion);
- WARN_IF(SYSTEM_INFO_ERROR_NONE != ret, "system_info_get_platform_string() Fail(%d)", ret);
+ if (SYSTEM_INFO_ERROR_NONE != ret)
+ WARN("system_info_get_platform_string(build.string) Fail(%d)", ret);
/* platform_info.manufacturerUrl */
/* platform_info.dateOfManufacture */
icd_ioty_csdk_unlock();
if (OC_STACK_OK != result) {
- ERR("OCDoResource() Fail(%d)", result);
+ ERR("OCDoResource(PRESENCE) Fail(%d)", result);
_icd_ioty_presence_table_remove(address);
return NULL;
}
icd_ioty_csdk_unlock();
if (OC_STACK_OK != result)
- ERR("OCDoResource() Fail(%d)", result);
+ ERR("OCDoResource(GET) Fail(%d)", result);
return G_SOURCE_CONTINUE;
}
g_variant_builder_init(&repr, G_VARIANT_TYPE("a{sv}"));
g_variant_builder_init(&children, G_VARIANT_TYPE("av"));
- value = g_variant_new("(sasasa{sv}av)", IC_STR_NULL, &ifaces, &types, &repr, &children);
+ value = g_variant_new("(sasasa{sv}av)", IC_STR_NULL, &ifaces, &types, &repr,
+ &children);
return value;
}
value = icl_value_create_byte_str(val, len);
if (NULL == value) {
- ERR("icl_value_create_str() Fail");
+ ERR("icl_value_create_byte_str() Fail");
return IOTCON_ERROR_OUT_OF_MEMORY;
}
g_variant_builder_init(&repr, G_VARIANT_TYPE("a{sv}"));
g_variant_builder_init(&children, G_VARIANT_TYPE("av"));
- value = g_variant_new("(sasasa{sv}av)", IC_STR_NULL, &ifaces, &types, &repr, &children);
+ value = g_variant_new("(sasasa{sv}av)", IC_STR_NULL, &ifaces, &types, &repr,
+ &children);
return value;
}
ret = iotcon_resource_destroy(resource);
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_unregiser_resource() Fail(%d)", ret);
+ ERR("iotcon_resource_destroy() Fail(%d)", ret);
return -1;
}
ret = iotcon_request_get_request_type(request, &type);
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_request_get_types() Fail(%d)", ret);
+ ERR("iotcon_request_get_request_type() Fail(%d)", ret);
_send_response(request, NULL, IOTCON_RESPONSE_ERROR);
return;
}
ret = iotcon_lite_resource_create(uri_path, resource_types, properties, state,
_door_state_changed, NULL, &handle);
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_resource_create() Fail");
+ ERR("iotcon_lite_resource_create() Fail");
iotcon_state_destroy(state);
iotcon_resource_types_destroy(resource_types);
return NULL;
ret = iotcon_request_get_request_type(request, &type);
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_request_get_types() Fail(%d)", ret);
+ ERR("iotcon_request_get_request_type() Fail(%d)", ret);
_send_response(request, NULL, iface, IOTCON_RESPONSE_ERROR);
return;
}
ret = iotcon_request_get_request_type(request, &type);
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_request_get_types() Fail(%d)", ret);
+ ERR("iotcon_request_get_request_type() Fail(%d)", ret);
_send_response(request, NULL, iface, IOTCON_RESPONSE_ERROR);
return;
}
ret = iotcon_request_get_request_type(request, &type);
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_request_get_types() Fail(%d)", ret);
+ ERR("iotcon_request_get_request_type() Fail(%d)", ret);
_send_response(request, NULL, iface, IOTCON_RESPONSE_ERROR);
return;
}