Merge pull request #5688 from artokin/mesh-fix-for-mbed-os-5.7-oob

Mesh fix for mbed os 5.7 oob
pull/5624/merge
Martin Kojtal 2017-12-13 09:20:47 +00:00 committed by GitHub
commit b4dc32521a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View File

@ -337,6 +337,7 @@ uint16_t coap_message_handler_request_send(coap_msg_handler_t *handle, int8_t se
transaction_ptr->options = options; transaction_ptr->options = options;
memcpy(transaction_ptr->remote_address, destination_addr, 16); memcpy(transaction_ptr->remote_address, destination_addr, 16);
transaction_ptr->remote_port = destination_port; transaction_ptr->remote_port = destination_port;
transaction_ptr->req_msg_type = msg_type;
memset(&request, 0, sizeof(request)); memset(&request, 0, sizeof(request));
dst_addr.addr_ptr = (uint8_t *) destination_addr; // Cast away const and trust that nsdl doesn't modify... dst_addr.addr_ptr = (uint8_t *) destination_addr; // Cast away const and trust that nsdl doesn't modify...
dst_addr.addr_len = 16; dst_addr.addr_len = 16;

View File

@ -188,7 +188,7 @@ static uint8_t coap_tx_function(uint8_t *data_ptr, uint16_t data_len, sn_nsdl_ad
memcpy(transaction_ptr->data_ptr, data_ptr, data_len); memcpy(transaction_ptr->data_ptr, data_ptr, data_len);
transaction_ptr->data_len = data_len; transaction_ptr->data_len = data_len;
} }
} else if ((ret_val == -1) || (transaction_ptr->resp_cb == NULL)) { } else if ((ret_val == -1) || (!transaction_ptr->resp_cb && transaction_ptr->req_msg_type == COAP_MSG_TYPE_NON_CONFIRMABLE)) {
transaction_delete(transaction_ptr); transaction_delete(transaction_ptr);
} }
@ -300,7 +300,7 @@ static void sec_done_cb(int8_t socket_id, uint8_t address[static 16], uint16_t p
ns_dyn_mem_free(transaction_ptr->data_ptr); ns_dyn_mem_free(transaction_ptr->data_ptr);
transaction_ptr->data_ptr = NULL; transaction_ptr->data_ptr = NULL;
transaction_ptr->data_len = 0; transaction_ptr->data_len = 0;
if (transaction_ptr->resp_cb == NULL) { if (!transaction_ptr->resp_cb && transaction_ptr->req_msg_type == COAP_MSG_TYPE_NON_CONFIRMABLE) {
transaction_delete(transaction_ptr); transaction_delete(transaction_ptr);
} }
} }

View File

@ -20,11 +20,18 @@
#include "ns_types.h" #include "ns_types.h"
#ifdef NS_USE_EXTERNAL_MBED_TLS #ifdef NS_USE_EXTERNAL_MBED_TLS
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#if defined(MBEDTLS_SSL_TLS_C)
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#ifdef MBEDTLS_SSL_TLS_C
#define COAP_SECURITY_AVAILABLE #define COAP_SECURITY_AVAILABLE
#endif #endif
#endif
#endif /* NS_USE_EXTERNAL_MBED_TLS */
#define COOKIE_SIMPLE_LEN 8 #define COOKIE_SIMPLE_LEN 8
typedef struct simple_cookie { typedef struct simple_cookie {

View File

@ -12,7 +12,7 @@
"6lowpan-nd-psk-key": "{0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf}", "6lowpan-nd-psk-key": "{0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf}",
"6lowpan-nd-sec-level": 5, "6lowpan-nd-sec-level": 5,
"6lowpan-nd-device-type": "NET_6LOWPAN_ROUTER", "6lowpan-nd-device-type": "NET_6LOWPAN_ROUTER",
"thread-pskd": "\"abcdefghijklmno\"", "thread-pskd": "\"ABCDEFGH\"",
"thread-use-static-link-config": true, "thread-use-static-link-config": true,
"thread-config-channel-mask": "0x7fff800", "thread-config-channel-mask": "0x7fff800",
"thread-config-channel-page": 0, "thread-config-channel-page": 0,