Loading...
Searching...
No Matches
coap.h
1/*
2 * Copyright (C) 2019 Kaspar Schleiser <kaspar@schleiser.de>
3 * 2019 Inria
4 * 2019 Freie Universität Berlin
5 *
6 * This file is subject to the terms and conditions of the GNU Lesser
7 * General Public License v2.1. See the file LICENSE in the top level
8 * directory for more details.
9 */
10
25#ifndef SUIT_TRANSPORT_COAP_H
26#define SUIT_TRANSPORT_COAP_H
27
28#include "net/nanocoap.h"
29#include "suit/transport/worker.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
43#define SUIT_COAP_SUBTREE \
44 { \
45 .path="/suit/", \
46 .methods=COAP_MATCH_SUBTREE | COAP_METHOD_GET | COAP_METHOD_POST | COAP_METHOD_PUT, \
47 .handler=coap_subtree_handler, \
48 .context=(void*)&coap_resource_subtree_suit \
49 }
50
51/*
52 * Dear Reviewer,
53 *
54 * At the time of PR'ing this code, there was a pile of CoAP PR's waiting for
55 * reviews. Some of that functionality is needed in one way or another for
56 * SUIT. In order to not block software updates with CoAP refactoring, some of
57 * the work-in-progress code has been copied here. We expect this to be
58 * removed as soon as CoAP in master provides similar functionality.
59 *
60 * As this is internal code that will go soon, I exclude this from Doxygen.
61 *
62 * Kaspar (July 2019)
63 */
64#ifndef DOXYGEN
65
69extern const coap_resource_subtree_t coap_resource_subtree_suit;
70
74#ifndef CONFIG_SUIT_COAP_BLOCKSIZE
75#define CONFIG_SUIT_COAP_BLOCKSIZE CONFIG_NANOCOAP_BLOCKSIZE_DEFAULT
76#endif
77
87static inline void suit_coap_trigger(const uint8_t *url, size_t len)
88{
89 suit_worker_trigger((const char *)url, len);
90}
91
92#endif /* DOXYGEN */
93
94#ifdef __cplusplus
95}
96#endif
97
98#endif /* SUIT_TRANSPORT_COAP_H */
void suit_worker_trigger(const char *url, size_t len)
Trigger a SUIT update via a worker thread.
nanocoap API
Type for CoAP resource subtrees.
Definition nanocoap.h:321