Skip to content

Commit

Permalink
Release 0.0.8 (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
ukBaz authored Feb 9, 2019
1 parent ff53810 commit 9dda2f3
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 26 deletions.
16 changes: 14 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ The aim of this library is to provide an API to access to *Bluez* with *zero* bo
Goal
====
To provide a simplified API to people that want to use Bluetooth functionality in their code.
The library will use calls to the Bluez D-Bus API and use 'sensible' defaults to help with that simplification.
The library will use calls to the BlueZ D-Bus API and use 'sensible' defaults to help with that simplification.
It aims to support the ability to create interesting STEM activities without needing to
explain the Bluez API or write an event loop.
explain the BlueZ API or write an event loop.

In addition to the API it will contain examples of how to connect to common Bluetooth Smart (BLE) objects
around them (or at least easily accessible to them).
Expand Down Expand Up @@ -108,3 +108,15 @@ This example transmits the temperature of the CPU over the single characteristic
If your hardware does not support the `vcgencmd` then change the `get_cpu_temperature()`
function to use the randomly generated temperature.
Values are only updated when notification are switched on.

ble_uart.py
-----------

This example simulates a basic UART connection over two lines, TXD and RXD.

It is based on a proprietary UART service specification by Nordic Semiconductors.
Data sent to and from this service can be viewed using the nRF UART apps from Nordic
Semiconductors for Android and iOS.

It uses the Bluezero peripheral file (level 10) so should be easier than the previous CPU
Temperature example that was a level 100.
10 changes: 6 additions & 4 deletions bluezero/peripheral.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,15 @@ def start(self):

# Setup the advertising manager
print('setup ad_manager')
self.ad_manager = dbus_tools.get_dbus_iface(constants.LE_ADVERTISING_MANAGER_IFACE,
dbus_tools.get_dbus_obj(self.dongle.path))
self.ad_manager = dbus_tools.get_dbus_iface(
constants.LE_ADVERTISING_MANAGER_IFACE,
dbus_tools.get_dbus_obj(self.dongle.path))

# Setup the service manager
print('setup service_manager')
self.service_manager = dbus_tools.get_dbus_iface(constants.GATT_MANAGER_IFACE,
dbus_tools.get_dbus_obj(self.dongle.path))
self.service_manager = dbus_tools.get_dbus_iface(
constants.GATT_MANAGER_IFACE,
dbus_tools.get_dbus_obj(self.dongle.path))

# Setup the advertisement
self.service_ad = Advertisement(self, 'peripheral')
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ def __getattr__(cls, name):

# General information about the project.
project = u'python-bluezero'
copyright = u'2018, Barry Byford, Mark Roberts'
copyright = u'2019, Barry Byford, Mark Roberts'
author = u'Barry Byford, Mark Roberts'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'0.0.7'
version = u'0.0.8'
# The full version, including alpha/beta/rc tags.
release = u'0.0.7'
release = u'0.0.8'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
8 changes: 4 additions & 4 deletions docs/developer_docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ Release Checklist

* Check Travis-tests are passing
* Update version info in setup.py
* Build and publish pypi package (see below)
* Check pypi page for obvious errors
* Build and publish PyPI package (see below)
* Check PyPI page for obvious errors
* Update version in docs/conf.py (see below)
* ``git tag`` with version number
* Check read the docs page

Build pypi package
Build PyPI package
------------------

Update version information in setup.py.

To upload to pypi:
To upload to PyPI:

.. code-block:: none
Expand Down
13 changes: 13 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,16 @@ file to open the permissions for 'ukBaz.bluezero'
.. literalinclude:: ../examples/cpu_temperature.py


Peripheral - Nordic UART Service
--------------------------------

This service simulates a basic UART connection over two lines, TXD and RXD.

It is based on a proprietary UART service specification by Nordic Semiconductors.
Data sent to and from this service can be viewed using the nRF UART apps from Nordic
Semiconductors for Android and iOS.

It uses the Bluezero peripheral file (level 10) so should be easier than the previous CPU
Temperature example that was a level 100.

.. literalinclude:: ../examples/ble_uart.py
20 changes: 10 additions & 10 deletions docs/install_bluez.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ 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.
Bluezero relies on the dbus interface of BlueZ. This library requires the
features provided by BlueZ version **5.43** and later.
If the Linux OS you have installed does not have the correct version then
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
----------------------------
Required Packages
-----------------

The following packages are a super set of what is required. For some systems
these may already be install or not required::
Expand All @@ -24,7 +24,7 @@ these may already be install or not required::
# 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``)::
To compile a new version of BlueZ (requires ``deb-src`` entries in ``/etc/apt/sources.list``)::

sudo apt-get build-dep bluez

Expand All @@ -46,7 +46,7 @@ There are also some pip installs required for development::
# To check code against PEP 8 style conventions
sudo pip3 install pycodestyle

Getting newer versions of Bluez source
Getting newer versions of BlueZ source
--------------------------------------

Download the User Space BlueZ Package from http://www.bluez.org/download/ ::
Expand All @@ -55,7 +55,7 @@ Download the User Space BlueZ Package from http://www.bluez.org/download/ ::
tar xf bluez-5.43.tar.xz
cd bluez-5.43

How to config and compile Bluez 5.43 and later
How to config and compile BlueZ 5.43 and later
----------------------------------------------
To configure run::

Expand Down
4 changes: 2 additions & 2 deletions docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ 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.
- DBus function names are not Pythonic and may 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.
BlueZ Daemon running.
- The previous more abstracted API levels should be easier to port to any
hardware.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.0.7',
version='0.0.8',

description='Python library for Bluetooth Low Energy (BLE) on Linux',
long_description=long_description,
Expand Down

0 comments on commit 9dda2f3

Please sign in to comment.