Skip to content

Commit b4dc325

Browse files
authored
Merge pull request #5688 from artokin/mesh-fix-for-mbed-os-5.7-oob
Mesh fix for mbed os 5.7 oob
2 parents 98a1aec + e78db9e commit b4dc325

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

features/nanostack/FEATURE_NANOSTACK/coap-service/source/coap_message_handler.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ uint16_t coap_message_handler_request_send(coap_msg_handler_t *handle, int8_t se
337337
transaction_ptr->options = options;
338338
memcpy(transaction_ptr->remote_address, destination_addr, 16);
339339
transaction_ptr->remote_port = destination_port;
340+
transaction_ptr->req_msg_type = msg_type;
340341
memset(&request, 0, sizeof(request));
341342
dst_addr.addr_ptr = (uint8_t *) destination_addr; // Cast away const and trust that nsdl doesn't modify...
342343
dst_addr.addr_len = 16;

features/nanostack/FEATURE_NANOSTACK/coap-service/source/coap_service_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static uint8_t coap_tx_function(uint8_t *data_ptr, uint16_t data_len, sn_nsdl_ad
188188
memcpy(transaction_ptr->data_ptr, data_ptr, data_len);
189189
transaction_ptr->data_len = data_len;
190190
}
191-
} else if ((ret_val == -1) || (transaction_ptr->resp_cb == NULL)) {
191+
} else if ((ret_val == -1) || (!transaction_ptr->resp_cb && transaction_ptr->req_msg_type == COAP_MSG_TYPE_NON_CONFIRMABLE)) {
192192
transaction_delete(transaction_ptr);
193193
}
194194

@@ -300,7 +300,7 @@ static void sec_done_cb(int8_t socket_id, uint8_t address[static 16], uint16_t p
300300
ns_dyn_mem_free(transaction_ptr->data_ptr);
301301
transaction_ptr->data_ptr = NULL;
302302
transaction_ptr->data_len = 0;
303-
if (transaction_ptr->resp_cb == NULL) {
303+
if (!transaction_ptr->resp_cb && transaction_ptr->req_msg_type == COAP_MSG_TYPE_NON_CONFIRMABLE) {
304304
transaction_delete(transaction_ptr);
305305
}
306306
}

features/nanostack/FEATURE_NANOSTACK/coap-service/source/include/coap_security_handler.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,18 @@
2020
#include "ns_types.h"
2121

2222
#ifdef NS_USE_EXTERNAL_MBED_TLS
23+
#if !defined(MBEDTLS_CONFIG_FILE)
24+
#include "mbedtls/config.h"
25+
#else
26+
#include MBEDTLS_CONFIG_FILE
27+
#endif
28+
29+
#if defined(MBEDTLS_SSL_TLS_C)
2330
#include "mbedtls/ssl.h"
24-
#ifdef MBEDTLS_SSL_TLS_C
2531
#define COAP_SECURITY_AVAILABLE
2632
#endif
27-
#endif
33+
34+
#endif /* NS_USE_EXTERNAL_MBED_TLS */
2835

2936
#define COOKIE_SIMPLE_LEN 8
3037
typedef struct simple_cookie {

features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/mbed_lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"6lowpan-nd-psk-key": "{0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf}",
1313
"6lowpan-nd-sec-level": 5,
1414
"6lowpan-nd-device-type": "NET_6LOWPAN_ROUTER",
15-
"thread-pskd": "\"abcdefghijklmno\"",
15+
"thread-pskd": "\"ABCDEFGH\"",
1616
"thread-use-static-link-config": true,
1717
"thread-config-channel-mask": "0x7fff800",
1818
"thread-config-channel-page": 0,

0 commit comments

Comments
 (0)