Skip to content

Commit

Permalink
Doc effort, some cleanup...
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianTremblay committed Feb 21, 2020
1 parent cb809e9 commit 9b8cc7f
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ python:
- '3.5'
- '3.6'
- '3.7'
- '3.8'

bundler_args: "--retry 3"
install:
Expand All @@ -26,6 +27,6 @@ deploy:
secure: Wgb3PCFut7RCbajytFP4IchYZ1ghA6UH0qjLtBm5qdCYesQKipo3p4Pm5N2IlyOfen1RGd0igaksQqHj19bpwoMXvvR6Rb/Q/eqON+mUWtN1BDPJFh60bWfyJ9c3ZsrCmkVChIQxOPwmyUTX23LV+1Z4nuRdlktdzIDbBZn847BesVylHP9gQ7CKZb3Fxr69ZeOtMbTwAyfK1BbMcFjXMQQGzl4W0R9CuFH7eDa8Ih/fUsvUupDNDKwl6hyKNWwtzDu/DPP0TDBgQexjntIo+MkByatmXyGCoYuHzIrjIMKHCxHGtciCnD6cNGT9meUkwjiCHITfRKCdCAZmwfCeVJuB/AsjgMj4M/dA6kMklqs4A+DEqbw+JiYxMSP1VZL5Sy864Api+7Rhm7tQNNPzjQywSlCjwKexEmSdbKy3M0A7OkORzFFsWDE5WUG1OjR8iJGnhKINmAjfvPhlZCjf/9Dgsd5EA735WiUmhTjj7Vzu3MTtMOzg95UtdDVekqZHf4Yjk6cjhqJQxKM0GZSomAdTZhpYiFFMXgpiup9hUmRujPvGMOci/vydi3rWEe4QARGdDZb/6spydyCy/9sw1O+D93hzLq09fSm3IWN/awdj0dkbhKbHSfH+Gq/436DgRdG/5GlevL3u8b/QARGu2bAXzNJJIuBcGcesTzLch30=
on:
branch: master
python: '3.7'
python: '3.8'
distributions: sdist bdist_wheel
repo: ChristianTremblay/BAC0
2 changes: 1 addition & 1 deletion Jupyter/BAC0.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
3 changes: 1 addition & 2 deletions contributors.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Contributors:

Christian Tremblay christian.tremblay@servisys.com
Ken J. Lockhart klockhart@coppertreeanalytics.com (helped a lot with documentation)

Ken J. LoSee https://github.com/ChristianTremblay/BAC0/graphs/contributors

Thanks !
37 changes: 36 additions & 1 deletion doc/source/connect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ And log to the web server pointing your browser to http://localhost:8111


Use BAC0 on a different subnect (Foreign Device)
*************************************************
***************************************************
In some situations (like using BAC0 with a VPN using TUN) your BAC0 instance
will run on a different subnet than the BACnet/IP network.

Expand Down Expand Up @@ -193,5 +193,40 @@ new points will be available. Old one will not.
..note::
WARNING. When BAC0 disconnects a device, it will try to save the device to SQL.

Read and write (Using the BACnet instance)
*******************************************
BAC0 typically use the concept of controller that we'll see later. But At its core, read and write
operation will be done throught the BACnet instance (`bacnet = BAC0.lite()` for example).

Read property
........................
Once you know the device you need to read from, you can use ::

bacnet.read('address object object_instance property')

Read properties
........................
Read property multiple can also be used ::

bacnet.readMultiple('address object object_instance property_1 property_2') #or
bacnet.readMultiple('address object object_instance all')

Write to property
........................
To write to a single property ::

bacnet.write('address object object_instance property value - priority')

Write to multiple properties
....................................
Write property multiple is also implemented. You will need to build a list for your requets ::

r = ['analogValue 1 presentValue 100','analogValue 2 presentValue 100','analogValue 3 presentValue 100 - 8','@obj_142 1 @prop_1042 True']
bacnet.writeMultiple(addr='2:5',args=r,vendor_id=842)
..note::
WARNING. See the section on Proprietary objects and properties for details about vendor_id and @obj_142.


