circuitpython/extmod/btstack
Jim Mussared e152d0c197 extmod/btstack: Schedule notify/indicate/write ops for bg completion.
The goal of this commit is to allow using ble.gatts_notify() at any time,
even if the stack is not ready to send the notification right now.  It also
addresses the same issue for ble.gatts_indicate() and ble.gattc_write()
(without response).  In addition this commit fixes the case where the
buffer passed to write-with-response wasn't copied, meaning it could be
modified by the caller, affecting the in-progress write.

The changes are:

- gatts_notify/indicate will now run in the background if the ACL buffer is
  currently full, meaning that notify/indicate can be called at any time.

- gattc_write(mode=0) (no response) will now allow for one outstanding
  write.

- gattc_write(mode=1) (with response) will now copy the buffer so that it
  can't be modified by the caller while the write is in progress.

All four paths also now track the buffer while the operation is in
progress, which prevents the GC free'ing the buffer while it's still
needed.
2020-07-18 14:23:47 +10:00
..
btstack.mk unix: Add btstack to the unix submodules list. 2020-04-29 16:54:12 +10:00
btstack_config.h unix: Add support for modbluetooth and BLE using btstack. 2020-04-29 16:45:46 +10:00
modbluetooth_btstack.c extmod/btstack: Schedule notify/indicate/write ops for bg completion. 2020-07-18 14:23:47 +10:00
modbluetooth_btstack.h extmod/btstack: Schedule notify/indicate/write ops for bg completion. 2020-07-18 14:23:47 +10:00