}
printf("Data: %s\n", requestInfo->info.payload);
printf("Message type: %s\n", MESSAGE_TYPE[requestInfo->info.type]);
+ printf("Resource URI: %s \n", requestInfo->info.resourceUri);
if (requestInfo->info.options)
{
printf("Data: %s\n", responseInfo->info.payload);
printf("Message type: %s\n", MESSAGE_TYPE[responseInfo->info.type]);
printf("Token: %s\n", responseInfo->info.token);
+ printf("Resource URI: %s \n", responseInfo->info.resourceUri);
+
if (responseInfo->info.options)
{
uint32_t len = responseInfo->info.numOptions;
.payloadSize = 0,
.resourceUri = resourceUri };
- if(CA_MSG_RESET != messageType)
+ if (CA_MSG_RESET == messageType ||
+ (CA_MSG_ACKNOWLEDGE == messageType && CA_EMPTY == responseCode))
+ {
+ printf("RESET or ACK/EMPTY. there will be not payload/option\n");
+
+ }
+ else
{
responseData.token = (info != NULL) ? info->token : NULL;
responseData.tokenLength = (info != NULL) ? info->tokenLength : 0;
// Get file length
fseek(file, 0, SEEK_END);
fileLen = ftell(file);
+ if (-1 == fileLen)
+ {
+ fprintf(stderr, "Failed to get file length\n");
+ fclose(file);
+ return false;
+ }
fseek(file, 0, SEEK_SET);
// Allocate memory