Murata RF modules are designed to simplify wireless development and certification by minimizing the amount of RF expertise you need to wirelessly enable a wide range of applications.

Indication/HTTPResponseIndication.cpp

Committer:
yangcq88517
Date:
2016-03-16
Revision:
9:0ce800923eda
Parent:
2:f8e393a81c25

File content as of revision 9:0ce800923eda:

#include "HTTPResponseIndication.h"

using namespace SmartLabMuRata;

HTTPResponseIndication::HTTPResponseIndication(Payload * payload)
    : Payload(payload)
{
    if (payload == NULL)
        return;
        
    contentLength = (GetData()[2] & 0x7F) << 8 | GetData()[3];
    GetData()[PAYLOAD_OFFSET + contentLength] = 0x00;
}

bool HTTPResponseIndication::isMoreDataComing()
{
    return (GetData()[2] >> 7) == 0x01 ? true : false;
}

int HTTPResponseIndication::GetContentLength()
{
    return contentLength;
}

char HTTPResponseIndication::GetContent(int index)
{
    return GetData()[index + PAYLOAD_OFFSET];
}

const char * HTTPResponseIndication::GetContent()
{
    return GetData() + PAYLOAD_OFFSET;
}

int HTTPResponseIndication::GetContentOffset()
{
    return PAYLOAD_OFFSET;
}