1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/riotboot_flashwrite: make use of nanocoap_resources

This commit is contained in:
Benjamin Valentin 2024-02-12 15:43:23 +01:00
parent 67411db26f
commit 2dd6a65ea9
2 changed files with 6 additions and 6 deletions

View File

@ -13,6 +13,7 @@ USEMODULE += gnrc_icmpv6_echo
# Required for nanocoap server # Required for nanocoap server
USEMODULE += nanocoap_sock USEMODULE += nanocoap_sock
USEMODULE += nanocoap_resources
# include this for printing IP addresses # include this for printing IP addresses
USEMODULE += shell_cmds_default USEMODULE += shell_cmds_default

View File

@ -78,10 +78,9 @@ ssize_t _flashwrite_handler(coap_pkt_t* pkt, uint8_t *buf, size_t len, coap_requ
return pkt_pos - (uint8_t*)pkt->hdr; return pkt_pos - (uint8_t*)pkt->hdr;
} }
/* must be sorted by path (ASCII order) */ NANOCOAP_RESOURCE(flashwrite) {
const coap_resource_t coap_resources[] = { .path = "/flashwrite",
COAP_WELL_KNOWN_CORE_DEFAULT_HANDLER, .methods = COAP_POST,
{ "/flashwrite", COAP_POST, _flashwrite_handler, &_writer }, .handler = _flashwrite_handler,
.context = &_writer
}; };
const unsigned coap_resources_numof = ARRAY_SIZE(coap_resources);