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:
parent
55b6728224
commit
07152de04c
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user