Clean-up and fix for rest-server-example.
This commit is contained in:
parent
3b2fe65c66
commit
ed92994784
6 changed files with 13 additions and 13 deletions
|
@ -5,8 +5,10 @@ CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
|
|||
|
||||
# for static routing, if enabled
|
||||
ifneq ($(TARGET), minimal-net)
|
||||
ifneq ($(TARGET), native)
|
||||
PROJECT_SOURCEFILES += static-routing.c
|
||||
endif
|
||||
endif
|
||||
|
||||
# variable for root Makefile.include
|
||||
WITH_UIP6=1
|
||||
|
@ -25,7 +27,7 @@ else
|
|||
${info INFO: compiling without RPL}
|
||||
UIP_CONF_RPL=0
|
||||
CFLAGS += -DUIP_CONF_ND6_DEF_MAXDADNS=0
|
||||
CFLAGS += -DHARD_CODED_ADDRESS=\"2001:620:8:1010::10\"
|
||||
CFLAGS += -DHARD_CODED_ADDRESS=\"fdfd::10\"
|
||||
CFLAGS += -DUIP_CONF_BUFFER_SIZE=1280
|
||||
endif
|
||||
|
||||
|
@ -37,13 +39,11 @@ ifeq ($(WITH_COAP), 7)
|
|||
${info INFO: compiling with CoAP-07}
|
||||
CFLAGS += -DWITH_COAP=7
|
||||
CFLAGS += -DREST=coap_rest_implementation
|
||||
CFLAGS += -DUIP_CONF_TCP=0
|
||||
APPS += er-coap-07
|
||||
else ifeq ($(WITH_COAP), 3)
|
||||
${info INFO: compiling with CoAP-03}
|
||||
CFLAGS += -DWITH_COAP=3
|
||||
CFLAGS += -DREST=coap_rest_implementation
|
||||
CFLAGS += -DUIP_CONF_TCP=0
|
||||
APPS += er-coap-03
|
||||
else
|
||||
${info INFO: compiling with HTTP}
|
||||
|
|
|
@ -381,16 +381,14 @@ separate_handler(void* request, void* response, uint8_t *buffer, uint16_t prefer
|
|||
*/
|
||||
if (separate_active)
|
||||
{
|
||||
REST.set_response_status(response, REST.status.SERVICE_UNAVAILABLE);
|
||||
const char *msg = "AlreadyInUse";
|
||||
REST.set_response_payload(response, msg, strlen(msg));
|
||||
coap_separate_reject();
|
||||
}
|
||||
else
|
||||
{
|
||||
separate_active = 1;
|
||||
|
||||
/* Take over and skip response by engine. */
|
||||
coap_separate_yield(request, &separate_store->request_metadata);
|
||||
coap_separate_accept(request, &separate_store->request_metadata);
|
||||
/* Be aware to respect the Block2 option, which is also stored in the coap_separate_t. */
|
||||
|
||||
/*
|
||||
|
@ -710,8 +708,7 @@ PROCESS_THREAD(rest_server_example, ev, data)
|
|||
rest_activate_event_resource(&resource_event);
|
||||
#endif
|
||||
#if defined (PLATFORM_HAS_BUTTON) && REST_RES_SEPARATE && WITH_COAP > 3
|
||||
/* Use this pre-handler for separate response resources. */
|
||||
rest_set_pre_handler(&resource_separate, coap_separate_handler);
|
||||
/* No pre-handler anymore, user coap_separate_accept() and coap_separate_reject(). */
|
||||
rest_activate_resource(&resource_separate);
|
||||
#endif
|
||||
#if defined (PLATFORM_HAS_BUTTON) && (REST_RES_EVENT || (REST_RES_SEPARATE && WITH_COAP > 3))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue