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:
parent
67411db26f
commit
2dd6a65ea9
@ -13,6 +13,7 @@ USEMODULE += gnrc_icmpv6_echo
|
||||
|
||||
# Required for nanocoap server
|
||||
USEMODULE += nanocoap_sock
|
||||
USEMODULE += nanocoap_resources
|
||||
|
||||
# include this for printing IP addresses
|
||||
USEMODULE += shell_cmds_default
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/* must be sorted by path (ASCII order) */
|
||||
const coap_resource_t coap_resources[] = {
|
||||
COAP_WELL_KNOWN_CORE_DEFAULT_HANDLER,
|
||||
{ "/flashwrite", COAP_POST, _flashwrite_handler, &_writer },
|
||||
NANOCOAP_RESOURCE(flashwrite) {
|
||||
.path = "/flashwrite",
|
||||
.methods = COAP_POST,
|
||||
.handler = _flashwrite_handler,
|
||||
.context = &_writer
|
||||
};
|
||||
|
||||
const unsigned coap_resources_numof = ARRAY_SIZE(coap_resources);
|
||||
|
Loading…
Reference in New Issue
Block a user