mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-27 23:41:18 +01:00
tests/nanocoap_cli: allow to build with lwIP
This commit is contained in:
parent
cd03cc7723
commit
99637edbb6
@ -1,11 +1,34 @@
|
||||
include ../Makefile.net_common
|
||||
|
||||
# use GNRC by default
|
||||
LWIP_IPV4 ?= 0
|
||||
LWIP_IPV6 ?= 0
|
||||
|
||||
# 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
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
# Specify the mandatory networking modules
|
||||
USEMODULE += gnrc_ipv6_default
|
||||
|
||||
ifeq (,$(filter 1, $(LWIP_IPV4) $(LWIP_IPV6)))
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
# Specify the mandatory networking modules
|
||||
USEMODULE += gnrc_ipv6_default
|
||||
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
|
||||
|
||||
# Optionally include DNS support. This includes resolution of names at an
|
||||
# upstream DNS server and the handling of RDNSS options in Router Advertisements
|
||||
|
||||
@ -46,7 +46,7 @@ static const credman_credential_t credential = {
|
||||
#endif
|
||||
|
||||
/* _list_all_inet6() and _print_addr() derived from sc_gnrc_netif.c */
|
||||
|
||||
#ifdef MODULE_GNRC_IPV6
|
||||
static void _print_addr(ipv6_addr_t *addr, uint8_t flags)
|
||||
{
|
||||
char addr_str[IPV6_ADDR_MAX_STR_LEN];
|
||||
@ -116,6 +116,7 @@ static int _cmd_inet6(int argc, char **argv)
|
||||
}
|
||||
|
||||
SHELL_COMMAND(inet6, "IPv6 addresses", _cmd_inet6);
|
||||
#endif
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
#include "od.h"
|
||||
#include "shell.h"
|
||||
|
||||
#ifdef MODULE_GNRC_IPV6
|
||||
static ssize_t _send(coap_pkt_t *pkt, size_t len,
|
||||
char *addr_str, const char *port_str)
|
||||
{
|
||||
@ -199,6 +200,7 @@ static int _cmd_client_token(int argc, char **argv){
|
||||
return 0;
|
||||
}
|
||||
SHELL_COMMAND(client_token, "Set Token for CoAP client", _cmd_client_token);
|
||||
#endif
|
||||
|
||||
static int _blockwise_cb(void *arg, size_t offset, uint8_t *buf,
|
||||
size_t len, int more)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user