add coap 13 support
This commit is contained in:
parent
d85ce4b42b
commit
bd45ee7aea
3 changed files with 89 additions and 57 deletions
|
@ -53,11 +53,6 @@
|
|||
#define REST_RES_TOGGLE 0
|
||||
#define REST_RES_BATTERY 1
|
||||
|
||||
#if !UIP_CONF_IPV6_RPL && !defined (CONTIKI_TARGET_MINIMAL_NET) && !defined (CONTIKI_TARGET_NATIVE)
|
||||
#warning "Compiling with static routing!"
|
||||
#include "static-routing.h"
|
||||
#endif
|
||||
|
||||
#include "erbium.h"
|
||||
#include "pcintkey.h"
|
||||
|
||||
|
@ -85,6 +80,10 @@
|
|||
#include "er-coap-03.h"
|
||||
#elif WITH_COAP == 7
|
||||
#include "er-coap-07.h"
|
||||
#elif WITH_COAP == 12
|
||||
#include "er-coap-12.h"
|
||||
#elif WITH_COAP == 13
|
||||
#include "er-coap-13.h"
|
||||
#else
|
||||
#warning "Erbium example without CoAP-specifc functionality"
|
||||
#endif /* CoAP-specific example */
|
||||
|
@ -431,7 +430,7 @@ temperature_handler(void* request, void* response, uint8_t *buffer, uint16_t pre
|
|||
}
|
||||
else
|
||||
{
|
||||
REST.set_response_status(response, REST.status.UNSUPPORTED_MADIA_TYPE);
|
||||
REST.set_response_status(response, REST.status.NOT_ACCEPTABLE);
|
||||
const char *msg = "Supporting content-types text/plain and application/json";
|
||||
REST.set_response_payload(response, msg, strlen(msg));
|
||||
}
|
||||
|
@ -466,7 +465,7 @@ battery_handler(void* request, void* response, uint8_t *buffer, uint16_t preferr
|
|||
}
|
||||
else
|
||||
{
|
||||
REST.set_response_status(response, REST.status.UNSUPPORTED_MADIA_TYPE);
|
||||
REST.set_response_status(response, REST.status.NOT_ACCEPTABLE);
|
||||
const char *msg = "Supporting content-types text/plain and application/json";
|
||||
REST.set_response_payload(response, msg, strlen(msg));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue