1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 10:12:45 +01:00

examples/nanocoap_server: use nanocoap_fileserver

This commit is contained in:
Benjamin Valentin 2023-10-30 15:23:21 +01:00
parent be399d59d0
commit e1f64ffc62
2 changed files with 6 additions and 10 deletions

View File

@ -47,13 +47,9 @@ endif
HIGH_MEMORY_BOARDS := native same54-xpro mcb2388
ifneq (,$(filter $(BOARD),$(HIGH_MEMORY_BOARDS)))
USEMODULE += gcoap_fileserver
USEMODULE += nanocoap_fileserver
USEMODULE += vfs_default
# we don't want to run GCoAP
CFLAGS += -DCONFIG_GCOAP_NO_AUTO_INIT=1
CFLAGS += -DCONFIG_NANOCOAP_SERVER_WELL_KNOWN_CORE=1
# always enable auto-format for native
ifeq ($(BOARD),native)
USEMODULE += vfs_auto_format

View File

@ -183,21 +183,21 @@ NANOCOAP_RESOURCE(sha256) {
};
/* we can also include the fileserver module */
#ifdef MODULE_GCOAP_FILESERVER
#include "net/gcoap/fileserver.h"
#ifdef MODULE_NANOCOAP_FILESERVER
#include "net/nanocoap/fileserver.h"
#include "vfs_default.h"
NANOCOAP_RESOURCE(fileserver) {
.path = "/vfs",
.methods = COAP_GET
#if IS_USED(MODULE_GCOAP_FILESERVER_PUT)
#if IS_USED(MODULE_NANOCOAP_FILESERVER_PUT)
| COAP_PUT
#endif
#if IS_USED(MODULE_GCOAP_FILESERVER_DELETE)
#if IS_USED(MODULE_NANOCOAP_FILESERVER_DELETE)
| COAP_DELETE
#endif
| COAP_MATCH_SUBTREE,
.handler = gcoap_fileserver_handler,
.handler = nanocoap_fileserver_handler,
.context = VFS_DEFAULT_DATA
};
#endif