[riot-notifications] [RIOT-OS/RIOT] examples: add TCP echo server & client from documentation (#16739)

Leandro Lanzieri notifications at github.com
Thu Sep 23 20:34:20 CEST 2021


@leandrolanzieri commented on this pull request.



> +USEMODULE += netdev_default
+
+USEMODULE += shell
+USEMODULE += shell_commands
+USEMODULE += ps
+USEMODULE += netutils
+
+ifeq (1, $(LWIP))
+  USEMODULE += ipv6_addr
+  USEMODULE += lwip_ipv6_autoconfig
+  USEMODULE += lwip_netdev
+else
+  USEMODULE += auto_init_gnrc_netif
+  USEMODULE += gnrc_ipv6_default
+  # we want to be able to open two sockets
+  CFLAGS += -DCONFIG_GNRC_TCP_RCV_BUFFERS=2

> > I think you also need to activate the module config `CONFIG_KCONFIG_USEMODULE_GNRC_TCP=y`, but Kconfig will complain if something goes wrong (that's the advantage of Kconfig instead of just using CFLAGS ;-))
> 
> I mean to actually make the build system use the app.config file. It just being present doesn't make the build system pick it up.

My configuration file:
```makefile
CONFIG_KCONFIG_USEMODULE_GNRC_TCP=y
CONFIG_GNRC_TCP_RCV_BUFFERS=2
```
When placed as `app.config` it was applied to the end-configuration in `autoconf.h` (maybe try cleaning first).

The better option would be in the Makefile:
```makefile
ifeq (1, $(LWIP))
  USEMODULE += ipv6_addr
  USEMODULE += lwip_ipv6_autoconfig
  USEMODULE += lwip_netdev
else
  USEMODULE += auto_init_gnrc_netif
  USEMODULE += gnrc_ipv6_default
  KCONFIG_ADD_CONFIG += app.gnrc.config
endif
```

This alone would always run Kconfig, as there is an `.config` file in the app directory. To avoid this, add the following to the Makefile:
```makefile
# As there is a .config we want to explicitly disable Kconfig by setting
# the variable to empty
SHOULD_RUN_KCONFIG ?=
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16739#discussion_r715054642
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210923/6e6d7607/attachment-0001.htm>


More information about the notifications mailing list