API for controlling nRF52 connectivity devices through pc-ble-driver-py
Project description
Blatann
blåtann: Norwegian word for "blue tooth"
The goal of this library is to provide a high-level, object-oriented interface
for performing bluetooth operations using the Nordic nRF52 through Nordic's pc-ble-driver-py
library
and the associated Connectivity firmware.
Install
pip install blatann
Supported Devices/Software
This library has been tested using both the nRF52 Dev Kits, the nRF52840 USB Dongle and the ABSniffer 528 flashed with Connectivity Firmware
Supported Versions:
Blatann Version | Python Version | SoftDevice Version | pc-ble-driver-py Version | Supported Devices |
---|---|---|---|---|
v0.2.x | 2.7 Only | v3 | <=0.11.4 | nRF52832 Dev Kit ABSniffer BLE Dongle nRF52840 Dev Kit/Dongle (using S132 connectivity image)* |
v0.3+ | 3.7+ | v5 | >=0.12.0 | Same as above |
* I have not personally tested the nRF52840 compatibility for v0.2.x, only heard second-hand accounts of it working. v0.3+ has been tested with the nRF52840 USB Dongle
When using the nRF52840, it should be flashed using the S132/SoftDevice v5 connectivity images. Both hex files and DFU packages are distributed by default
with v4.1.1 of pc-ble-driver and is also bundled with pc-ble-driver-py
install, allowing the Dev Kit and USB Dongle to be flashed. The devices can be updated using nRF Connect Desktop App
Roadmap
- Documentation
- ReadTheDocs integration (started, needs refinement)
- Better type hinting
- GAP
- BLE Enable parameters
- BLE Connection parameters (functional, needs some work)
- Advertising
- Data Length Extensions
- Scanning (functional, needs some refactoring)
- Documentation
- SMP
- Encryption/Authentication process
- MITM/Passcode pairing support
- Store bonding info
- Currently uses pickle which is not secure
- Identity resolve
- Bonding as Peripheral
- Bonding as Central (implemented, not tested)
- LESC pairing
- Documentation
- GATT
- Configurable MTU
- GATT Server
- Characteristic Reads
- Characteristic Writes
- Notifications/Indications
- Long reads/writes
- Characteristic User Description/Presentation format
- CCCD Caching
- Custom Read/Write authorization (#10)
- Documentation (partial)
- GATT Client
- Database Discovery procedure
- Client reads
- Client writes
- Client long writes
- Notifications/Indications
- CCCD Caching
- Documentation
- Examples
- Advertiser/Broadcaster
- Scanner/Observer
- Central, Procedural
- Central, Event Driven
- Central, Multiple Connections
- Peripheral
- Multi-role
- Passcode Pairing
- LESC Numeric Comparison Pairing (glucose peripheral, no central example)
- Bonding (glucose peripheral, no central example)
- Bluetooth Services
- Device Info Service
- Battery Service
- Current Time Service
- Peripheral
- Central
- Glucose Service
- Peripheral
- Central (Incomplete, untested)
- Nordic UART Service
- More TBD (or on request)
- License
- Unit Tests
- Integration Tests
The library aims to support both event-driven and procedural program styles. It takes similar paradigms from C#/.NET's event function signatures,
where event handlers are passed object sender, EventArgs e
parameters.
Additionally, all asynchronous function calls return a Waitable
object which can be waited on (with timeout)
until the event associated with the function call returns.
NOTE
This library is very much a work in progress. Interfaces, objects, method names will change.
Examples
There are several example scripts which showcase different functionality of the library under blatann/examples
.
Examples can be run using python -m blatann.examples [example_filename] [device_comport]
.
Example usage: python -m blatann.examples scanner COM3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for blatann-0.3.0rc2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bba92e9e94e15af1ca5f2ac4dd945c1421eea2c8bccada3309cc56588e9a1a08 |
|
MD5 | 3256ced89353bb1aa74d34436dde5529 |
|
BLAKE2b-256 | 08b058d786b5fbecca709d82ae52162af700216fbecff943083f59597c707444 |