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.

Committer:
yangcq88517
Date:
Wed Feb 04 20:37:40 2015 +0000
Revision:
2:f8e393a81c25
Parent:
0:8e83b9448758
Child:
9:0ce800923eda
Bug Fix (Payload SetContent)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yangcq88517 0:8e83b9448758 1 #include "HTTPResponseIndication.h"
yangcq88517 0:8e83b9448758 2
yangcq88517 0:8e83b9448758 3 using namespace SmartLabMuRata;
yangcq88517 0:8e83b9448758 4
yangcq88517 0:8e83b9448758 5 HTTPResponseIndication::HTTPResponseIndication(Payload * payload)
yangcq88517 0:8e83b9448758 6 : Payload(payload)
yangcq88517 0:8e83b9448758 7 {
yangcq88517 0:8e83b9448758 8 contentLength = (GetData()[2] & 0x7F) << 8 | GetData()[3];
yangcq88517 2:f8e393a81c25 9 GetData()[PAYLOAD_OFFSET + contentLength] = 0x00;
yangcq88517 0:8e83b9448758 10 }
yangcq88517 0:8e83b9448758 11
yangcq88517 0:8e83b9448758 12 bool HTTPResponseIndication::isMoreDataComing()
yangcq88517 0:8e83b9448758 13 {
yangcq88517 0:8e83b9448758 14 return (GetData()[2] >> 7) == 0x01 ? true : false;
yangcq88517 0:8e83b9448758 15 }
yangcq88517 0:8e83b9448758 16
yangcq88517 0:8e83b9448758 17 int HTTPResponseIndication::GetContentLength()
yangcq88517 0:8e83b9448758 18 {
yangcq88517 0:8e83b9448758 19 return contentLength;
yangcq88517 0:8e83b9448758 20 }
yangcq88517 0:8e83b9448758 21
yangcq88517 0:8e83b9448758 22 char HTTPResponseIndication::GetContent(int index)
yangcq88517 0:8e83b9448758 23 {
yangcq88517 0:8e83b9448758 24 return GetData()[index + PAYLOAD_OFFSET];
yangcq88517 0:8e83b9448758 25 }
yangcq88517 0:8e83b9448758 26
yangcq88517 0:8e83b9448758 27 const char * HTTPResponseIndication::GetContent()
yangcq88517 0:8e83b9448758 28 {
yangcq88517 0:8e83b9448758 29 return GetData() + PAYLOAD_OFFSET;
yangcq88517 0:8e83b9448758 30 }
yangcq88517 0:8e83b9448758 31
yangcq88517 0:8e83b9448758 32 int HTTPResponseIndication::GetContentOffset()
yangcq88517 0:8e83b9448758 33 {
yangcq88517 0:8e83b9448758 34 return PAYLOAD_OFFSET;
yangcq88517 0:8e83b9448758 35 }