if (SEND_TYPE_UNICAST == type)
{
+ OIC_LOG(DEBUG,TAG,"Unicast message");
if (NULL != data->requestInfo)
{
OIC_LOG(DEBUG, TAG, "requestInfo is available..");
else
{
OIC_LOG(DEBUG, TAG, "request info, response info is empty");
+ return;
}
// interface controller function call.
coap_delete_pdu(pdu);
}
+ else
+ {
+ OIC_LOG_V(ERROR,TAG,"Failed to generate unicast PDU");
+ return;
+ }
}
else if (SEND_TYPE_MULTICAST == type)
{
- OIC_LOG(DEBUG, TAG, "both requestInfo & responseInfo is not available");
+ OIC_LOG(DEBUG,TAG,"Multicast message");
+ if (NULL != data->requestInfo)
+ {
+ OIC_LOG(DEBUG, TAG, "requestInfo is available..");
+ CAInfo_t *info = &data->requestInfo->info;
- CAInfo_t *info = &data->requestInfo->info;
+ info->options = data->options;
+ info->numOptions = data->numOptions;
- info->options = data->options;
- info->numOptions = data->numOptions;
+ pdu = CAGeneratePDU(CA_GET, info);
+ if (NULL != pdu)
+ {
+ CALogPDUInfo(pdu);
- pdu = CAGeneratePDU(CA_GET, info);
- if (NULL != pdu)
- {
- CALogPDUInfo(pdu);
+ res = CASendMulticastData(data->remoteEndpoint, pdu->hdr, pdu->length);
+ if (CA_STATUS_OK != res)
+ {
+ OIC_LOG_V(ERROR, TAG, "send failed:%d", res);
+ coap_delete_pdu(pdu);
+ return;
+ }
- res = CASendMulticastData(data->remoteEndpoint, pdu->hdr, pdu->length);
- if (CA_STATUS_OK != res)
- {
- OIC_LOG_V(ERROR, TAG, "send failed:%d", res);
coap_delete_pdu(pdu);
- return;
}
-
- coap_delete_pdu(pdu);
+ else
+ {
+ OIC_LOG_V(ERROR,TAG,"Failed to generate multicast PDU");
+ }
+ }
+ else
+ {
+ OIC_LOG_V(ERROR, TAG, "request info is empty");
}
}
if (SEND_TYPE_UNICAST == type)
{
+ OIC_LOG(DEBUG,TAG,"Unicast Message");
coap_pdu_t *pdu = NULL;
if (NULL != data->requestInfo)
else
{
OIC_LOG(DEBUG, TAG, "request info, response info is empty");
+ return;
}
// interface controller function call.
coap_delete_pdu(pdu);
}
+ else
+ {
+ OIC_LOG_V(ERROR,TAG,"Failed to Generate Unicast PDU");
+ return;
+ }
}
else if (SEND_TYPE_MULTICAST == type)
{
- OIC_LOG(DEBUG, TAG, "both requestInfo & responseInfo is not available");
+ OIC_LOG(DEBUG,TAG,"Multicast Message");
+ if (NULL != data->requestInfo)
+ {
+ OIC_LOG(DEBUG, TAG, "reqInfo avlbl");
- CAInfo_t *info = &data->requestInfo->info;
+ CAInfo_t *info = &data->requestInfo->info;
- info->options = data->options;
- info->numOptions = data->numOptions;
+ info->options = data->options;
+ info->numOptions = data->numOptions;
- coap_pdu_t *pdu = (coap_pdu_t *)CAGeneratePDU(CA_GET, info);
+ coap_pdu_t *pdu = (coap_pdu_t *)CAGeneratePDU(CA_GET, info);
- if (NULL != pdu)
- {
- CALogPDUInfo(pdu);
- res = CASendMulticastData(data->remoteEndpoint, pdu->hdr, pdu->length);
- if(CA_STATUS_OK != res)
+ if (NULL != pdu)
{
- OIC_LOG_V(ERROR, TAG, "send failed:%d", res);
+ CALogPDUInfo(pdu);
+ res = CASendMulticastData(data->remoteEndpoint, pdu->hdr, pdu->length);
+ if(CA_STATUS_OK != res)
+ {
+ OIC_LOG_V(ERROR, TAG, "send failed:%d", res);
+ coap_delete_pdu(pdu);
+ return;
+ }
coap_delete_pdu(pdu);
- return;
}
- coap_delete_pdu(pdu);
+ else
+ {
+ OIC_LOG(ERROR,TAG,"Failed to Generate Multicast PDU");
+ }
+ }
+ else
+ {
+ OIC_LOG(ERROR,TAG,"requestInfo is empty");
}
}