.. _berryconda : https://github.com/jjhelmus/berryconda
.. _RaspberryPi : http://www.raspberrypi.org
6 changes: 3 additions & 3 deletions doc/source/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ objects with which we can interact. If you want to access native BACnet objects
there are functions you can use.

Read all device properties
===========================
...........................
You can retrieve the list of device properties using::

device.bacnet_properties
Expand All @@ -248,7 +248,7 @@ Often, in this list, you will see proprietary properties added by the manufactur
recognize by their name, an integer.

Read Property
==============
...........................
You can read simple properties using ::
prop = ('device',100,'objectName')
Expand All @@ -259,7 +259,7 @@ You can read simple properties using ::
# this will return the priority array of AI1

Write to property
==================
...........................
You can write to a property using ::

prop = ('analogValue',1,'presentValue')
Expand Down
3 changes: 2 additions & 1 deletion doc/source/getstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Some examples of complete distributions are Anaconda_ or `Enthought Canopy <http
As I use Anaconda_, I'll focus on this one but you're free to choose the one
you prefer.

If you are using a RaspberryPi, have a look to miniconda_ or berryconda_. Both can allow a complete installation of modules like bokeh_ and Flask_
If you are using a RaspberryPi, have a look to miniconda_ or berryconda_. Both can allow a complete installation of modules like bokeh_ and Flask_.
For berryconda, once it's done, run `conda install pandas`. This will install pandas on your RaspberryPi without the need to compile it.

.. _installing-a-complete-distribution:

Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Welcome to BACØ - BACnet Test Tool
Table of contents
==================
.. toctree::
:maxdepth: 2
:maxdepth: 4

getstarted
connect
Expand Down
8 changes: 4 additions & 4 deletions doc/source/proprietary_objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ This will allow us to interact with them after registration ::
proprietary objects to them so tec['SupOnline'] would work...

Vendor Context for Read and Write
==================================
**********************************
In `BAC0.device`, the vendor_id context will be provided to the stack automatically. This mean that
if a device is created and there is a extended implementation of an object (JCIDeviceObject for example)
BAC0 will recognize the proprietary object by default, without having the need to explicitly define the
Expand All @@ -185,7 +185,7 @@ Also, proprietary objects and properties classes are defined at startup so it is
register them.

Can proprietary objects be addded to a BAC0.device points
==========================================================
********************************************************************
Actually not, because of the way "points" are defined in BAC0. If you look at `BAC0.core.devices.Points.Point`
you will see that the notion of point is oriented differently than a BACnet object.
Properties are a set of informations useful for BAC0 itself but are not "strictly" BACnet properties.
Expand All @@ -199,15 +199,15 @@ For this reason, proprietary objects must be dealt outside of the scope of a dev
of writing to them.

How to implement readMultiple with proprietary objects and properties
======================================================================
**********************************************************************
It is possible to create read property multiple requests with them, using the syntax `@obj_` and `@prop_`.
So for now, you will be able to create a request yourself for one device at a time by chaining properties you want
to read :

bacnet.readMultiple('2000:31 device 5012 @prop_3653 analogInput 1106 presentValue units')

How to find proprietary objects and properties
================================================
********************************************************************
In BAC0, for a device or a point, you can use :

device.bacnet_properties
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bacpypes>=0.17.5
bacpypes>=0.18
2 changes: 1 addition & 1 deletion tests/test_0BacpypesVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ def test_BacpypesVersion():
For comparison, 17.5 becomes 17.005
"""
maj, minor, patch = bacpypes.__version__.split(".")
version = float(maj) * 1000000 + float(minor) + float(patch)/1000
version = float(maj) * 1000000 + float(minor) + float(patch) / 1000
assert version >= 17.005

0 comments on commit 9b8cc7f

Please sign in to comment.