2016-10-19 20:58:35 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 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 <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "nanocoap.h"
|
|
|
|
|
|
|
|
static ssize_t _riot_board_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len)
|
|
|
|
{
|
|
|
|
return coap_reply_simple(pkt, buf, len,
|
|
|
|
COAP_FORMAT_TEXT, (uint8_t*)RIOT_BOARD, strlen(RIOT_BOARD));
|
|
|
|
}
|
|
|
|
|
2016-11-16 14:52:54 +01:00
|
|
|
/* must be sorted by path (alphabetically) */
|
2016-10-19 20:58:35 +02:00
|
|
|
const coap_resource_t coap_resources[] = {
|
|
|
|
COAP_WELL_KNOWN_CORE_DEFAULT_HANDLER,
|
|
|
|
{ "/riot/board", COAP_GET, _riot_board_handler },
|
|
|
|
};
|
|
|
|
|
|
|
|
const unsigned coap_resources_numof = sizeof(coap_resources) / sizeof(coap_resources[0]);
|