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

examples/suit_update: make use of nanocoap_resources

This commit is contained in:
Benjamin Valentin 2024-02-12 15:35:49 +01:00
parent 55b6728224
commit 07152de04c
2 changed files with 4 additions and 8 deletions

View File

@ -38,6 +38,7 @@ QUIET ?= 1
#
USEMODULE += suit suit_transport_coap
USEMODULE += nanocoap_resources
# enable VFS transport (only works on boards with external storage)
USEMODULE += suit_transport_vfs

View File

@ -22,13 +22,8 @@ static ssize_t _riot_board_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len,
COAP_FORMAT_TEXT, (uint8_t*)RIOT_BOARD, strlen(RIOT_BOARD));
}
/* must be sorted by path (ASCII order) */
const coap_resource_t coap_resources[] = {
COAP_WELL_KNOWN_CORE_DEFAULT_HANDLER,
{ "/riot/board", COAP_GET, _riot_board_handler, NULL },
/* this line adds the whole "/suit"-subtree */
SUIT_COAP_SUBTREE,
NANOCOAP_RESOURCE(board) {
.path = "/riot/board", .methods = COAP_GET, .handler = _riot_board_handler,
};
const unsigned coap_resources_numof = ARRAY_SIZE(coap_resources);
NANOCOAP_RESOURCE(suit) SUIT_COAP_SUBTREE;