From b7885428ce5fc5a2a9fc5bd8edabd75bf4723cb3 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Mon, 30 Sep 2019 20:54:03 +0200 Subject: [PATCH 1/2] pkg/nimble: bump NimBLE version --- pkg/nimble/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/nimble/Makefile b/pkg/nimble/Makefile index 2a7706dd45..5edcb69c67 100644 --- a/pkg/nimble/Makefile +++ b/pkg/nimble/Makefile @@ -1,6 +1,6 @@ PKG_NAME = nimble PKG_URL = https://github.com/apache/mynewt-nimble.git -PKG_VERSION = 997dad8c9fc549e64b6c54eafcec109d92789418 +PKG_VERSION = fb7651b773734a075c47ff10210b92e6d55ef55b PKG_LICENSE = Apache-2.0 TDIR = $(RIOTPKG)/$(PKG_NAME) From 88459f5a923595fb2ab4bee66005f4285012278f Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Mon, 7 Oct 2019 17:52:11 +0200 Subject: [PATCH 2/2] tests/nimble_l2cap_server: change order in _on_data Printing the 'Received ...' string takes a short while and it is possible that data is received while the string is printed. It seems however that NimBLE does not like to be without a mbuf ready for taking data while receiving something, as this seems to lead to a memory leak somehow. Now changing the order of actions inside the _on_data() function fixes this. --- tests/nimble_l2cap_server/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/nimble_l2cap_server/main.c b/tests/nimble_l2cap_server/main.c index 3903c6407c..ee671b21c2 100644 --- a/tests/nimble_l2cap_server/main.c +++ b/tests/nimble_l2cap_server/main.c @@ -60,7 +60,6 @@ static void _on_data(struct ble_l2cap_event *event) res = os_mbuf_copydata(rxd, 0, rx_len, _rxbuf); assert(res == 0); - printf("# Received: len %5i, seq %5u\n", rx_len, (unsigned)_rxbuf[POS_SEQ]); res = ble_l2cap_send(_coc, rxd); assert((res == 0) || (res == BLE_HS_ESTALLED)); @@ -70,6 +69,8 @@ static void _on_data(struct ble_l2cap_event *event) assert(rxd != NULL); res = ble_l2cap_recv_ready(_coc, rxd); assert(res == 0); + + printf("# Received: len %5i, seq %5u\n", rx_len, (unsigned)_rxbuf[POS_SEQ]); } static int _on_gap_evt(struct ble_gap_event *event, void *arg)