summaryrefslogtreecommitdiff
path: root/shared-bindings/_bleio
AgeCommit message (Collapse)Author
2020-02-20Enable _bleio adapter when _bleio is importedDan Halbert
2020-01-27PacketBuffer.packet_size was returning bool instead of intDan Halbert
2020-01-13merge from adafruit/circuitpythonDan Halbert
2020-01-12fix CCCD bonding store; avoid excessive bonding writesDan Halbert
2020-01-10wip: HID bonding works!Dan Halbert
2020-01-09wip; redid flash writing to be compatible with SDDan Halbert
2020-01-03Add PacketBuffer and MTU negotiation support.Scott Shawcroft
PacketBuffer facilitates packet oriented BLE protocols such as BLE MIDI and the Apple Media Service. This also adds PHY, MTU and connection event extension negotiation to speed up data transfer when possible.
2019-12-12Add extended, connectable and scannable error.Scott Shawcroft
Related to https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/44
2019-12-09Merge pull request #2353 from jepler/audiosample-protocolScott Shawcroft
Convert audiosamples to use micropython "protocols" (safely)
2019-12-06Merge pull request #2301 from tannewt/support_extended_advertisingDan Halbert
Add support for extended (>31 byte) BLE advertisements.
2019-12-06Check connection validity after service discovery.Scott Shawcroft
Fixes #2347
2019-12-06Merge pull request #2356 from tannewt/central_pairingDan Halbert
Add connection interval and debugging
2019-12-05Make _bleio.Connection.disconnect() idempotentDan Halbert
2019-12-04Add connection interval and debuggingScott Shawcroft
This also sets TinyUSB to master and to not include its submodules. It also fixes an old displayio example comment and retries gattc reads.
2019-12-04protocols: Allow them to be (optionally) type-safeJeff Epler
Protocols are nice, but there is no way for C code to verify whether a type's "protocol" structure actually implements some particular protocol. As a result, you can pass an object that implements the "vfs" protocol to one that expects the "stream" protocol, and the opposite of awesomeness ensues. This patch adds an OPTIONAL (but enabled by default) protocol identifier as the first member of any protocol structure. This identifier is simply a unique QSTR chosen by the protocol designer and used by each protocol implementer. When checking for protocol support, instead of just checking whether the object's type has a non-NULL protocol field, use `mp_proto_get` which implements the protocol check when possible. The existing protocols are now named: protocol_framebuf protocol_i2c protocol_pin protocol_stream protocol_spi protocol_vfs (most of these are unused in CP and are just inherited from MP; vfs and stream are definitely used though) I did not find any crashing examples, but here's one to give a flavor of what is improved, using `micropython_coverage`. Before the change, the vfs "ioctl" protocol is invoked, and the result is not intelligible as json (but it could have resulted in a hard fault, potentially): >>> import uos, ujson >>> u = uos.VfsPosix('/tmp') >>> ujson.load(u) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: syntax error in JSON After the change, the vfs object is correctly detected as not supporting the stream protocol: >>> ujson.load(p) Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: stream operation not supported
2019-11-26Merge remote-tracking branch 'adafruit/master' into support_extended_advertisingScott Shawcroft
2019-11-21Clean up debug changesScott Shawcroft
2019-11-21Fix pairing when peripheral. Central untested.Scott Shawcroft
2019-11-21Only add module when printing exception.Scott Shawcroft
2019-11-21Improve printing to include _bleio. prefix for type.Scott Shawcroft
2019-11-20Use BluetoothError in _bleioScott Shawcroft
This better differentiates errors than using OSError everywhere.
2019-11-19Add support for extended (>31 byte) BLE advertisements.Scott Shawcroft
2019-11-13Fix start_scan timeout default valueDan Halbert
2019-11-01Merge remote-tracking branch 'adafruit/master' into bleio_tweaksScott Shawcroft
2019-10-27pixelbuf: correct trivial typosJeff Epler
2019-10-22Refine comments and switch prefix_len to size_tScott Shawcroft
2019-10-21Refine _bleioScott Shawcroft
This PR refines the _bleio API. It was originally motivated by the addition of a new CircuitPython service that enables reading and modifying files on the device. Moving the BLE lifecycle outside of the VM motivated a number of changes to remove heap allocations in some APIs. It also motivated unifying connection initiation to the Adapter class rather than the Central and Peripheral classes which have been removed. Adapter now handles the GAP portion of BLE including advertising, which has moved but is largely unchanged, and scanning, which has been enhanced to return an iterator of filtered results. Once a connection is created (either by us (aka Central) or a remote device (aka Peripheral)) it is represented by a new Connection class. This class knows the current connection state and can discover and instantiate remote Services along with their Characteristics and Descriptors. Relates to #586
2019-08-29rename bleio module to _bleioDan Halbert