mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2026-01-01 01:41:18 +01:00
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.
This commit is contained in:
parent
b7885428ce
commit
88459f5a92
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user