Reorganize the nrf52dk/coap-demo example to make it compatible with the new build system

This commit is contained in:
Atis Elsts 2018-02-23 17:35:41 +00:00
parent 074b797e88
commit 3d2788d4c6
7 changed files with 49 additions and 26 deletions

View File

@ -1,26 +0,0 @@
CONTIKI=../../../..
ifeq ($(MAKECMDGOALS),)
$(error Please specify whether coap-client or coap-server should be built)
endif
ifneq ($(filter coap-client coap-client.flash, $(MAKECMDGOALS)),)
ifeq ($(SERVER_IPV6_EP),)
$(error Please define SERVER_IPV6_EP=<full-coap-IPv6-URI>)
else
CFLAGS += -DSERVER_IPV6_EP=\"$(SERVER_IPV6_EP)\"
CFLAGS += -DDEVICE_NAME=\"nRF52_DK_CoAP_Client\"
endif
else
CFLAGS += -DDEVICE_NAME=\"nRF52-DK-CoAP-Server\"
endif
# automatically build RESTful resources
MODULES_REL += ./resources
# REST Engine shall use Erbium CoAP implementation
MODULES += os/net/app-layer/coap
MAKE_ROUTING = MAKE_ROUTING_NULLROUTING
include $(CONTIKI)/Makefile.include

View File

@ -0,0 +1,26 @@
CONTIKI_PROJECT = coap-client
CONTIKI=../../../../..
PLATFORMS_ONLY = nrf52dk
ifeq ($(SERVER_IPV6_EP),)
$(warning Please define SERVER_IPV6_EP=<full-coap-IPv6-URI>)
$(warning Using default SERVER_IPV6_EP=fd00::1)
SERVER_IPV6_EP=fd00::1
endif
CFLAGS += -DDEVICE_NAME=\"nRF52_DK_CoAP_Client\"
CFLAGS += -DCOAP_OBSERVE_CLIENT=1
# automatically build RESTful resources
MODULES_REL += ./resources
# REST Engine shall use Erbium CoAP implementation
MODULES += os/net/app-layer/coap
MAKE_ROUTING = MAKE_ROUTING_NULLROUTING
all: $(CONTIKI_PROJECT)
include $(CONTIKI)/Makefile.include

View File

@ -0,0 +1,22 @@
CONTIKI_PROJECT = coap-server
CONTIKI=../../../../..
PLATFORMS_ONLY = nrf52dk
CFLAGS += -DDEVICE_NAME=\"nRF52-DK-CoAP-Server\"
# automatically build RESTful resources
REST_RESOURCES_DIR = ../resources
REST_RESOURCES_FILES = $(notdir $(shell find $(REST_RESOURCES_DIR) -name '*.c' ! -name 'res-plugtest*'))
PROJECTDIRS += $(REST_RESOURCES_DIR)
PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES)
# REST Engine shall use Erbium CoAP implementation
MODULES += os/net/app-layer/coap
MAKE_ROUTING = MAKE_ROUTING_NONE
all: $(CONTIKI_PROJECT)
include $(CONTIKI)/Makefile.include

View File

@ -0,0 +1 @@
TARGET = nrf52dk