if (NULL == attributes_arr[i]) {
ERR("OCRepPayloadCreate() Fail");
free(attributes_arr);
- return ret;
+ return IOTCON_ERROR_OUT_OF_MEMORY;
}
ret = _icl_ioty_fill_oic_rep_payload_value(attributes_arr[i],
((icl_val_attributes_s*)node->data)->attributes);
FN_CALL;
iotcon_request_type_e req_type;
iotcon_lite_resource_h resource = user_data;
- iotcon_representation_h repr;
+ iotcon_representation_h repr = NULL;
iotcon_response_h res = NULL;
RETV_IF(NULL == resource, OC_EH_ERROR);
/* representation */
if (request->payload)
ic_ioty_parse_oic_rep_payload((OCRepPayload*)request->payload, true, &repr);
- else
- repr = NULL;
res = calloc(1, sizeof(struct icl_resource_response));
if (NULL == res) {
g_idle_add(_icl_ioty_ocprocess_lite_resource_response_idle_cb, res);
break;
case IOTCON_REQUEST_POST:
+ if(NULL == repr) {
+ ERR("repr is NULL!!");
+ break;
+ }
if (resource->cb) {
if (false == resource->cb(resource, repr->attributes, resource->cb_data)) {
res->result = IOTCON_RESPONSE_ERROR;
RETV_IF(NULL == presence_cb_data, IOTCON_ERROR_INVALID_PARAMETER);
cd = calloc(1, sizeof(icl_presence_cb_s));
- if (NULL == presence_cb_data) {
+ if (NULL == cd) {
ERR("calloc() Fail(%d)", errno);
return IOTCON_ERROR_OUT_OF_MEMORY;
}
}
INFO("notify_cb information");
- switch (opened) {
- case true:
+ if(opened)
INFO("[Door] opened.");
- break;
- case false:
+ else
INFO("[Door] closed.");
- break;
- default:
- break;
- }
if (5 == i++) {
iotcon_remote_resource_observe_deregister(resource);
return;
}
- switch (opened) {
- case true:
- INFO("door is opened");
- break;
- case false:
- INFO("door is closed");
- break;
- default:
- break;
- }
+ if(opened)
+ INFO("[Door] opened.");
+ else
+ INFO("[Door] closed.");
}
static bool _found_resource(iotcon_remote_resource_h resource, iotcon_error_e result,