0% found this document useful (0 votes)
247 views27 pages

Python-Bluezero Documentation: Release 0.0.4

This document contains documentation for the python-bluezero library, which provides a Python API for Bluetooth functionality on Linux. It begins with an overview of Bluetooth and the BlueZ Bluetooth stack for Linux. It then provides examples of using the python-bluezero library at different levels of complexity, from basic tasks like scanning for devices to reading data from Bluetooth Low Energy peripherals. The rest of the document describes installing Bluez and the modules within python-bluezero.

Uploaded by

9Dui W.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
247 views27 pages

Python-Bluezero Documentation: Release 0.0.4

This document contains documentation for the python-bluezero library, which provides a Python API for Bluetooth functionality on Linux. It begins with an overview of Bluetooth and the BlueZ Bluetooth stack for Linux. It then provides examples of using the python-bluezero library at different levels of complexity, from basic tasks like scanning for devices to reading data from Bluetooth Low Energy peripherals. The rest of the document describes installing Bluez and the modules within python-bluezero.

Uploaded by

9Dui W.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

python-bluezero Documentation

Release 0.0.4

Barry Byford, Mark Roberts

Sep 04, 2017


Contents

1 Overview 1
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 Examples 3
2.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 Installing Bluez 13
3.1 Installing Bluez . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4 python-bluezero modules 17
4.1 python-bluezero Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Python Module Index 21

i
ii
CHAPTER 1

Overview

Overview

Bluetooth

Bluetooth is a standard set of binary protocols for short-range wireless communication between devices.
• Bluetooth “Classic” (BR/EDR) supports speeds up to about 24Mbps.
• Bluetooth 4.0 introduces a low energy mode, “Bluetooth Low Energy” (BLE or LE, also known as “Bluetooth
Smart”), that operates at 1Mbps. This mode allows devices to leave their transmitters off most of the time. As
a result it is “Low Energy”.
BLE functionality is dominated by key/value pairs that create a Generic Attribute Profile (GATT).
BLE defines multiple roles that devices can play:
• The Broadcaster (beacon) is a transmitter only application.
• The Observer (scanner) is for receiver only applications.
• Devices acting in the Peripheral role can receive connections.
• Devices acting in the Central role can connect to Peripheral devices.

1
python-bluezero Documentation, Release 0.0.4

BlueZ

BlueZ is a Bluetooth stack for the Linux family of operating systems. Support for BlueZ can be found in many Linux
distributions available.
The highest level of API on BlueZ is the DBus API which can be daunting to users unfamiliar with such APIs.
python-bluezero offers users a more gentle learning curve to using Bluetooth functionality on Linux.

Bluezero API Complexity

This section gives guidelines about the complexity of different python-bluezero APIs. We will use the terms
Level 1, 10 and 100. A new user would start at Level 1 as this should offer the least friction. If at a later stage a greater
level of control is needed then the user can progress on to the other levels. As the user becomes more experienced they
may not need Bluezero and will use BlueZ on its own. The numbers for the API levels represent the steps in code and
knowledge required with each step.

Level 1

• At this level the interface will be pythonic.


• No knowledge of Bluetooth, DBus and event loops will be assumed.
• For something to exist at this level there will need to be a public Bluetooth Profile in existence so that users
don’t need to enter UUIDs etc.
• This might be specific hardware such as the BBC micro:bit or it could be more generalised hardware such as
Heart Rate Monitors.

Level 10

• At this level the interface is still pythonic.


• Some knowledge of Bluetooth such as UUIDs, services and characteristics will be assumed.
• It will not make reference to DBus or event loops.

Level 100

• At this level the interface is expecting the user to know Bluetooth, DBus and event loops.
• DBus function names are not Pythonic but will be exposed at the level.
• This level will be very specific to the Linux kernel and so it will be difficult to port this to other operating
systems that do not have the Bluez Daemon running.
• The previous more abstracted API levels should be easier to port to any hardware.

