diff --git a/examples/suit_update/Makefile b/examples/suit_update/Makefile index 8d61ced457..b00db43999 100644 --- a/examples/suit_update/Makefile +++ b/examples/suit_update/Makefile @@ -26,6 +26,7 @@ USEMODULE += gnrc_icmpv6_echo # include this for printing IP addresses USEMODULE += shell USEMODULE += shell_cmds_default +USEMODULE += shell_cmd_suit # Set this to 1 to enable code in RIOT that does safety checking # which is not needed in a production environment but helps in the diff --git a/sys/include/net/gcoap.h b/sys/include/net/gcoap.h index b9d4794d1b..8fd9ad356b 100644 --- a/sys/include/net/gcoap.h +++ b/sys/include/net/gcoap.h @@ -1087,9 +1087,6 @@ uint8_t gcoap_op_state(void); * @brief Get the resource list, currently only `CoRE Link Format` * (COAP_FORMAT_LINK) supported * - * @deprecated Will be an alias for @ref gcoap_get_resource_list after the - * 2022.01 release. Will be removed after the 2022.04 release. - * * If @p buf := NULL, nothing will be written but the size of the resulting * resource list is computed and returned. * @@ -1103,38 +1100,14 @@ uint8_t gcoap_op_state(void); * (i.e. usage of modules no `gcoap_dtls`, ...) this will * be ignored and @ref GCOAP_SOCKET_TYPE_UDP assumed. * - * @todo add support for `JSON CoRE Link Format` - * @todo add support for 'CBOR CoRE Link Format` + * @todo add support for CoRAL once it is done * * @return the number of bytes written to @p buf * @return -1 on error */ -int gcoap_get_resource_list_tl(void *buf, size_t maxlen, uint8_t cf, +int gcoap_get_resource_list(void *buf, size_t maxlen, uint8_t cf, gcoap_socket_type_t tl_type); -/** - * @brief Get the resource list for all transports, - * currently only `CoRE Link Format` (COAP_FORMAT_LINK) supported - * - * If @p buf := NULL, nothing will be written but the size of the resulting - * resource list is computed and returned. - * - * @param[out] buf output buffer to write resource list into, my be NULL - * @param[in] maxlen length of @p buf, ignored if @p buf is NULL - * @param[in] cf content format to use for the resource list, currently - * only COAP_FORMAT_LINK supported - * - * @todo add support for `JSON CoRE Link Format` - * @todo add support for 'CBOR CoRE Link Format` - * - * @return the number of bytes written to @p buf - * @return -1 on error - */ -static inline int gcoap_get_resource_list(void *buf, size_t maxlen, uint8_t cf) -{ - return gcoap_get_resource_list_tl(buf, maxlen, cf, GCOAP_SOCKET_TYPE_UNDEF); -} - /** * @brief Writes a resource in CoRE Link Format to a provided buffer. * diff --git a/sys/net/application_layer/cord/ep/cord_ep.c b/sys/net/application_layer/cord/ep/cord_ep.c index 943938bf67..36b618c714 100644 --- a/sys/net/application_layer/cord/ep/cord_ep.c +++ b/sys/net/application_layer/cord/ep/cord_ep.c @@ -286,7 +286,7 @@ int cord_ep_register(const sock_udp_ep_t *remote, const char *regif) /* add the resource description as payload */ res = gcoap_get_resource_list(pkt.payload, pkt.payload_len, - COAP_FORMAT_LINK); + COAP_FORMAT_LINK, GCOAP_SOCKET_TYPE_UNDEF); if (res < 0) { retval = CORD_EP_ERR; goto end; diff --git a/sys/net/application_layer/gcoap/gcoap.c b/sys/net/application_layer/gcoap/gcoap.c index f42c2b411f..39d965734c 100644 --- a/sys/net/application_layer/gcoap/gcoap.c +++ b/sys/net/application_layer/gcoap/gcoap.c @@ -946,7 +946,7 @@ static ssize_t _well_known_core_handler(coap_pkt_t* pdu, uint8_t *buf, size_t le coap_opt_add_format(pdu, COAP_FORMAT_LINK); ssize_t plen = coap_opt_finish(pdu, COAP_OPT_FINISH_PAYLOAD); - plen += gcoap_get_resource_list_tl(pdu->payload, (size_t)pdu->payload_len, + plen += gcoap_get_resource_list(pdu->payload, (size_t)pdu->payload_len, COAP_FORMAT_LINK, (gcoap_socket_type_t)coap_request_ctx_get_tl_type(ctx)); return plen; @@ -1706,7 +1706,7 @@ uint8_t gcoap_op_state(void) return count; } -int gcoap_get_resource_list_tl(void *buf, size_t maxlen, uint8_t cf, +int gcoap_get_resource_list(void *buf, size_t maxlen, uint8_t cf, gcoap_socket_type_t tl_type) { assert(cf == COAP_FORMAT_LINK); diff --git a/sys/shell/Makefile.dep b/sys/shell/Makefile.dep index 6cc8eaaff9..eb2360479c 100644 --- a/sys/shell/Makefile.dep +++ b/sys/shell/Makefile.dep @@ -129,9 +129,6 @@ ifneq (,$(filter shell_cmds_default,$(USEMODULE))) ifneq (,$(filter sht1x,$(USEMODULE))) USEMODULE += shell_cmd_sht1x endif - ifneq (,$(filter suit_transport_worker,$(USEMODULE))) - USEMODULE += shell_cmd_suit - endif ifneq (,$(filter vfs,$(USEMODULE))) USEMODULE += shell_cmd_vfs endif diff --git a/tests/unittests/tests-gcoap/tests-gcoap.c b/tests/unittests/tests-gcoap/tests-gcoap.c index d42b8e5824..4bb42affbd 100644 --- a/tests/unittests/tests-gcoap/tests-gcoap.c +++ b/tests/unittests/tests-gcoap/tests-gcoap.c @@ -378,15 +378,15 @@ static void test_gcoap__server_get_resource_list(void) gcoap_register_listener(&listener); gcoap_register_listener(&listener_second); - size = gcoap_get_resource_list(NULL, 0, COAP_FORMAT_LINK); + size = gcoap_get_resource_list(NULL, 0, COAP_FORMAT_LINK, GCOAP_SOCKET_TYPE_UNDEF); TEST_ASSERT_EQUAL_INT(strlen(resource_list_str), size); res[0] = 'A'; - size = gcoap_get_resource_list(res, 0, COAP_FORMAT_LINK); + size = gcoap_get_resource_list(res, 0, COAP_FORMAT_LINK, GCOAP_SOCKET_TYPE_UNDEF); TEST_ASSERT_EQUAL_INT(0, size); TEST_ASSERT_EQUAL_INT((int)'A', (int)res[0]); - size = gcoap_get_resource_list(res, 127, COAP_FORMAT_LINK); + size = gcoap_get_resource_list(res, 127, COAP_FORMAT_LINK, GCOAP_SOCKET_TYPE_UNDEF); res[size] = '\0'; TEST_ASSERT_EQUAL_INT(strlen(resource_list_str), size); TEST_ASSERT_EQUAL_STRING(resource_list_str, (char *)res);