Skip to content

Commit

Permalink
Merge pull request #20497 from MrKevinWeiss/pr/fix/gcoapsize
Browse files Browse the repository at this point in the history
sys/net/coap: cast in non-config define
  • Loading branch information
benpicco authored Mar 22, 2024
2 parents 9f51dae + 575ab68 commit e2a2c42
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sys/include/net/coap.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ typedef enum {
* (@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

0 comments on commit e2a2c42

Please sign in to comment.