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.

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers HTTPResponseIndication.cpp Source File

HTTPResponseIndication.cpp

00001 #include "HTTPResponseIndication.h"
00002 
00003 using namespace SmartLabMuRata;
00004 
00005 HTTPResponseIndication::HTTPResponseIndication(Payload * payload)
00006     : Payload(payload)
00007 {
00008     if (payload == NULL)
00009         return;
00010         
00011     contentLength = (GetData()[2] & 0x7F) << 8 | GetData()[3];
00012     GetData()[PAYLOAD_OFFSET + contentLength] = 0x00;
00013 }
00014 
00015 bool HTTPResponseIndication::isMoreDataComing()
00016 {
00017     return (GetData()[2] >> 7) == 0x01 ? true : false;
00018 }
00019 
00020 int HTTPResponseIndication::GetContentLength()
00021 {
00022     return contentLength;
00023 }
00024 
00025 char HTTPResponseIndication::GetContent(int index)
00026 {
00027     return GetData()[index + PAYLOAD_OFFSET];
00028 }
00029 
00030 const char * HTTPResponseIndication::GetContent()
00031 {
00032     return GetData() + PAYLOAD_OFFSET;
00033 }
00034 
00035 int HTTPResponseIndication::GetContentOffset()
00036 {
00037     return PAYLOAD_OFFSET;
00038 }