2019-07-05 11:59:06 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "net/nanocoap.h"
|
2020-02-26 14:52:39 +01:00
|
|
|
#include "suit/transport/coap.h"
|
2022-01-26 17:02:46 +01:00
|
|
|
#include "kernel_defines.h"
|
2019-07-05 11:59:06 +02:00
|
|
|
|
2022-04-15 21:17:24 +02:00
|
|
|
static ssize_t _riot_board_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len,
|
|
|
|
coap_request_ctx_t *context)
|
2019-07-05 11:59:06 +02:00
|
|
|
{
|
|
|
|
(void)context;
|
|
|
|
return coap_reply_simple(pkt, COAP_CODE_205, buf, len,
|
|
|
|
COAP_FORMAT_TEXT, (uint8_t*)RIOT_BOARD, strlen(RIOT_BOARD));
|
|
|
|
}
|
|
|
|
|
2024-02-12 15:35:49 +01:00
|
|
|
NANOCOAP_RESOURCE(board) {
|
|
|
|
.path = "/riot/board", .methods = COAP_GET, .handler = _riot_board_handler,
|
2019-07-05 11:59:06 +02:00
|
|
|
};
|
|
|
|
|
2024-02-12 15:35:49 +01:00
|
|
|
NANOCOAP_RESOURCE(suit) SUIT_COAP_SUBTREE;
|