Summary of Bluezero Files

Level 1 Level 10 Level 100 shared


automation_io.py broadcaster.py adapter.py tools.py
eddystone-URL.py central.py advertise.py constants.py
microbit.py observer.py device.py
peripheral.py GATT.py
scanner.py localGATT.py

2 Chapter 1. Overview
CHAPTER 2

Examples

Examples

Level 1

Adapter

This example prints out the status of the Bluetooth device on your Linux computer. It also checks to see if it is enabled
(powered) before scanning for nearby Bluetooth devices:
from bluezero import adapter

def main():
dongles = adapter.list_adapters()
print('dongles available: ', dongles)
dongle = adapter.Adapter(dongles[0])

print('address: ', dongle.address)


print('name: ', dongle.name)
print('alias: ', dongle.alias)
print('powered: ', dongle.powered)
print('pairable: ', dongle.pairable)
print('pairable timeout: ', dongle.pairabletimeout)
print('discoverable: ', dongle.discoverable)
print('discoverable timeout: ', dongle.discoverabletimeout)
print('discovering: ', dongle.discovering)
print('Powered: ', dongle.powered)
if not dongle.powered:
dongle.powered = True
print('Now powered: ', dongle.powered)
print('Start discovering')
dongle.nearby_discovery()
dongle.powered = False

3
python-bluezero Documentation, Release 0.0.4

if __name__ == '__main__':
main()

Eddystone URL Beacon

This example broadcasts a given URL in a format for the Physical Web:
from bluezero import eddystone

eddystone.EddystoneURL('https://github.com/ukBaz')

Level 10

Micro:bit Buttons

This example reads the status of the buttons on a BBC micro:bit and indicates them on a Ryanteck Traffic Hat. (To
run this replace xx:xx:xx:xx:xx:xx with the address of your micro:bit):
python3 microbit_button.py xx:xx:xx:xx:xx:xx
"""
This is a simple example of how to read data from a micro:bit.

You will need the Bluetooth services of the micro:bit exposed.

This code was developed using the 'Bluetooth Most Services, No Security'
micro:bit hex file from:
http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html

"""
import argparse
import dbus
from time import sleep

from gpiozero import LED


from gpiozero import Buzzer

from bluezero import constants


from bluezero import tools
from bluezero import adapter

# constants
led1 = LED(22)
led2 = LED(23)
led3 = LED(24)
buzz = Buzzer(5)
BEEP_TIME = 0.25

class microbit:
"""
Class to introspect Bluez to find the paths for required UUIDs
"""

4 Chapter 2. Examples
python-bluezero Documentation, Release 0.0.4

def __init__(self, address):


self.bus = dbus.SystemBus()
self.address = address
# Device Information
self.device_path = tools.get_dbus_path(constants.DEVICE_INTERFACE,
'Address',
self.address)[0]
self.remote_device_obj = self.bus.get_object(
constants.BLUEZ_SERVICE_NAME,
self.device_path)
self.remote_device_methods = dbus.Interface(
self.remote_device_obj,
constants.DEVICE_INTERFACE)
self.remote_device_props = dbus.Interface(self.remote_device_obj,
dbus.PROPERTIES_IFACE)
# Button Service
self.btn_srv_uuid = 'E95D9882-251D-470A-A062-FA1922DFA9A8'
self.btn_srv_path = None
# Button A
self.btn_a_chr_uuid = 'E95DDA90-251D-470A-A062-FA1922DFA9A8'
self.btn_a_chr_path = None
# Button B
self.btn_b_chr_uuid = 'E95DDA91-251D-470A-A062-FA1922DFA9A8'
self.btn_b_chr_path = None

def connect(self):
self.remote_device_methods.Connect()
while not self.remote_device_props.Get(
constants.DEVICE_INTERFACE,
'ServicesResolved'):
sleep(0.25)
self._update_dbus_paths()

