joelbender / bacpypes Goto Github PK
View Code? Open in Web Editor NEWBACpypes provides a BACnet application layer and network layer written in Python for daemons, scripting, and graphical interfaces.
License: MIT License
BACpypes provides a BACnet application layer and network layer written in Python for daemons, scripting, and graphical interfaces.
License: MIT License
In ObjectIdentifier.__init__()
the version that does a value copy from one ObjectIdentifier to another is wrong, the check for isinstance is in the wrong place. Trivial fix.
Add Value Source Information
Message are correctly sent to the network (verified with Wireshark)
Response is misinterpreted somewhere and give the warning...
Debug :
WARNING:bacpypes.bvllservice.UDPMultiplexer:unsupported message
pduSource = <Address 2:b'\x05'>
pduExpectingReply = 0
pduNetworkPriority = 0
apduType = 7
apduSrv = False
apduInvokeID = 1
apduAbortRejectReason = 65
pduData = x''
This is a test issue to see how HuBoard changes an issue when mucking around with its UI. There is no related branch.
Extend the CHANGE_OF_STATE Event Algorithm for All Discrete Types
Add a New Event Algorithm CHANGE_OF_DISCRETE_VALUE
Add a New Fault Algorithm FAULT_OUT_OF_RANGE
Extend the Loop Object Type to Support Specific Low and High Error Limits
Add the Ability to Report Faults to Date and Time Related Value Objects
Add the Ability to Report Faults to the Command, Device, and Notification Class Objects
http://www.bacnet.org/Addenda/Add-135-2012-an-at-au-av-aw-ax-az-Final.pdf
Zero Config MAC Addresses for MS/TP
http://www.bacnet.org/Addenda/Add-135-2012bb-ppr1-draft_chair_approved.pdf
In the consolelogging.py module the code is attempting to sort the result of calling logging.Logger.manager.loggerDict.keys()
which returns a dict_keys object in py34. Change this to using the sorted()
function that works in py25, py27 and py34.
Advanced network configuration, BVLL responses for non-BBMD devices
mstp mac address are received as string like : b'\x04' instead of a simple conversion
example :
> whois 3:4
> pduSource = <RemoteStation 3:b'\x04'>
iAmDeviceIdentifier = ('device', 5004)
maxAPDULengthAccepted = 480
segmentationSupported = segmentedBoth
vendorID = 5
Add support for IPv6, add an additional method for VMAC determination.
For OpeningTag
and ClosingTag
tags the encoding and decoding is wrong when the tag number is greater than 14. For example, the encoding of OpeningTag(15)
should be 'FE0F'. There aren't any applications for tag numbers this large in the current standard, but it's still wrong!
Add Elevator Object Types
Add COV Property Multiple Services
Add a New Fault Algorithm FAULT_LISTED
http://www.bacnet.org/Addenda/add-135-2012aq-ppr3-draft-8_chair_approved.pdf
Extend BACnet/WS with RESTful services for complex data types and subscriptions
Extract data model from Annex Q into separate common model
Rework Annex Q to be an XML syntax for the common model
Add a JSON syntax for the common model
Replace Annex N SOAP services with a migration guide
Change Clause 21 identifiers to use a consistent format
http://www.bacnet.org/Addenda/Add-135-2012am-PPR1-draft-26_chair_approved.pdf
ERROR:bacpypes.comm.ApplicationServiceElement:exception: TypeError("Can't convert 'bytes' object to str implicitly",)
Traceback (most recent call last):
File "C:\Users\ctremblay.SERVISYS\AppData\Local\Continuum\Anaconda3\lib\site-packages\bacpypes-0.13.1-py3.4.egg\bacpypes\app.py", line 231, in indication
helperFn(apdu)
File "C:\Users\ctremblay.SERVISYS\AppData\Local\Continuum\Anaconda3\lib\site-packages\bacpypes-0.13.1-py3.4.egg\bacpypes\app.py", line 327, in do_ReadPropertyRequest
resp.propertyValue.cast_in(value)
File "C:\Users\ctremblay.SERVISYS\AppData\Local\Continuum\Anaconda3\lib\site-packages\bacpypes-0.13.1-py3.4.egg\bacpypes\constructeddata.py", line 1013, in cast_in
element.encode(tag)
File "C:\Users\ctremblay.SERVISYS\AppData\Local\Continuum\Anaconda3\lib\site-packages\bacpypes-0.13.1-py3.4.egg\bacpypes\primitivedata.py", line 817, in encode
tag.set_app_data(Tag.characterStringAppTag, (chr(self.strEncoding)+self.strValue.encode('latin-1')))
TypeError: Can't convert 'bytes' object to str implicitly
Define Application Interfaces
Enhance Structured View Object
Add New Service ReadPropertyIndirect
Define Machine-Readable Definitions for Application Interfaces
http://www.bacnet.org/Addenda/Add-135-2010ap-APR1-1_chair_approved.pdf
In LocalDeviceObject.init() there is new code that checks to make sure that the class is registered correctly with its vendor identifier. When the code was changed to clean up imports, the object module is no longer completely imported, but the reference to object.register_object_type() and object.register_object_types is no longer correct.
Add engineering units
Harmonize Confirmed and Unconfirmed EventNotification message text handling
Ensure Alert Enrollment objects do not send notifications which require acknowledgment
Allow selection of the Nth last day of the month in a BACnetWeekNDay
Remove initiation of GetEnrollmentSummary from AE-AS-A
Ensure UTC_Offset is configurable
Clarify ReadRange
Clarify the effect of changing Buffer_Size
Stop MS/TP nodes from sending POLL_FOR_MASTER frames to themselves
Improve the Clause 12 pre-amble
Fix the Notification_Class property of the Notification Class object
http://www.bacnet.org/Addenda/Add-135-2012bg-PPR1-Draft-3_chair_approved.pdf
Add Interface_Value Property
http://www.bacnet.org/Addenda/Add-135-2012-an-at-au-av-aw-ax-az-Final.pdf
There are lots of places where "".format() is used but is incompatible with py25. Replace these with the "" % () formatting syntax in the py25 source.
Add tests for primitive data encoding and decoding.
There are tests in almost all of the primitive data test modules that attempts to decode from an empty tag, similar to this one for enumerations:
with self.assertRaises(DecodingError):
obj = Enumerated(enumerated_tag(''))
The issue is to make this work correctly, that is, raise the exception, for all of the datatypes where it is appropriate.
While working on porting the sample applications I noticed that they all use the old "single bit at a time" way of setting the values in the ServicesSupported
bit list. It seems like they should be updated to use the simpler syntax:
protocolServicesSupported = ServicesSupported(['whoIs','iAm','readProperty','writeProperty']).value
Is it better? Comments welcome.
Add CSML Descriptions into BACnet Devices
Add Semantic Tags to All Objects
Extend Structured View Object to Contain Semantic Information
Change Clause 21 identifiers to use a consistent format
Add Data Revisioning Capabilities to CSML
http://www.bacnet.org/Addenda/Add-135-2012ba-ppr3-draft-submittal_chair_approved.pdf
Add Binary Lighting Output Object Type
Setting Non-zero Values to Change_Of_State_Count and Elapsed_Active_Time
http://www.bacnet.org/Addenda/Add-135-2012-an-at-au-av-aw-ax-az-Final.pdf
Extend BIBBs for Primitive Value Objects
Add New BIBBs for Event Enrollment and Subscription
Amend B-AWS Related BIBBs for Revised Event Reporting
Add Life Safety BIBBs and Device Profiles
Add Access Control BIBBs and Device Profiles
Add an All-Domain Advanced Workstation Profile
http://www.bacnet.org/Addenda/Add-135-2012bc-ppr1-draft_chair_approved.pdf
Add a Timer Value Object
Correct Expiry_Time property name to Expiration_Time in the Access Credential Object
Clarify Authentication Factor Value Encoding Rules
Clarify Coercion Support Requirements
http://www.bacnet.org/Addenda/Add-135-2012-an-at-au-av-aw-ax-az-Final.pdf
Similar to the Time bug #47 the Date also has a bug, this fails:
value = Date("1/2/3")
This should be 02-JAN-2003 and correctly calculate the day-of-week. Trivial fix.
Version 0.13.0 that was released and is on PyPI contains bacpypes-0.13.0-py2.py3-none-any.whl
which is incorrect, there should be separate wheels for the different versions of Python.
A sample application is needed to show how to read atomic properties from proprietary objects.
Specify Best Practices for Gateway Design
Add new BIBBS and Devices Profiles
The Echo class in the comm module is broken, the clientPeer and serverPeer checks are backwards, just remove them.
Move the Sphinx documentation from SourceForge.
I thought that I had put in code that walked the class inheritance tree when it built the translation table for enumerations. The idea begin that for some enumerations that can be extended with proprietary values (like ObjectType
) that the developer could just add the additional name/value pairs to the enumerations dictionary and it would pick up the rest. Resurrect this feature, and add appropriate tests.
Remove Incorrect Recipient_List Requirement to be Non-empty
Extend the Allowable BACnetPropertyStates Enumeration Range
Specifically Disallow Duplicate Time Entries in Schedules
Non-BBMD Responses to BBMD BVLL Requests
http://www.bacnet.org/Addenda/Add-135-2012-an-at-au-av-aw-ax-az-Final.pdf
Add Extended Length MS/TP Frames
Add Procedure for Determining Maximum Conveyable APDU
http://www.bacnet.org/Addenda/Add-135-2012am-PPR1-draft-26_chair_approved.pdf
objects.py
From line 144 to 220
def WriteProperty(self, obj, value, arrayIndex=None, priority=None, direct=False):
if _debug:
Property._debug("WriteProperty(%s) %s %r arrayIndex=%r priority=%r direct=%r",
self.identifier, obj, value, arrayIndex, priority, direct
)
if (not direct):
# see if it must be provided
if not self.optional and value is None:
raise ValueError("%s value required" % (self.identifier,))
# see if it can be changed
if not self.mutable:
raise ExecutionError(errorClass='property', errorCode='writeAccessDenied')
#=================================
# THIS IS THE PART I'M QUESTIONNING
#if it's atomic assume correct datatype
if issubclass(self.datatype, Atomic):
if _debug: Property._debug(" - property is atomic, assumed correct type")
if isinstance(value, self.datatype):
if _debug: Property._debug(" - correct type")
elif arrayIndex is not None:
if not issubclass(self.datatype, Array):
raise ExecutionError(errorClass='property', errorCode='propertyIsNotAnArray')
# check the array
arry = obj._values[self.identifier]
if arry is None:
raise RuntimeError("%s uninitialized array" % (self.identifier,))
# seems to be OK, let the array object take over
if _debug: Property._debug(" - forwarding to array")
arry[arrayIndex] = value
return
elif value is not None:
# coerce the value
value = self.datatype(value)
if _debug: Property._debug(" - coerced the value: %r", value)
# seems to be OK
obj._values[self.identifier] = value
It allows value of any kind to be sent to a write request
example : I can send a string to writeProperty of a BinaryValue...
Actually test that should fail are passing
I think we should restraint the value sent to a writeProperty fucntion to the datatype selected in the obejct.
Comparing the dataype of the object class.... without regard to the value sent to the function should be remove I think.
Add Value Source Information
There is a state machine implementation for testing sitting in an untracked project. Bring it in.
In the task module, it is acceptable to install a task with no task manager created, the code just adds the task to the list of uninstalled tasks and they will be installed when the task manager is created. However, when a task is installed and then suspended, the call to suspend_task() fails.
Fix the code to remove the task from the uninstalled tasks if there is no task manager to delegate the activity.
When a primitive data Enumeration
is initialized with an integer, it fails to encode into a tag, because an if
should be an elif
. Fix the bug and fix the tests.
Add a Staged Value Object Type
http://www.bacnet.org/Addenda/Add-135-2012bd-ppr1-draft_chair_approved.pdf
Some time ago I added a feature to parse string versions of time values like this:
value = Time("01:02:03.04")
But apparently an old bug reared its ugly head. It's broken, but a trivial fix.
Deprecate Execution of GetAlarmSummary
Deprecate Execution of GetEnrollmentSummary
http://www.bacnet.org/Addenda/Add-135-2012-an-at-au-av-aw-ax-az-Final.pdf
Correct Application State Machine Failover
Increase Segmentation Window Size for MS/TP
http://www.bacnet.org/Addenda/Add-135-2012bh-PPR1-draft1_chair_approved.pdf
Add Network Port Object Type
Changes to Annex J for the Network Port Object
Changes to 135-2012al for the Network Port Object
In the comm module the !d is used as a format specifier, replace with :d. Applies to p27 and py34.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.