Skip to content

Commit 42c1169

Browse files
author
Arto Kinnunen
authored
Fix redefinition of mbed TLS error codes (ARMmbed#76)
-Use guards around MBEDTLS macros.
1 parent ba7a7c4 commit 42c1169

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

source/include/coap_security_handler.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,21 @@ const void *coap_security_handler_keyblock(const coap_security_t *sec);
101101
NS_DUMMY_DEFINITIONS_OK
102102

103103
/* Dummy definitions, including needed error codes */
104+
#ifndef MBEDTLS_ERR_SSL_TIMEOUT
104105
#define MBEDTLS_ERR_SSL_TIMEOUT (-1)
106+
#endif
107+
108+
#ifndef MBEDTLS_ERR_SSL_WANT_READ
105109
#define MBEDTLS_ERR_SSL_WANT_READ (-2)
110+
#endif
111+
112+
#ifndef MBEDTLS_ERR_SSL_WANT_WRITE
106113
#define MBEDTLS_ERR_SSL_WANT_WRITE (-3)
114+
#endif
115+
116+
#ifndef MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE
107117
#define MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE (-4)
118+
#endif
108119

109120
#define coap_security_create(socket_id, timer_id, handle, \
110121
mode, send_cb, receive_cb, start_timer_cb, timer_status_cb) ((coap_security_t *) 0)

0 commit comments

Comments
 (0)