def _update_dbus_paths(self):
self.btn_srv_path = tools.uuid_dbus_path(constants.GATT_SERVICE_IFACE,
self.btn_srv_uuid)[0]
# Button A
self.btn_a_chr_path = tools.uuid_dbus_path(constants.GATT_CHRC_IFACE,
self.btn_a_chr_uuid)[0]
# Button B
self.btn_b_chr_path = tools.uuid_dbus_path(constants.GATT_CHRC_IFACE,
self.btn_b_chr_uuid)[0]

@property
def connected(self):
"""Indicate whether the remote device is currently connected."""
return self.remote_device_props.Get(
constants.DEVICE_INTERFACE, 'Connected')

def disconnect(self):
self.remote_device_methods.Disconnect()

def read_button_a(self):
"""
Helper function to read the state of button A on a micro:bit
:return: integer representing button value
"""
return self.read_button(self.btn_a_chr_path)

2.1. Examples 5
python-bluezero Documentation, Release 0.0.4

def read_button_b(self):
"""
Helper function to read the state of button B on a micro:bit
:return: integer representing button value
"""
return self.read_button(self.btn_b_chr_path)

def read_button(self, btn_path):


"""
Read the button characteristic on the micro:bit and return value
:param bus_obj: Object of bus connected to (System Bus)
:param bluez_path: The Bluez path to the button characteristic
:return: integer representing button value
"""

# Get characteristic interface for data


btn_obj = self.bus.get_object(constants.BLUEZ_SERVICE_NAME,
btn_path)
btn_iface = dbus.Interface(btn_obj, constants.GATT_CHRC_IFACE)

# Read button value


btn_val = btn_iface.ReadValue(dbus.Array())

answer = int.from_bytes(btn_val, byteorder='little', signed=False)


return answer

def central(address):
dongle = adapter.Adapter(adapter.list_adapters()[0])
if not dongle.powered:
dongle.powered = True
# Find nearby devices
dongle.nearby_discovery()

ubit = microbit(address)
sense_buttons = True

ubit.connect()

led2.on()
buzz.on()
sleep(BEEP_TIME)
buzz.off()

while sense_buttons:
btn_a = ubit.read_button_a()
btn_b = ubit.read_button_b()
# print('Button states: a={} b={}'.format(btn_a, btn_b))
if btn_a > 0 and btn_b < 1:
print('Button A')
led1.on()
led3.off()
elif btn_a < 1 and btn_b > 0:
print('Button B')
led1.off()
led3.on()
elif btn_a > 0 and btn_b > 0:

6 Chapter 2. Examples
python-bluezero Documentation, Release 0.0.4

sense_buttons = False
led1.on()
led3.on()
buzz.on()
sleep(BEEP_TIME)
buzz.off()
print('Bye bye!!!')
elif btn_a < 1 and btn_b < 1:
led1.off()
led3.off()
if not ubit.connected:
sense_buttons = False
led1.on()
led2.on()
led3.on()
buzz.on()
sleep(BEEP_TIME)
buzz.off()

sleep(0.02)

# Disconnect device
ubit.disconnect()

# Read the connected status property


led1.off()
led2.off()
led3.off()
buzz.off()

if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Use micro:bit as remote for Ryanteck TrafficHAT.')
parser.add_argument('address',
help='the address of the micro:bit of interest')

args = parser.parse_args()
central(str(args.address))

TI CC2650

This example reads the sensors or buttons on a TI SensorTag and prints them out to the screen:
"""
This is a simple example of how to read the Ti Sensortag CC2650.

The idea of this file is to show as simplified as possibly


procedure. Hopefully this short file will give clarity and
understanding on how to access the properties and methods
of Bluez D-Bus interface for a Ti Sensortag.

The information for the CC2650 comes from:


http://processors.wiki.ti.com/index.php/CC2650_SensorTag_User%27s_Guide

This program makes some assumptions to keep the complexity down:


1) The adapter is the first one in the list of adapters

2.1. Examples 7
python-bluezero Documentation, Release 0.0.4

(normally there is only one)


2) You are running Bluez 5.42 or higher
"""
from time import sleep

