OCStackResult RMAddInfo(const char *destination, void *message, bool isRequest,
bool *doPost)
{
OCStackResult RMAddInfo(const char *destination, void *message, bool isRequest,
bool *doPost)
{
RM_NULL_CHECK_WITH_RET(message, TAG, "options");
CAHeaderOption_t **options = NULL;
RM_NULL_CHECK_WITH_RET(message, TAG, "options");
CAHeaderOption_t **options = NULL;
RM_NULL_CHECK_WITH_RET(options, TAG, "options");
RM_NULL_CHECK_WITH_RET(*options, TAG, "invalid option");
RM_NULL_CHECK_WITH_RET(numOptions, TAG, "numOptions");
RM_NULL_CHECK_WITH_RET(options, TAG, "options");
RM_NULL_CHECK_WITH_RET(*options, TAG, "invalid option");
RM_NULL_CHECK_WITH_RET(numOptions, TAG, "numOptions");
- OIC_LOG_V(DEBUG, TAG, "adding srcgid: %u in endpoint [%d]",
- *((uint32_t *)endpoint->routeData), sLen);
+
+ uint32_t rData1 = 0;
+ memcpy(&rData1, endpoint->routeData, sizeof(rData1));
+ OIC_LOG_V(DEBUG, TAG, "adding srcgid: %u in endpoint [%d]", rData1, sLen);
{
memcpy(endpoint->routeData + GATEWAY_ID_LENGTH,
(*options + routeIndex)->optionData + count, ENDPOINT_ID_LENGTH);
{
memcpy(endpoint->routeData + GATEWAY_ID_LENGTH,
(*options + routeIndex)->optionData + count, ENDPOINT_ID_LENGTH);
- OIC_LOG_V(DEBUG, TAG, "adding srceid: %u in endpoint",
- *((uint16_t *)(endpoint->routeData + GATEWAY_ID_LENGTH)));
+
+ uint16_t rData2 = 0;
+ memcpy(&rData2, endpoint->routeData + GATEWAY_ID_LENGTH, sizeof(rData2));
+ OIC_LOG_V(DEBUG, TAG, "adding srceid: %u in endpoint", rData2);
for (uint32_t i = 0; i < numOptions; i++)
{
OIC_LOG_V(DEBUG, TAG, "Request- optionID: %u", options[i].optionID);
for (uint32_t i = 0; i < numOptions; i++)
{
OIC_LOG_V(DEBUG, TAG, "Request- optionID: %u", options[i].optionID);
RM_NULL_CHECK_WITH_RET(optValue, RM_TAG, "optValue");
RM_NULL_CHECK_WITH_RET(options, RM_TAG, "options");
RM_NULL_CHECK_WITH_RET(optValue, RM_TAG, "optValue");
RM_NULL_CHECK_WITH_RET(options, RM_TAG, "options");
OIC_LOG_V(DEBUG, RM_TAG, "createoption dlen %u slen [%u]", dLen, sLen);
unsigned int totalLength = 0;
OIC_LOG_V(DEBUG, RM_TAG, "createoption dlen %u slen [%u]", dLen, sLen);
unsigned int totalLength = 0;
if (0 == dLen && 0 == sLen)
{
OIC_LOG(DEBUG, RM_TAG, "Source and destination is not present");
if (0 == dLen && 0 == sLen)
{
OIC_LOG(DEBUG, RM_TAG, "Source and destination is not present");
OIC_LOG_V(INFO, RM_TAG, "Option Length is %d", options->optionLength);
OICFree(tempData);
OIC_LOG_V(INFO, RM_TAG, "Option Length is %d", options->optionLength);
OICFree(tempData);
RM_NULL_CHECK_WITH_RET(options, RM_TAG, "options");
RM_NULL_CHECK_WITH_RET(optValue, RM_TAG, "optValue");
if (0 == options->optionLength)
RM_NULL_CHECK_WITH_RET(options, RM_TAG, "options");
RM_NULL_CHECK_WITH_RET(optValue, RM_TAG, "optValue");
if (0 == options->optionLength)
OIC_LOG_V(INFO, RM_TAG, "Option Sender Addr is [%u][%u]", optValue->srcGw, optValue->srcEp);
OIC_LOG_V(INFO, RM_TAG, "Option Dest Addr is [%u][%u]", optValue->destGw, optValue->destEp);
OIC_LOG_V(INFO, RM_TAG, "Message Type is [%u]", optValue->msgType);
OIC_LOG_V(INFO, RM_TAG, "Option Sender Addr is [%u][%u]", optValue->srcGw, optValue->srcEp);
OIC_LOG_V(INFO, RM_TAG, "Option Dest Addr is [%u][%u]", optValue->destGw, optValue->destEp);
OIC_LOG_V(INFO, RM_TAG, "Message Type is [%u]", optValue->msgType);