This is a project to provide an API to allow access to Bluetooth Low Energy devices
from Python. At present it runs on Linux only; I've mostly developed it using a
Raspberry Pi, but it will also run on x86 Debian Linux.
The code is tested on Python 2.7 and 3.4; it should also work on 3.3.
There is also code which uses this to talk to a TI SensorTag (www.ti.com/sensortag).
The code needs an executable bluepy-helper to be compiled from C source. This is done
automatically if you use the recommended pip installation method (see below). Otherwise,
you can rebuild it using the Makefile in the bluepy directory.
To install the current released version, on most Debian-based systems:
I would recommend having command-line tools from BlueZ available for debugging. There
are instructions for building BlueZ on the Raspberry Pi at http://www.elinux.org/RPi_Bluetooth_LE.
Documentation
Documentation can be built from the sources in the docs/ directory using Sphinx.
This project uses code from the bluez project, which is available under the Version 2
of the GNU Public License.
The Python files are released into the public domain by their author, Ian Harvey.
Release Notes
Release 1.3.0
New getState() method for Peripheral class
New exception structure / error reporting (#311, #317, #326)
BTLEException now has subclasses BLTEDisconnectError, BTLEManagementError, etc.
which report an error code and error message passed up from the lower layers, where
appropriate.
Partial merge #311: aids to debugging; bluepy-helper reports version; fix crash
Partial merge #311 and #302: pair() and unpair() now supported
Fix #169: 0-byte characteristic writes are now supported
Merge #302: OOB data now supported
Merge #312: better comments on sample code in docs, better scanner example
Fix #292: Unicode string decoding errors in scan data
Merge #308: don't ignore sensitivity option during discovery
Merge #301: fix Peripheral documentation
Fix #286: return list of services from Scan entry
Release 1.2.0
Merge #245: Update underlying Bluez version to 5.47
Merge #284: Readme updated with Fedora install instructions
请发表评论