from bluezero import tools


from bluezero import constants
from bluezero import adapter
from bluezero import device
from bluezero.GATT import Characteristic

def val_print(obj_prop, value):


"""
Print out a string and a value
:param obj_prop: Descriptive string
:param value: Value to be printed
"""
print('{0}: {1}'.format(obj_prop, value))

def read_sensor(config_path, data_path):


"""
Read the sensors on the cc2650.
Does this by turning on the sensor, reads and then turns off sensor.
:param config_path: The path to the configuration characteristic
:param data_path: The path to the data characteristic
:return:
"""
# Set configuration value to 1 (enable sensor)
conf_val = config_path.read_raw_value()
val_print('Sensor enabled', conf_val)
config_path.write_value((1).to_bytes(1, byteorder='little'))
conf_val = config_path.read_raw_value()
val_print('Sensor enabled', conf_val)

# Read sensor data


opt_val = data_path.read_raw_value()
val_print('Raw Value', opt_val)

# set configuraton value to 0 (disable sensor)


config_path.read_raw_value()
config_path.write_value((0).to_bytes(1, byteorder='little'))
conf_val = config_path.read_raw_value()
val_print('Sensor enabled', conf_val)

def client():
dongle = adapter.Adapter(adapter.list_adapters()[0])
if not dongle.powered:
dongle.powered = True

dongle.nearby_discovery()
cc2650 = device.Device(tools.device_dbus_path(constants.DEVICE_INTERFACE,
'SensorTag')[0])
# Connect to device
cc2650.connect()

8 Chapter 2. Examples
python-bluezero Documentation, Release 0.0.4

while not cc2650.services_resolved:


sleep(0.5)

# constants
TMP_CONF_PATH = Characteristic(tools.uuid_dbus_path(
constants.GATT_CHRC_IFACE,
'F000AA02-0451-4000-B000-000000000000')[0])
TMP_DATA_PATH = Characteristic(tools.uuid_dbus_path(
constants.GATT_CHRC_IFACE,
'F000AA01-0451-4000-B000-000000000000')[0])
OPT_CONF_PATH = Characteristic(tools.uuid_dbus_path(
constants.GATT_CHRC_IFACE,
'F000AA72-0451-4000-B000-000000000000')[0])
OPT_DATA_PATH = Characteristic(tools.uuid_dbus_path(
constants.GATT_CHRC_IFACE,
'F000AA71-0451-4000-B000-000000000000')[0])
BAR_CONF_PATH = Characteristic(tools.uuid_dbus_path(
constants.GATT_CHRC_IFACE,
'F000AA42-0451-4000-B000-000000000000')[0])
BAR_DATA_PATH = Characteristic(tools.uuid_dbus_path(
constants.GATT_CHRC_IFACE,
'F000AA41-0451-4000-B000-000000000000')[0])
HUM_CONF_PATH = Characteristic(tools.uuid_dbus_path(
constants.GATT_CHRC_IFACE,
'F000AA22-0451-4000-B000-000000000000')[0])
HUM_DATA_PATH = Characteristic(tools.uuid_dbus_path(
constants.GATT_CHRC_IFACE,
'F000AA21-0451-4000-B000-000000000000')[0])

# Read the connected status property


if cc2650.connected:
# IR Temperature Sensor
print('\nIR Temperature Sensor')
read_sensor(TMP_CONF_PATH, TMP_DATA_PATH)
# Optical Sensor
print('\nOptical Sensor')
read_sensor(OPT_CONF_PATH, OPT_DATA_PATH)
# Barometric Pressure Sensor
print('\nBarometric Pressure Sensor')
read_sensor(BAR_CONF_PATH, BAR_DATA_PATH)
# Humidity Sensor
print('\nHumidity Sensor')
read_sensor(HUM_CONF_PATH, HUM_DATA_PATH)

