gLedInstance[gCurrLedInstance].state = 0;
gLedInstance[gCurrLedInstance].power = 0;
gCurrLedInstance++;
- strncpy ((char *)response->resourceUri, newLedUri, MAX_URI_LENGTH);
+ strncpy ((char *)response->resourceUri, newLedUri, sizeof(response->resourceUri));
ehResult = OC_EH_RESOURCE_CREATED;
}
}
gLedInstance[gCurrLedInstance].state = 0;
gLedInstance[gCurrLedInstance].power = 0;
gCurrLedInstance++;
- strncpy ((char *)response->resourceUri, newLedUri, MAX_URI_LENGTH);
+ strncpy ((char *)response->resourceUri, newLedUri, sizeof(response->resourceUri));
ehResult = OC_EH_RESOURCE_CREATED;
}
}
//If there is a request being performed, cancel it to prevent retransmission.
if(motCtx->ocDoHandle)
{
- OCCancel(motCtx->ocDoHandle, OC_HIGH_QOS, NULL, 0);
+ if (OC_STACK_OK != OCCancel(motCtx->ocDoHandle, OC_HIGH_QOS, NULL, 0))
+ {
+ OIC_LOG(ERROR, TAG, "Failed to remove registered callback");
+ }
motCtx->ocDoHandle = NULL;
}
OIC_LOG(DEBUG, TAG, "OUT OTMDoOwnershipTransfer");
return OC_STACK_OK;
-
-error:
- OICFree(otmCtx->ctxResultArray);
- OICFree(otmCtx);
- return res;
}
OCStackResult OTMSetOxmAllowStatus(const OicSecOxm_t oxm, const bool allowStatus)
gLedInstance[gCurrLedInstance].state = 0;
gLedInstance[gCurrLedInstance].power = 0;
gCurrLedInstance++;
- strncpy ((char *)response->resourceUri, newLedUri, MAX_URI_LENGTH);
+ strncpy ((char *)response->resourceUri, newLedUri, sizeof(response->resourceUri));
ehResult = OC_EH_RESOURCE_CREATED;
}
}
gLedInstance[gCurrLedInstance].state = 0;
gLedInstance[gCurrLedInstance].power = 0;
gCurrLedInstance++;
- strncpy ((char *)response->resourceUri, newLedUri, MAX_URI_LENGTH);
+ strncpy ((char *)response->resourceUri, newLedUri, sizeof(response->resourceUri));
ehResult = OC_EH_RESOURCE_CREATED;
}
}