Yes We Can / yeswecancoap

Dependencies:   DebugLib EthernetInterface cantcoap mbed-rtos

Dependents:   COAP coap

Fork of yeswecancoap by Sille Van Landschoot

Committer:
sillevl
Date:
Wed Oct 21 10:23:21 2015 +0000
Revision:
7:1bed29e1b0a4
Parent:
6:0c477f5b79ff
Child:
23:019c530468b4
added message type support and added abstraction to request class

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sillevl 4:34a62b7cb2f9 1 #include "response.h"
sillevl 4:34a62b7cb2f9 2
sillevl 4:34a62b7cb2f9 3
sillevl 4:34a62b7cb2f9 4 Response::Response() : CoapPDU()
sillevl 4:34a62b7cb2f9 5 {
sillevl 5:1924c60356d0 6
sillevl 5:1924c60356d0 7 }
sillevl 5:1924c60356d0 8
sillevl 5:1924c60356d0 9 Response::Response(uint8_t *pdu, int pduLength) : CoapPDU(pdu, pduLength)
sillevl 5:1924c60356d0 10 {
sillevl 4:34a62b7cb2f9 11
sillevl 5:1924c60356d0 12 }
sillevl 5:1924c60356d0 13
sillevl 5:1924c60356d0 14 Response::Response(uint8_t *buffer, int bufferLength, int pduLength) : CoapPDU(buffer, bufferLength, pduLength)
sillevl 5:1924c60356d0 15 {
sillevl 4:34a62b7cb2f9 16
sillevl 6:0c477f5b79ff 17 }
sillevl 6:0c477f5b79ff 18
sillevl 6:0c477f5b79ff 19 void Response::setContent(char* content, int length)
sillevl 6:0c477f5b79ff 20 {
sillevl 7:1bed29e1b0a4 21 CoapPDU::setCode(Response::COAP_CONTENT);
sillevl 6:0c477f5b79ff 22 setPayload(reinterpret_cast<uint8_t*>(content), length);
sillevl 4:34a62b7cb2f9 23 }