# Disconnect device
cc2650.disconnect()

if __name__ == '__main__':
client()

Level 100

2.1. Examples 9
python-bluezero Documentation, Release 0.0.4

Physical Web FatBeacon

This example advertises a Physical Web Beacon using the Eddystone standard. Currently this can only be connected
to by the Physical Web app because that is the only thing that supports FatBeacons:

from bluezero import tools


from bluezero import constants
from bluezero import adapter
from bluezero import advertisement
from bluezero import localGATT
from bluezero import GATT

FAT_SERVICE = 'AE5946D4-E587-4BA8-B6A5-A97CCA6AFFD3'
HTML_CHRC = 'D1A517F0-2499-46CA-9CCC-809BC1C966FA'

def advertise_beacon():
dongle = adapter.Adapter('/org/bluez/hci0')

advertiser0 = advertisement.Advertisement(0, 'peripheral')

advertiser0.service_UUIDs = ['FEAA']
advertiser0.service_data = {'FEAA': [0x10, 0x08, 0x0E, 70, 97,
116, 79, 110, 101]}

if not dongle.powered:
dongle.powered = True
ad_manager = advertisement.AdvertisingManager(dongle.path)
ad_manager.register_advertisement(advertiser0, {})

return ad_manager, advertiser0

def build_fat_service():
html_string = """<html><head><style>
body { background-color: linen; }
h1 { color: maroon; margin-left: 40px; }
</style><title>FatBeacon Demo</title>
<meta charset='UTF-8'><meta name='description' content='FatBeacon Demo'/>
</head> <body> <h1>Fat Beacon</h1> <p>
A FatBeacon is a beacon that rather than advertising a URL
to load a web page from it actually hosts the web page on the
device and services it up from the BLE characteristic
</p> </body> </html>"""
html_ord = []
for char in html_string:
html_ord.append(ord(char))

app = localGATT.Application()
srv = localGATT.Service(1, FAT_SERVICE, True)
fat_html = localGATT.Characteristic(1,
HTML_CHRC,
srv,
html_ord,
False,
['read'])

10 Chapter 2. Examples
python-bluezero Documentation, Release 0.0.4

fat_html.service = srv.path
app.add_managed_object(srv)
app.add_managed_object(fat_html)
srv_mng = GATT.GattManager('/org/bluez/hci0')
srv_mng.register_application(app, {})

if __name__ == '__main__':

ad_manager, advertiser = advertise_beacon()

build_fat_service()

try:
tools.start_mainloop()
except KeyboardInterrupt:
tools.stop_mainloop()
ad_manager.unregister_advertisement(advertiser)
finally:
pass

2.1. Examples 11
python-bluezero Documentation, Release 0.0.4

12 Chapter 2. Examples
CHAPTER 3

Installing Bluez

Installing Bluez

Overview

Bluezero relies on the dbus interface of Bluez. This library requires the features provided by Bluez version 5.43 and
later. As this is as recent build, it is unlikely that the Linux version you have installed will have the correct version.
These instructions are intended to jump start the switching to a newer version of Bluez which will need to be built
from source.

Packages that need available

The following packages are a super set of what is required. For some systems these may already be install or not
required:

sudo apt-get install bluetooth


sudo apt-get install bluez-tools
# Not required if building from source
# sudo apt-get install bluez-test-scripts
# sudo apt-get install bluez-hcidump
# sudo apt-get install python-bluez

To compile a new version of Bluez (requires deb-src entries in /etc/apt/sources.list):

sudo apt-get build-dep bluez

If you are looking to contribute to the development of Bluezero then you will need:

sudo apt-get install rsync


sudo apt-get install python-dbus
sudo apt-get install python3-dbus
sudo apt-get install python-dbusmock

13
python-bluezero Documentation, Release 0.0.4

