A simple Python API for Bluetooth D-Bus calls. Allows easy pairing, connecting and scanning.
python-dbus
The package was tested with Python 3.7
sudo make install
-
Bluetooth:
list:
[{"name": Name, "mac_address": MAC-address}, ... ]
Methods of class Bluetooth:
start_scanning(timeout)
:scan
in backgroundscan(timeout)
get_devices_to_pair()
, returns listget_available_devices()
, returns listget_paired_devices()
, returns listget_connected_devices()
, returns listmake_discoverable()
, returns boolstart_pairing(address)
:pair
in backgroundpair(address)
, returns boolconnect(address)
, returns booldisconnect(address)
, returns booltrust(address)
, returns boolremove(address)
, returns boolset_adapter_property(prop, value)
, returns boolget_adapter_property(prop)
set_device_property(address, prop, value)
, returns boolget_device_property(address, prop)
This package was written by Aleksandr Aleksandrov working at Emlid.
The bluetool was originally written for the Emlid Reach RTK receiver, but we decided to open source it, as there is no easy Python API for BT pairing/connecting. Feel free to add issues and submit pull requests.
This project was modified by rTomas for RGB-Pi use in Raspberry Pi removing all the unnecessary server and agent parts