From 677871d7176a17004a37bd2bb3f734c4eb6461b8 Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Tue, 24 Mar 2020 15:07:09 +0100 Subject: [PATCH] suit/transport/coap: Use generic subtree handler The SUIT CoAP code can make use of the generic subtree handler. This commit removes the obsolete code to make use of the more generic nanocoap subtree handlers. --- sys/include/suit/transport/coap.h | 23 ----------------------- sys/suit/transport/coap.c | 8 -------- 2 files changed, 31 deletions(-) diff --git a/sys/include/suit/transport/coap.h b/sys/include/suit/transport/coap.h index b3c437205c..c13d30a8bb 100644 --- a/sys/include/suit/transport/coap.h +++ b/sys/include/suit/transport/coap.h @@ -67,29 +67,6 @@ void suit_coap_run(void); */ #ifndef DOXYGEN -/** - * @brief Coap subtree handler - * - * @param[in,out] pkt Packet struct containing the request. Is reused for - * the response - * @param[in] buf Buffer to write reply to - * @param[in] len Total length of the buffer associated with the - * request - * @param[in] buf Buffer to write reply to - * - * @returns ssize_t Size of the reply - */ -ssize_t coap_subtree_handler(coap_pkt_t *pkt, uint8_t *buf, - size_t len, void *context); - -/** - * @brief Type for CoAP resource subtrees - */ -typedef const struct { - const coap_resource_t *resources; /**< ptr to resource array */ - const size_t resources_numof; /**< nr of entries in array */ -} coap_resource_subtree_t; - /** * @brief Reference to the coap resource subtree */ diff --git a/sys/suit/transport/coap.c b/sys/suit/transport/coap.c index 44f24367f7..bef335f6fc 100644 --- a/sys/suit/transport/coap.c +++ b/sys/suit/transport/coap.c @@ -104,14 +104,6 @@ static inline void _print_download_progress(suit_manifest_t *manifest, static kernel_pid_t _suit_coap_pid; -ssize_t coap_subtree_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, - void *context) -{ - coap_resource_subtree_t *subtree = context; - return coap_tree_handler(pkt, buf, len, subtree->resources, - subtree->resources_numof); -} - static void _suit_handle_url(const char *url, coap_blksize_t blksize) { LOG_INFO("suit_coap: downloading \"%s\"\n", url);