From 30ea9d38f6666674aa280f4e3efc789a9a65e1b9 Mon Sep 17 00:00:00 2001 From: Julien Vermillard Date: Mon, 2 Jan 2017 14:00:22 +0100 Subject: [PATCH] Fix COAP_MAX_TRANSMIT_WAIT value - issue #220 --- core/er-coap-13/er-coap-13.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/er-coap-13/er-coap-13.h b/core/er-coap-13/er-coap-13.h index 3fbe540a8..beca54432 100644 --- a/core/er-coap-13/er-coap-13.h +++ b/core/er-coap-13/er-coap-13.h @@ -58,7 +58,7 @@ #define COAP_MAX_RETRANSMIT 4 #define COAP_ACK_RANDOM_FACTOR 1.5 -#define COAP_MAX_TRANSMIT_WAIT ((COAP_RESPONSE_TIMEOUT * ((2 ^ (COAP_MAX_RETRANSMIT + 1)) - 1) * COAP_ACK_RANDOM_FACTOR)) +#define COAP_MAX_TRANSMIT_WAIT ((COAP_RESPONSE_TIMEOUT * ( (1 << (COAP_MAX_RETRANSMIT + 1) ) - 1) * COAP_ACK_RANDOM_FACTOR)) #define COAP_HEADER_LEN 4 /* | version:0x03 type:0x0C tkl:0xF0 | code | mid:0x00FF | mid:0xFF00 | */ #define COAP_ETAG_LEN 8 /* The maximum number of bytes for the ETag */