# Do I need the following?


sudo apt-get install python3-dbusmock

There are also some pip installs required for development:

# For doing Sphinx documentation


sudo pip3 install Sphinx
sudo pip3 install sphinx_rtd_theme
# To check code against PEP 8 style conventions
sudo pip3 install pycodestyle

Getting newer versions of Bluez source

Download the User Space BlueZ Package from http://www.bluez.org/download/

wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.43.tar.xz
tar xf bluez-5.43.tar.xz
cd bluez-5.43

How to config and compile Bluez 5.43 and later

To configure run:

./configure --prefix=/usr \
--mandir=/usr/share/man \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-experimental \
--enable-maintainer-mode

Note: On the Raspberry Pi 3 installing the latest version of BlueZ breaks the connection to the controller. See
Bluezero GitHub repository issue 30 on how to patch BlueZ to use with a Raspberry Pi 3

To compile and install run:

make -j 4 && sudo make install

Automatically run bluetoothd with experimental mode

Some of the BlueZ DBus API functionality is still behind an experimental flag. This can be switch on by default in
the bluetooth.service file
Edit bluetooth.service file to add –experimental flag e.g:

sudo sed -i '/^ExecStart.*bluetoothd\s*$/ s/$/ --experimental/' /lib/systemd/system/


˓→bluetooth.service

14 Chapter 3. Installing Bluez


python-bluezero Documentation, Release 0.0.4

Restart bluetoothd with new version

You will need to either, reboot or run:


sudo systemctl daemon-reload
sudo service bluetooth restart

The bluetoothd should now be the new version. To check the bluetoothd is running:
service bluetooth status

To check the version use bluetoothctl and type version:


$ bluetoothctl
[bluetooth]# version
Version 5.43

Switch controller to Bluetooth Low Energy only

Much of what Bluezero is doing is using Bluetooth Low Energy. It has been discovered to get reliable connection to
Android phones it is best to put the controller into le only mode. This is done in the /etc/bluetooth/main.
conf file. Ensure that it contains the following:
ControllerMode = le

Creating a Bluezero peripheral

A peripheral application will be registered on the DBus using the bus name of ukBaz.bluezero. An example dbus
configuration file is provided and will need to be copied to the correct location:
sudo cp examples/ukBaz.bluezero.conf /etc/dbus-1/system.d/.

Notes for getting debug information

Monitor the bluetooth hci traffic

Use Bluetooth monitor tool:


sudo btmon -t |& tee ~/btmon.log

Log of the bluetoothd

Stop bluetooth service:


service bluetooth stop

Kill the process (use ‘service bluetooth status’ to get the pid) the launch daemon with debug:
sudo /usr/libexec/bluetooth/bluetoothd -nEd |& tee ~/bluetoothd.log

Manually run bluetoothd with experimental mode with debug:

3.1. Installing Bluez 15


python-bluezero Documentation, Release 0.0.4

/usr/libexec/bluetooth/bluetoothd -nEd

Monitor dbus traffic

debug probe to print message bus messages:

dbus-monitor --system

16 Chapter 3. Installing Bluez


CHAPTER 4

python-bluezero modules

python-bluezero Modules

Level 1

Eddystone

micro:bit

blinkt

Level 10

Broadcaster

Central

Level 100

Adapter

Device

Advertisement

Remote Device GATT

Local Device GATT

Shared

17
python-bluezero Documentation, Release 0.0.4

Tools

Utility functions for python-bluezero.


bluezero.tools.bytes_to_xyz(bytes)
Split 6 byte long in integers representing x, y & z :param bytes: :return:
bluezero.tools.int_to_uint16(value_in)
Convert integer to Unsigned 16 bit little endian integer :param value_in: Integer < 65535 (0xFFFF) :return:
bluezero.tools.int_to_uint32(value_in)
Convert integer to unsigned 32-bit :param value_in: :return:
bluezero.tools.sint16_to_int(bytes)
Convert a signed 16-bit integer to integer :param bytes: :return:
bluezero.tools.url_to_advert(url, frame_type, tx_power)
Encode as specified https://github.com/google/eddystone/blob/master/eddystone-url/README.md :param url:
:return:

