Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys/net/coap: cast in non-config define #20497

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sys/include/net/coap.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
* Used in a CoAP request to signal that the request payload conveys both an
* EDHOC message_3 and OSCORE protected data, combined together.
*
* @see [draft-ietf-core-oscore-edhoc-02](https://datatracker.ietf.org/doc/draft-ietf-core-oscore-edhoc/02/)

Check warning on line 88 in sys/include/net/coap.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*/
#define COAP_OPT_EDHOC (21)
#define COAP_OPT_BLOCK2 (23)
Expand Down Expand Up @@ -354,7 +354,7 @@
#define COAP_FORMAT_SWID_CBOR (258)
/**
* @brief Content-Type `application/pkixcmp`
* @see [draft-ietf-ace-cmpv2-coap-transport](https://datatracker.ietf.org/doc/draft-ietf-ace-cmpv2-coap-transport/)

Check warning on line 357 in sys/include/net/coap.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
* @see [RFC 4210](https://datatracker.ietf.org/doc/html/rfc4210)
*/
#define COAP_FORMAT_PKIXCMP (259)
Expand Down Expand Up @@ -441,22 +441,22 @@
#define COAP_FORMAT_YAML_DATA_CBOR_ID_NAME (341)
/**
* @brief Content-Type `application/td+json`
* @see [Web of Things (WoT) Thing Description 1.1](https://www.w3.org/TR/wot-thing-description11/)

Check warning on line 444 in sys/include/net/coap.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*/
#define COAP_FORMAT_TD_JSON (432)
/**
* @brief Content-Type `application/tm+json`
* @see [Web of Things (WoT) Thing Description 1.1](https://www.w3.org/TR/wot-thing-description11/)

Check warning on line 449 in sys/include/net/coap.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*/
#define COAP_FORMAT_TM_JSON (433)
/**
* @brief Content-Type `application/dns-message`
* @see [draft-ietf-core-dns-over-coap](https://datatracker.ietf.org/doc/draft-ietf-core-dns-over-coap/)

Check warning on line 454 in sys/include/net/coap.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*/
#define COAP_FORMAT_DNS_MESSAGE (553)
/**
* @brief Content-Type `application/voucher-cose+cbor`
* @see [draft-ietf-anima-constrained-voucher](https://datatracker.ietf.org/doc/draft-ietf-anima-constrained-voucher/)

Check warning on line 459 in sys/include/net/coap.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
* @note Temporary registration until April 12, 2024.
*/
#define COAP_FORMAT_VOUCER_COSE_CBOR (836)
Expand Down Expand Up @@ -488,17 +488,17 @@
#define COAP_FORMAT_CBOR_DEFLATE (11060)
/**
* @brief Content-Type `application/vnd.oma.lwm2m+tlv`
* @see [OMA-TS-LightweightM2M-V1_0](https://www.openmobilealliance.org/release/LightweightM2M/V1_0-20170208-A/OMA-TS-LightweightM2M-V1_0-20170208-A.pdf)

Check warning on line 491 in sys/include/net/coap.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*/
#define COAP_FORMAT_VND_OMA_LWM2M_TLV (11542)
/**
* @brief Content-Type `application/vnd.oma.lwm2m+json`
* @see [OMA-TS-LightweightM2M-V1_0](https://www.openmobilealliance.org/release/LightweightM2M/V1_0-20170208-A/OMA-TS-LightweightM2M-V1_0-20170208-A.pdf)

Check warning on line 496 in sys/include/net/coap.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*/
#define COAP_FORMAT_VND_OMA_LWM2M_JSON (11543)
/**
* @brief Content-Type `application/vnd.oma.lwm2m+cbor`
* @see [OMA-TS-LightweightM2M-V1_2](https://www.openmobilealliance.org/release/LightweightM2M/V1_2-20201110-A/HTML-Version/OMA-TS-LightweightM2M_Core-V1_2-20201110-A.html)

Check warning on line 501 in sys/include/net/coap.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*/
#define COAP_FORMAT_VND_OMA_LWM2M_CBOR (11544)
/**
Expand Down Expand Up @@ -563,7 +563,7 @@
* (@ref CONFIG_COAP_ACK_TIMEOUT_MS * @ref CONFIG_COAP_RANDOM_FACTOR_1000 / 1000).
*/
#ifndef CONFIG_COAP_ACK_TIMEOUT_MS
#define CONFIG_COAP_ACK_TIMEOUT_MS (2000UL)
#define CONFIG_COAP_ACK_TIMEOUT_MS (2000)
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion sys/net/application_layer/gcoap/gcoap.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#define NO_IMMEDIATE_REPLY (-1)

/* End of the range to pick a random timeout */
#define TIMEOUT_RANGE_END (CONFIG_COAP_ACK_TIMEOUT_MS * CONFIG_COAP_RANDOM_FACTOR_1000 / 1000)
#define TIMEOUT_RANGE_END ((uint32_t)CONFIG_COAP_ACK_TIMEOUT_MS * CONFIG_COAP_RANDOM_FACTOR_1000 / 1000)

Check warning on line 53 in sys/net/application_layer/gcoap/gcoap.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters

/* Internal functions */
static void *_event_loop(void *arg);
Expand Down
4 changes: 2 additions & 2 deletions sys/net/application_layer/nanocoap/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ ssize_t nanocoap_sock_request_cb(nanocoap_sock_t *sock, coap_pkt_t *pkt,
uint8_t state = STATE_REQUEST_SEND;

/* random timeout, deadline for receive retries */
uint32_t timeout = random_uint32_range(CONFIG_COAP_ACK_TIMEOUT_MS * US_PER_MS,
CONFIG_COAP_ACK_TIMEOUT_MS * CONFIG_COAP_RANDOM_FACTOR_1000);
uint32_t timeout = random_uint32_range((uint32_t)CONFIG_COAP_ACK_TIMEOUT_MS * US_PER_MS,
(uint32_t)CONFIG_COAP_ACK_TIMEOUT_MS * CONFIG_COAP_RANDOM_FACTOR_1000);
uint32_t deadline = _deadline_from_interval(timeout);

/* check if we expect a reply */
Expand Down
2 changes: 1 addition & 1 deletion tests/net/gcoap_fileserver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEST_ON_CI_BLACKLIST += all

# use small blocksize for test to increase chance for errors
CFLAGS += -DCONFIG_NANOCOAP_BLOCKSIZE_DEFAULT=COAP_BLOCKSIZE_16
CFLAGS += -DCONFIG_COAP_ACK_TIMEOUT_MS=100UL
CFLAGS += -DCONFIG_COAP_ACK_TIMEOUT_MS=100
CFLAGS += -DCONFIG_COAP_MAX_RETRANSMIT=10

ifneq (,$(filter native native64,$(BOARD)))
Expand Down
Loading