circuitpython/extmod/nimble
Jim Mussared 341158c251 extmod/nimble: Add "memory stalling" mechanism for l2cap_send.
When l2cap_send detects that the sys mempool is running low (used to store
the outgoing HCI payloads), it will report stalled back to the application,
and then only unstall once these HCI payloads have been sent.

This prevents a situation where a remote receiver with very large MTU can
cause NimBLE to queue up more than MYNEWT_VAL_MSYS_1_BLOCK_COUNT (i.e. 12)
payloads, causing further attempts to send to fail with ENOMEM (even though
the channel is not stalled and we have room in the channel mbufs). The
regular credit/stall flow control is not effective here because the
receiver's MTU is large enough that it will not activate (i.e. there are
lots of credits available).

Thresholds of 1/2 (stall) and 1/4 (unstall) chosen to allow headroom for
other payloads (e.g. notifications) and that when a regular stall occurs it
might keep sending (and creating more payloads) in the background.
2021-07-23 21:58:10 +10:00
..
bsp extmod/nimble: Add nimble bindings. 2019-10-01 09:51:02 +10:00
hal extmod/nimble: Allow modbluetooth binding to hook "sent HCI packet". 2021-07-23 21:58:04 +10:00
logcfg extmod/modbluetooth: Refactor stack/hci/driver/port bindings. 2020-09-08 11:41:31 +10:00
nimble extmod/modbluetooth: Add API for L2CAP channels. 2020-11-24 01:07:17 +11:00
syscfg extmod/modbluetooth: Allow configuration of pairing/bonding parameters. 2020-12-02 14:40:49 +11:00
modbluetooth_nimble.c extmod/nimble: Add "memory stalling" mechanism for l2cap_send. 2021-07-23 21:58:10 +10:00
modbluetooth_nimble.h extmod/nimble: Allow modbluetooth binding to hook "sent HCI packet". 2021-07-23 21:58:04 +10:00
nimble.mk extmod/modbluetooth: Add support for bonding (key persistence). 2020-12-02 14:41:41 +11:00