Constants

Global constants file for the python-bluezero project.


This file is a single location for the different object paths that are used as constants around the python-bluezero library.
Example

from bluezero import constants


my_function(constants.CONST_1, constants.CONST_2)

bluezero.constants.ADAPTER_INTERFACE = ‘org.bluez.Adapter1’
BlueZ DBus adapter interface
bluezero.constants.BLUEZ_SERVICE_NAME = ‘org.bluez’
BlueZ DBus Service Name
bluezero.constants.DBUS_OM_IFACE = ‘org.freedesktop.DBus.ObjectManager’
The DBus Object Manager interface
bluezero.constants.DBUS_PROP_IFACE = ‘org.freedesktop.DBus.Properties’
DBus Properties interface
bluezero.constants.DEVICE_INTERFACE = ‘org.bluez.Device1’
BlueZ DBus device Interface
bluezero.constants.GATT_CHRC_IFACE = ‘org.bluez.GattCharacteristic1’
BlueZ DBus GATT Characteristic Interface
bluezero.constants.GATT_DESC_IFACE = ‘org.bluez.GattDescriptor1’
BlueZ DBus GATT Descriptor Interface
bluezero.constants.GATT_MANAGER_IFACE = ‘org.bluez.GattManager1’
BlueZ DBus GATT manager Interface
bluezero.constants.GATT_PROFILE_IFACE = ‘org.bluez.GattProfile1’
BlueZ DBus GATT Profile Interface
bluezero.constants.GATT_SERVICE_IFACE = ‘org.bluez.GattService1’
BlueZ DBus GATT Service Interface

18 Chapter 4. python-bluezero modules


python-bluezero Documentation, Release 0.0.4

bluezero.constants.LE_ADVERTISEMENT_IFACE = ‘org.bluez.LEAdvertisement1’
BlueZ DBus Advertisement Interface
bluezero.constants.LE_ADVERTISING_MANAGER_IFACE = ‘org.bluez.LEAdvertisingManager1’
BlueZ DBus Advertising Manager Interface

DBus Tools

4.1. python-bluezero Modules 19


python-bluezero Documentation, Release 0.0.4

20 Chapter 4. python-bluezero modules


Python Module Index

b
bluezero.constants, 18
bluezero.tools, 18

21
python-bluezero Documentation, Release 0.0.4

22 Python Module Index


Index

A U
ADAPTER_INTERFACE (in module url_to_advert() (in module bluezero.tools), 18
bluezero.constants), 18

B
BLUEZ_SERVICE_NAME (in module
bluezero.constants), 18
bluezero.constants (module), 18
bluezero.tools (module), 18
bytes_to_xyz() (in module bluezero.tools), 18

D
DBUS_OM_IFACE (in module bluezero.constants), 18
DBUS_PROP_IFACE (in module bluezero.constants), 18
DEVICE_INTERFACE (in module bluezero.constants),
18

G
GATT_CHRC_IFACE (in module bluezero.constants), 18
GATT_DESC_IFACE (in module bluezero.constants), 18
GATT_MANAGER_IFACE (in module
bluezero.constants), 18
GATT_PROFILE_IFACE (in module
bluezero.constants), 18
GATT_SERVICE_IFACE (in module
bluezero.constants), 18

I
int_to_uint16() (in module bluezero.tools), 18
int_to_uint32() (in module bluezero.tools), 18

L
LE_ADVERTISEMENT_IFACE (in module
bluezero.constants), 18
LE_ADVERTISING_MANAGER_IFACE (in module
bluezero.constants), 19

S
sint16_to_int() (in module bluezero.tools), 18

23

You might also like