aboutsummaryrefslogtreecommitdiff
path: root/tests/multi_bluetooth/ble_characteristic.py
AgeCommit message (Collapse)Author
2020-11-16tests/multi_bluetooth: Change dict index-and-del to pop, to clear event.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13tests/multi_bluetooth: Improve reliability of event waiting.Jim Mussared
Use the same `wait_for_event` in all tests that doesn't hold a reference to the event data tuple and handles repeat events. Also fix a few misc reliability issues around timeouts and sequencing. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-09-25extmod/modbluetooth: Change module-owned bytes objects to memoryview.Damien George
A read-only memoryview object is a better representation of the data, which is owned by the ubluetooth module and may change between calls to the user's irq callback function. Signed-off-by: Damien George <damien@micropython.org>
2020-09-08tests/multi_bluetooth: Update to new config('mac') behaviour.Jim Mussared
2020-07-20extmod/modbluetooth: Add event for "indicate acknowledgement".Jim Mussared
This commit adds the IRQ_GATTS_INDICATE_DONE BLE event which will be raised with the status of gatts_indicate (unlike notify, indications require acknowledgement). An example of its use is added to ble_temperature.py, and to the multitests in ble_characteristic.py. Implemented for btstack and nimble bindings, tested in both directions between unix/btstack and pybd/nimble.
2020-07-18extmod/btstack: Schedule notify/indicate/write ops for bg completion.Jim Mussared
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-06-05tests/multi_bluetooth: Update to work with new BLE events.Jim Mussared
Updates the tests to use non-bitmask events, event renames, as well as some of the new completion events to improve reliability of the tests.
2020-05-08tests/multi_bluetooth: Fix typo printing wrong IRQ type.Damien George
2020-03-10tests/multi_bluetooth: Add initial tests for bluetooth BLE.Damien George