# Default Makefile, for host native GNRC-based networking # name of your application APPLICATION = gcoap_example # If no BOARD is found in the environment, use this default: BOARD ?= native # This has to be the absolute path to the RIOT base directory: RIOTBASE ?= $(CURDIR)/../.. # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present USEMODULE += netdev_default # use GNRC by default LWIP_IPV4 ?= 0 LWIP_IPV6 ?= 0 ifeq (,$(filter 1, $(LWIP_IPV4) $(LWIP_IPV6))) USEMODULE += auto_init_gnrc_netif # Specify the mandatory networking modules USEMODULE += gnrc_ipv6_default # Additional networking modules that can be dropped if not needed USEMODULE += gnrc_icmpv6_echo else ifeq (1,$(LWIP_IPV4)) USEMODULE += ipv4_addr USEMODULE += lwip_arp USEMODULE += lwip_ipv4 USEMODULE += lwip_dhcp_auto CFLAGS += -DETHARP_SUPPORT_STATIC_ENTRIES=1 endif ifeq (1,$(LWIP_IPV6)) USEMODULE += ipv6_addr USEMODULE += lwip_ipv6 USEMODULE += lwip_ipv6_autoconfig endif endif USEMODULE += gcoap # Required by gcoap example USEMODULE += od USEMODULE += fmt USEMODULE += netutils USEMODULE += random # Add also the shell, some shell commands USEMODULE += shell USEMODULE += shell_cmds_default USEMODULE += uri_parser USEMODULE += ps # /rtc resource for regular observe notifications FEATURES_OPTIONAL += periph_rtc # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: DEVELHELP ?= 1 # Change this to 0 show compiler invocation lines by default: QUIET ?= 1 # Instead of simulating an Ethernet connection, we can also simulate # an IEEE 802.15.4 radio using ZEP USE_ZEP ?= 0 # set the ZEP port for native ZEP_PORT_BASE ?= 17754 ifeq (1,$(USE_ZEP)) USEMODULE += socket_zep endif # Pass through application configuration to the docker container, if # BUILD_IN_DOCKER=1 is used: DOCKER_ENV_VARS += LWIP_IPV4 DOCKER_ENV_VARS += LWIP_IPV6 DOCKER_ENV_VARS += USE_ZEP DOCKER_ENV_VARS += ZEP_PORT_BASE include $(RIOTBASE)/Makefile.include ifneq (,$(filter periph_rtc,$(USEMODULE))) USEMODULE += event_periodic USEMODULE += event_periodic_callback USEMODULE += event_thread USEMODULE += ztimer_msec endif # For now this goes after the inclusion of Makefile.include so Kconfig symbols # are available. Only set configuration via CFLAGS if Kconfig is not being used # for this module. ifndef CONFIG_KCONFIG_MODULE_GCOAP ## Uncomment to redefine port, for example use 61616 for RFC 6282 UDP compression. #GCOAP_PORT = 5683 #CFLAGS += -DCONFIG_GCOAP_PORT=$(GCOAP_PORT) ## Uncomment to redefine request token length, max 8. #GCOAP_TOKENLEN = 2 #CFLAGS += -DCONFIG_GCOAP_TOKENLEN=$(GCOAP_TOKENLEN) # Increase from default for confirmable block2 follow-on requests GCOAP_RESEND_BUFS_MAX ?= 2 CFLAGS += -DCONFIG_GCOAP_RESEND_BUFS_MAX=$(GCOAP_RESEND_BUFS_MAX) endif