Yes We Can / yeswecancoap

Dependencies:   DebugLib EthernetInterface cantcoap mbed-rtos

Dependents:   COAP coap

Fork of yeswecancoap by Sille Van Landschoot

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers response.cpp Source File

response.cpp

00001 #include "response.h"
00002 
00003 
00004 Response::Response() : CoapPDU()
00005 {
00006        
00007 }
00008 
00009 Response::Response(uint8_t *pdu, int pduLength) : CoapPDU(pdu, pduLength)
00010 {
00011     
00012 }
00013 
00014 Response::Response(uint8_t *buffer, int bufferLength, int pduLength) : CoapPDU(buffer, bufferLength, pduLength)
00015 {
00016     
00017 }
00018 
00019 void Response::setContent(char* content, int length)
00020 {
00021     CoapPDU::setCode(Response::COAP_CONTENT);
00022     setPayload(reinterpret_cast<uint8_t*>(content), length);
00023 }
00024 
00025 void Response::setCode(int code)
00026 {
00027     CoapPDU::setCode((CoapPDU::Code) code);   
00028 }