Skip to content

Commit 9247646

Browse files
author
Tero Heinonen
committed
Merge pull request #19 from ARMmbed/timeout_define
Defines for default timeout values
2 parents edb443a + cacfb34 commit 9247646

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

source/coap_security_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ int coap_security_handler_connect_non_blocking(coap_security_t *sec, bool is_ser
382382
}
383383

384384
if(!timeout_max && !timeout_min){
385-
mbedtls_ssl_conf_handshake_timeout( &sec->_conf, 10000, 29000 );
385+
mbedtls_ssl_conf_handshake_timeout( &sec->_conf, DTLS_HANDSHAKE_TIMEOUT_MIN, DTLS_HANDSHAKE_TIMEOUT_MAX );
386386
}
387387
else{
388388
mbedtls_ssl_conf_handshake_timeout( &sec->_conf, timeout_min, timeout_max );

source/include/coap_security_handler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ typedef int receive_cb(int8_t socket_id, unsigned char *, size_t);
4242
typedef void start_timer_cb(int8_t timer_id, uint32_t min, uint32_t fin);
4343
typedef int timer_status_cb(int8_t timer_id);
4444

45+
#define DTLS_HANDSHAKE_TIMEOUT_MIN 25000
46+
#define DTLS_HANDSHAKE_TIMEOUT_MAX 125000
47+
4548
typedef enum {
4649
DTLS = 0,
4750
TLS = 1

0 commit comments

Comments
 (0)