Merge pull request #13810 from benpicco/examples/gnrc_border_router-multi_zep

examples/gnrc_border_router: allow to configure more than one ZEP device
This commit is contained in:
Martine Lenders 2020-04-05 01:29:31 +02:00 committed by GitHub
commit f91f44109c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -87,6 +87,8 @@ ifeq (,$(filter native,$(BOARD)))
include $(CURDIR)/Makefile.wifi.conf include $(CURDIR)/Makefile.wifi.conf
endif endif
else else
# The number of native (emulated) ZigBee/6LoWPAN devices
ZEP_DEVICES ?= 1
include $(CURDIR)/Makefile.native.conf include $(CURDIR)/Makefile.native.conf
endif endif

View File

@ -1,6 +1,14 @@
# native has a TAP interface towards the host, just add parameters for # native has a TAP interface towards the host, just add parameters for
# `socket_zep` # `socket_zep`
TERMFLAGS += -z [::1]:17754 ZEP_PORT_BASE ?= 17754
ZEP_PORT_MAX := $(shell expr $(ZEP_PORT_BASE) + $(ZEP_DEVICES) - 1)
CFLAGS += -DSOCKET_ZEP_MAX=$(ZEP_DEVICES)
CFLAGS += -DDHCPV6_CLIENT_PFX_LEASE_MAX=$(ZEP_DEVICES)
CFLAGS += -DASYNC_READ_NUMOF=$(shell expr $(ZEP_DEVICES) + 1)
# -z [::1]:$PORT for each ZEP device
TERMFLAGS += $(patsubst %,-z [::1]:%, $(shell seq $(ZEP_PORT_BASE) $(ZEP_PORT_MAX)))
ifneq (1,$(USE_DHCPV6)) ifneq (1,$(USE_DHCPV6))
# We don't need to start ethos so just start the UHCPD daemon in the # We don't need to start ethos so just start the UHCPD daemon in the