1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

suit: rename worker thread functions (they are not CoAP only)

This commit is contained in:
Benjamin Valentin 2022-09-03 23:20:34 +02:00
parent 44440caf68
commit 0b6e344d4f
3 changed files with 69 additions and 4 deletions

View File

@ -26,6 +26,7 @@
#define SUIT_TRANSPORT_COAP_H
#include "net/nanocoap.h"
#include "suit/transport/worker.h"
#ifdef __cplusplus
extern "C" {
@ -33,8 +34,14 @@ extern "C" {
/**
* @brief Start SUIT CoAP thread
*
* @deprecated This is an alias for @ref suit_worker_run and will be removed
* after after the 2023.01 release.
*/
void suit_coap_run(void);
static inline void suit_coap_run(void)
{
suit_worker_run();
}
/**
* @brief SUIT CoAP endpoint entry.
@ -82,10 +89,16 @@ extern const coap_resource_subtree_t coap_resource_subtree_suit;
/**
* @brief Trigger a SUIT udate
*
* @deprecated This is an alias for @ref suit_worker_trigger and will be removed
* after after the 2023.01 release.
*
* @param[in] url url pointer containing the full coap url to the manifest
* @param[in] len length of the url
*/
void suit_coap_trigger(const uint8_t *url, size_t len);
static inline void suit_coap_trigger(const uint8_t *url, size_t len)
{
suit_worker_trigger((const char *)url, len);
}
#endif /* DOXYGEN */

View File

@ -0,0 +1,52 @@
/*
* Copyright (C) 2019 Kaspar Schleiser <kaspar@schleiser.de>
* 2019 Inria
* 2019 Freie Universität Berlin
*
* 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.
*/
/**
* @ingroup sys_suit
* @defgroup sys_suit_transport_worker SUIT firmware worker thread
* @brief SUIT secure firmware updates worker thread
*
* @{
*
* @brief SUIT CoAP helper API
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @author Francisco Molina <francois-xavier.molina@inria.fr>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*
*/
#ifndef SUIT_TRANSPORT_WORKER_H
#define SUIT_TRANSPORT_WORKER_H
#include "net/nanocoap.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Start SUIT worker thread
*/
void suit_worker_run(void);
/**
* @brief Trigger a SUIT udate
*
* @param[in] url url pointer containing the full coap url to the manifest
* @param[in] len length of the url
*/
void suit_worker_trigger(const char *url, size_t len);
#ifdef __cplusplus
}
#endif
#endif /* SUIT_TRANSPORT_WORKER_H */
/** @} */

View File

@ -170,14 +170,14 @@ static void *_suit_worker_thread(void *arg)
return NULL;
}
void suit_coap_run(void)
void suit_worker_run(void)
{
thread_create(_stack, SUIT_WORKER_STACKSIZE, SUIT_COAP_WORKER_PRIO,
THREAD_CREATE_STACKTEST,
_suit_worker_thread, NULL, "suit worker");
}
void suit_coap_trigger(const uint8_t *url, size_t len)
void suit_worker_trigger(const char *url, size_t len)
{
memcpy(_url, url, len);
_url[len] = '\0';