#include <stdint.h>
#include <stdlib.h>
-#include <unistd.h> /* for usleep() */
+#include <unistd.h>
#include <glib.h>
#include <ocstack.h>
dev_addr = calloc(1, sizeof(OCDevAddr));
if (NULL == dev_addr) {
ERR("calloc() Fail(%d)", errno);
+ free(req_ctx->bus_name);
free(req_ctx);
return OC_EH_ERROR;
}
req_ctx->payload = NULL;
break;
default:
+ free(req_ctx->dev_addr);
free(req_ctx->bus_name);
free(req_ctx);
return OC_EH_ERROR;
{
FN_CALL;
OCStackResult result;
+ const struct timespec delay = {0, 10 * 1000 * 1000}; /* 10 ms */
icd_ioty_alive = 1;
while (icd_ioty_alive) {
break;
}
- /* TODO : SHOULD revise time or usleep */
- usleep(10);
+ /* TODO : Current '10ms' is not proven sleep time. Revise the time after test.
+ * Or recommend changes to event driven architecture */
+ nanosleep(&delay, NULL);
}
return NULL;
context = calloc(1, sizeof(icd_sig_ctx_s));
if (NULL == context) {
ERR("calloc() Fail(%d)", errno);
+ free(uri);
return NULL;
}
context->bus_name = ic_utils_strdup(bus_name);
{
GVariant *repr_gvar;
int ret, request_type;
+ int64_t oic_request_h = 0;
+ int64_t oic_resource_h = 0;
iotcon_representation_h repr;
iotcon_state_h recv_state = NULL;
GVariantIter *repr_iter, *state_iter;
- int64_t oic_request_h, oic_resource_h;
iotcon_lite_resource_h resource = user_data;
ret = iotcon_representation_create(&repr);