diff --git a/sys/include/net/nanocoap.h b/sys/include/net/nanocoap.h index fcdbf47def..1fc958c366 100644 --- a/sys/include/net/nanocoap.h +++ b/sys/include/net/nanocoap.h @@ -2071,7 +2071,7 @@ extern ssize_t coap_well_known_core_default_handler(coap_pkt_t *pkt, \ * @brief Respond to `/.well-known/core` to list all resources on the server */ #ifndef CONFIG_NANOCOAP_SERVER_WELL_KNOWN_CORE -#define CONFIG_NANOCOAP_SERVER_WELL_KNOWN_CORE (1) +#define CONFIG_NANOCOAP_SERVER_WELL_KNOWN_CORE !IS_USED(MODULE_GCOAP) #endif /** diff --git a/sys/net/application_layer/gcoap/gcoap.c b/sys/net/application_layer/gcoap/gcoap.c index f42c2b411f..af113d61f4 100644 --- a/sys/net/application_layer/gcoap/gcoap.c +++ b/sys/net/application_layer/gcoap/gcoap.c @@ -1409,6 +1409,17 @@ kernel_pid_t gcoap_init(void) gcoap_forward_proxy_init(); } +#ifdef MODULE_NANOCOAP_RESOURCES + /* add CoAP resources from XFA */ + XFA_USE_CONST(coap_resource_t, coap_resources_xfa); + static gcoap_listener_t _xfa_listener = { + .resources = coap_resources_xfa, + }; + _xfa_listener.resources_len = XFA_LEN(coap_resource_t, coap_resources_xfa), + + gcoap_register_listener(&_xfa_listener); +#endif + return _pid; }