
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
BTZen is a library to asynchronously access Bluetooth devices using Python language. It provides simple API over complex D-Bus Bluez interface.
The main features of BTZen are
The library can be used with any Bluetooth Smart device. It was tested with
The library is tested with default asyncio
event loop and its drop-in
replacement uvloop <https://github.com/MagicStack/uvloop>
_. Use of
uvloop
increases performance of the library.
The scripts in scripts
directory demonstrate reading data from various
devices.
NOTE: The first version of SensorTag (CC2541DK) is not supported at the
moment. If you still own the device and would like it to be supported,
please raise an issue <https://github.com/wrobell/btzen/issues>
_.
Please note that since version 0.6.0 the API changed. The benefits are
If pre-0.6.0 version of BTZen is required, then use appropriate versioning in installation requirements of your project.
This project's documentation is lacking at the moment. Some useful tips might be found in this README file and files at
https://github.com/wrobell/btzen/tree/master/doc
Use pip
to install BTZen library (Cython needs to be installed first),
for example::
pip install --user cython
pip install --user btzen
BTZen uses experimental API of Bluez adapter interface to connect to
Bluetooth devices. The bluetoothd
daemon has to be started with
experimental option on. This can be permanently achieved by setting
Experimental
to true
in /etc/bluez/main.conf
file.
Change AutoEnable
option to true in /etc/bluetooth/main.conf
to
automate powering up of Bluetooth controllers. Otherwise a controller might
need to be switched on manually with bluetoothctl
tool. BTZen library
does not perform this operation.
BTZen uses ConnectDevice
method of Bluez adapter interface to discover
and connect to Bluetooth devices. MAC address of a device needs to be known
in order to connect.
BTZen connection manager allows to connect and disconnect Bluetooth devices without restarting of an application. If an application is reading data from multiple Bluetooth devices, the application can continue working if, for example, a sensor requires battery change.
Please note
bluetoothctl
If Bluetooth device MAC address is not known
bluetoothctl
.remove
command of bluetoothctl
utility.The library enables programmers to communicate with mutliple devices in
parallel without using threads. This avoids context switching of threads
and minimizes memory requirements, which makes BTZen more efficient than
other, similar libraries. To keep the library as fast as possible, Cython
is used to access Bluez D-Bus API. BTZen can be used with uvloop
for even
more increased performance of an application.
Support for GATT notification interface allows efficient use of Bluetooth devices. For example, data from sensors like accelerometers can be read only when sensor wakes up and transmits data after sensor has been moved. This limits amount of transferred data and avoids draining battery of the sensor, which will happen if data is polled at regular, short intervals.
BTZen library requires the following software components
sd-bus
(kart of systemd
)BTZen library is licensed under terms of GPL license, version 3, see
COPYING <https://www.gnu.org/licenses/gpl-3.0.en.html>
_ file for details.
FAQs
BTZen - library to asynchronously access Bluetooth devices
We found that btzen demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.