* @param[in] endpoint port of transport.
* @return ::CASTATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
*/
-CAResult_t CAAddBlockOption(coap_pdu_t **pdu, const CAInfo_t info,
+CAResult_t CAAddBlockOption(coap_pdu_t **pdu, const CAInfo_t *info,
const CAEndpoint_t *endpoint);
/**
* @param[in] blockID ID set of CABlockData.
* @return ::CASTATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
*/
-CAResult_t CAAddBlockOption2(coap_pdu_t **pdu, const CAInfo_t info, size_t dataLength,
+CAResult_t CAAddBlockOption2(coap_pdu_t **pdu, const CAInfo_t *info, size_t dataLength,
const CABlockDataID_t *blockID);
/**
* @param[in] blockID ID set of CABlockData.
* @return ::CASTATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
*/
-CAResult_t CAAddBlockOption1(coap_pdu_t **pdu, const CAInfo_t info, size_t dataLength,
+CAResult_t CAAddBlockOption1(coap_pdu_t **pdu, const CAInfo_t *info, size_t dataLength,
const CABlockDataID_t *blockID);
/**
return CA_STATUS_OK;
}
-CAResult_t CAAddBlockOption(coap_pdu_t **pdu, const CAInfo_t info,
+CAResult_t CAAddBlockOption(coap_pdu_t **pdu, const CAInfo_t *info,
const CAEndpoint_t *endpoint)
{
OIC_LOG(DEBUG, TAG, "IN-AddBlockOption");
VERIFY_NON_NULL(pdu, TAG, "pdu");
VERIFY_NON_NULL((*pdu), TAG, "(*pdu)");
VERIFY_NON_NULL((*pdu)->hdr, TAG, "(*pdu)->hdr");
+ VERIFY_NON_NULL(info, TAG, "info");
VERIFY_NON_NULL(endpoint, TAG, "endpoint");
size_t dataLength = 0;
- if (info.payload)
+ if (info->payload)
{
- dataLength = info.payloadSize;
+ dataLength = info->payloadSize;
OIC_LOG_V(DEBUG, TAG, "dataLength - %d", dataLength);
}
{
OIC_LOG(DEBUG, TAG, "no BLOCK option");
// if response data is so large. it have to send as block transfer
- if (!coap_add_data(*pdu, dataLength, (const unsigned char *) info.payload))
+ if (!coap_add_data(*pdu, dataLength, (const unsigned char *) info->payload))
{
OIC_LOG(INFO, TAG, "it have to use block");
}
return CA_STATUS_OK;
}
-CAResult_t CAAddBlockOption2(coap_pdu_t **pdu, const CAInfo_t info, size_t dataLength,
+CAResult_t CAAddBlockOption2(coap_pdu_t **pdu, const CAInfo_t *info, size_t dataLength,
const CABlockDataID_t *blockID)
{
OIC_LOG(DEBUG, TAG, "IN-AddBlockOption2");
VERIFY_NON_NULL(pdu, TAG, "pdu");
VERIFY_NON_NULL((*pdu), TAG, "(*pdu)");
VERIFY_NON_NULL((*pdu)->hdr, TAG, "(*pdu)->hdr");
+ VERIFY_NON_NULL(info, TAG, "info");
VERIFY_NON_NULL(blockID, TAG, "blockID");
// get set block data from CABlock list-set.
}
}
- if (!coap_add_block(*pdu, dataLength, (const unsigned char *) info.payload,
+ if (!coap_add_block(*pdu, dataLength, (const unsigned char *) info->payload,
block2->num, block2->szx))
{
OIC_LOG(ERROR, TAG, "Data length is smaller than the start index");
return CA_STATUS_FAILED;
}
-CAResult_t CAAddBlockOption1(coap_pdu_t **pdu, const CAInfo_t info, size_t dataLength,
+CAResult_t CAAddBlockOption1(coap_pdu_t **pdu, const CAInfo_t *info, size_t dataLength,
const CABlockDataID_t *blockID)
{
OIC_LOG(DEBUG, TAG, "IN-AddBlockOption1");
VERIFY_NON_NULL(pdu, TAG, "pdu");
VERIFY_NON_NULL((*pdu), TAG, "(*pdu)");
VERIFY_NON_NULL((*pdu)->hdr, TAG, "(*pdu)->hdr");
+ VERIFY_NON_NULL(info, TAG, "info");
VERIFY_NON_NULL(blockID, TAG, "blockID");
// get set block data from CABlock list-set.
}
}
- if (!coap_add_block(*pdu, dataLength, (const unsigned char *) info.payload,
+ if (!coap_add_block(*pdu, dataLength, (const unsigned char *) info->payload,
block1->num, block1->szx))
{
OIC_LOG(ERROR, TAG, "Data length is smaller than the start index");
// Blockwise transfer
if (NULL != info)
{
- CAResult_t res = CAAddBlockOption(&pdu, *info,
+ CAResult_t res = CAAddBlockOption(&pdu, info,
data->remoteEndpoint);
if (CA_STATUS_OK != res)
{
#endif
{
// for retransmission
- res = CARetransmissionSentData(&g_retransmissionContext, data->remoteEndpoint, pdu->hdr,
- pdu->length);
+ res = CARetransmissionSentData(&g_retransmissionContext, data->remoteEndpoint,
+ pdu->hdr, pdu->length);
if ((CA_STATUS_OK != res) && (CA_NOT_SUPPORTED != res))
{
//when retransmission not supported this will return CA_NOT_SUPPORTED, ignore
)
{
// Blockwise transfer
- CAResult_t res = CAAddBlockOption(&pdu, data->requestInfo->info,
+ CAResult_t res = CAAddBlockOption(&pdu, &data->requestInfo->info,
data->remoteEndpoint);
if (CA_STATUS_OK != res)
{
// Blockwise transfer
if (NULL != info)
{
- CAResult_t res = CAAddBlockOption(&pdu, *info,
- data->remoteEndpoint);
+ CAResult_t res = CAAddBlockOption(&pdu, info,
+ data->remoteEndpoint);
if (CA_STATUS_OK != res)
{
OIC_LOG(INFO, TAG, "to write block option has failed");