Skip to content

Commit

Permalink
0.18.0 releasd
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelBender committed Jan 29, 2020
1 parent 792041b commit 5c7da58
Show file tree
Hide file tree
Showing 28 changed files with 903 additions and 221 deletions.
2 changes: 1 addition & 1 deletion py25/bacpypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Project Metadata
#

__version__ = '0.17.7'
__version__ = '0.18.0'
__author__ = 'Joel Bender'
__email__ = '[email protected]'

Expand Down
19 changes: 15 additions & 4 deletions py25/bacpypes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def process_io(self, iocb):
# look up the queue
queue = self.queue_by_address.get(destination_address, None)
if not queue:
queue = SieveQueue(self.request, destination_address)
queue = SieveQueue(self._app_request, destination_address)
self.queue_by_address[destination_address] = queue
if _debug: ApplicationIOController._debug(" - queue: %r", queue)

Expand Down Expand Up @@ -455,16 +455,27 @@ def _app_complete(self, address, apdu):
if _debug: ApplicationIOController._debug(" - queue is empty")
del self.queue_by_address[address]

def request(self, apdu):
if _debug: ApplicationIOController._debug("request %r", apdu)
def _app_request(self, apdu):
if _debug: ApplicationIOController._debug("_app_request %r", apdu)

# send it downstream
# send it downstream, bypass the guard
super(ApplicationIOController, self).request(apdu)

# if this was an unconfirmed request, it's complete, no message
if isinstance(apdu, UnconfirmedRequestPDU):
self._app_complete(apdu.pduDestination, None)

def request(self, apdu):
if _debug: ApplicationIOController._debug("request %r", apdu)

# if this is not unconfirmed request, tell the application to use
# the IOCB interface
if not isinstance(apdu, UnconfirmedRequestPDU):
raise RuntimeError("use IOCB for confirmed requests")

# send it downstream
super(ApplicationIOController, self).request(apdu)

def confirmation(self, apdu):
if _debug: ApplicationIOController._debug("confirmation %r", apdu)

Expand Down
8 changes: 6 additions & 2 deletions py25/bacpypes/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, sap, pdu_address):
self.apduTimeout = getattr(sap.localDevice, 'apduTimeout', sap.apduTimeout)

self.segmentationSupported = getattr(sap.localDevice, 'segmentationSupported', sap.segmentationSupported)
self.segmentTimeout = getattr(sap.localDevice, 'segmentTimeout', sap.segmentTimeout)
self.segmentTimeout = getattr(sap.localDevice, 'apduSegmentTimeout', sap.segmentTimeout)
self.maxSegmentsAccepted = getattr(sap.localDevice, 'maxSegmentsAccepted', sap.maxSegmentsAccepted)
self.maxApduLengthAccepted = getattr(sap.localDevice, 'maxApduLengthAccepted', sap.maxApduLengthAccepted)

Expand Down Expand Up @@ -530,7 +530,11 @@ def segmented_request_timeout(self):

self.segmentRetryCount += 1
self.start_timer(self.segmentTimeout)
self.fill_window(self.initialSequenceNumber)

if self.initialSequenceNumber == 0:
self.request(self.get_segment(0))
else:
self.fill_window(self.initialSequenceNumber)
else:
if _debug: ClientSSM._debug(" - abort, no response from the device")

Expand Down
5 changes: 2 additions & 3 deletions py25/bacpypes/basetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,6 @@ def decode(self, taglist):

bacpypes_debugging(NameValue)

>>>>>>> stage
class DeviceAddress(Sequence):
sequenceElements = \
[ Element('networkNumber', Unsigned)
Expand Down Expand Up @@ -2625,8 +2624,8 @@ class PropertyReference(Sequence):

class Scale(Choice):
choiceElements = \
[ Element('floatScale', Real)
, Element('integerScale', Integer)
[ Element('floatScale', Real, 0)
, Element('integerScale', Integer, 1)
]

class SecurityKeySet(Sequence):
Expand Down
4 changes: 2 additions & 2 deletions py25/bacpypes/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def run(spin=SPIN, sigterm=stop, sigusr1=print_stack):
if _debug: run._info("keyboard interrupt")
running = False
except Exception, err:
if _debug: run._exception("an error has occurred: %s", err)
run._exception("an error has occurred: %s", err)

running = False

Expand Down Expand Up @@ -223,7 +223,7 @@ def run_once():
except KeyboardInterrupt:
if _debug: run_once._info("keyboard interrupt")
except Exception, err:
if _debug: run_once._exception("an error has occurred: %s", err)
run_once._exception("an error has occurred: %s", err)

bacpypes_debugging(run_once)

Expand Down
8 changes: 6 additions & 2 deletions py25/bacpypes/service/cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,8 @@ def ReadProperty(self, obj, arrayIndex=None):
current_time = TaskManager().get_time()
if _debug: ActiveCOVSubscriptions._debug(" - current_time: %r", current_time)

# start with an empty sequence
cov_subscriptions = ListOf(COVSubscription)()
# start with an empty list
cov_subscriptions = []

# loop through the subscriptions
for cov in obj._app.subscriptions():
Expand Down Expand Up @@ -553,6 +553,10 @@ def ReadProperty(self, obj, arrayIndex=None):
)
if _debug: ActiveCOVSubscriptions._debug(" - recipient_process: %r", recipient_process)

# look for the algorithm already associated with this object
cov_detection = cov.obj_ref._app.cov_detections[cov.obj_ref]
if _debug: ActiveCOVSubscriptions._debug(" - cov_detection: %r", cov_detection)

cov_subscription = COVSubscription(
recipient=recipient_process,
monitoredPropertyReference=ObjectPropertyReference(
Expand Down
2 changes: 1 addition & 1 deletion py27/bacpypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Project Metadata
#

__version__ = '0.17.7'
__version__ = '0.18.0'
__author__ = 'Joel Bender'
__email__ = '[email protected]'

Expand Down
19 changes: 15 additions & 4 deletions py27/bacpypes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def process_io(self, iocb):
# look up the queue
queue = self.queue_by_address.get(destination_address, None)
if not queue:
queue = SieveQueue(self.request, destination_address)
queue = SieveQueue(self._app_request, destination_address)
self.queue_by_address[destination_address] = queue
if _debug: ApplicationIOController._debug(" - queue: %r", queue)

Expand Down Expand Up @@ -463,16 +463,27 @@ def _app_complete(self, address, apdu):
if _debug: ApplicationIOController._debug(" - queue is empty")
del self.queue_by_address[address]

def request(self, apdu):
if _debug: ApplicationIOController._debug("request %r", apdu)
def _app_request(self, apdu):
if _debug: ApplicationIOController._debug("_app_request %r", apdu)

# send it downstream
# send it downstream, bypass the guard
super(ApplicationIOController, self).request(apdu)

# if this was an unconfirmed request, it's complete, no message
if isinstance(apdu, UnconfirmedRequestPDU):
self._app_complete(apdu.pduDestination, None)

def request(self, apdu):
if _debug: ApplicationIOController._debug("request %r", apdu)

# if this is not unconfirmed request, tell the application to use
# the IOCB interface
if not isinstance(apdu, UnconfirmedRequestPDU):
raise RuntimeError("use IOCB for confirmed requests")

# send it downstream
super(ApplicationIOController, self).request(apdu)

def confirmation(self, apdu):
if _debug: ApplicationIOController._debug("confirmation %r", apdu)

Expand Down
8 changes: 6 additions & 2 deletions py27/bacpypes/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(self, sap, pdu_address):
self.apduTimeout = getattr(sap.localDevice, 'apduTimeout', sap.apduTimeout)

self.segmentationSupported = getattr(sap.localDevice, 'segmentationSupported', sap.segmentationSupported)
self.segmentTimeout = getattr(sap.localDevice, 'segmentTimeout', sap.segmentTimeout)
self.segmentTimeout = getattr(sap.localDevice, 'apduSegmentTimeout', sap.segmentTimeout)
self.maxSegmentsAccepted = getattr(sap.localDevice, 'maxSegmentsAccepted', sap.maxSegmentsAccepted)
self.maxApduLengthAccepted = getattr(sap.localDevice, 'maxApduLengthAccepted', sap.maxApduLengthAccepted)

Expand Down Expand Up @@ -530,7 +530,11 @@ def segmented_request_timeout(self):

self.segmentRetryCount += 1
self.start_timer(self.segmentTimeout)
self.fill_window(self.initialSequenceNumber)

if self.initialSequenceNumber == 0:
self.request(self.get_segment(0))
else:
self.fill_window(self.initialSequenceNumber)
else:
if _debug: ClientSSM._debug(" - abort, no response from the device")

Expand Down
4 changes: 2 additions & 2 deletions py27/bacpypes/basetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2623,8 +2623,8 @@ class PropertyReference(Sequence):

class Scale(Choice):
choiceElements = \
[ Element('floatScale', Real)
, Element('integerScale', Integer)
[ Element('floatScale', Real, 0)
, Element('integerScale', Integer, 1)
]

class SecurityKeySet(Sequence):
Expand Down
4 changes: 2 additions & 2 deletions py27/bacpypes/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def run(spin=SPIN, sigterm=stop, sigusr1=print_stack):
if _debug: run._info("keyboard interrupt")
running = False
except Exception as err:
if _debug: run._exception("an error has occurred: %s", err)
run._exception("an error has occurred: %s", err)

running = False

Expand Down Expand Up @@ -220,7 +220,7 @@ def run_once():
except KeyboardInterrupt:
if _debug: run_once._info("keyboard interrupt")
except Exception as err:
if _debug: run_once._exception("an error has occurred: %s", err)
run_once._exception("an error has occurred: %s", err)

#
# deferred
Expand Down
8 changes: 6 additions & 2 deletions py27/bacpypes/service/cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ def ReadProperty(self, obj, arrayIndex=None):
current_time = TaskManager().get_time()
if _debug: ActiveCOVSubscriptions._debug(" - current_time: %r", current_time)

# start with an empty sequence
cov_subscriptions = ListOf(COVSubscription)()
# start with an empty list
cov_subscriptions = []

# loop through the subscriptions
for cov in obj._app.subscriptions():
Expand Down Expand Up @@ -552,6 +552,10 @@ def ReadProperty(self, obj, arrayIndex=None):
)
if _debug: ActiveCOVSubscriptions._debug(" - recipient_process: %r", recipient_process)

# look for the algorithm already associated with this object
cov_detection = cov.obj_ref._app.cov_detections[cov.obj_ref]
if _debug: ActiveCOVSubscriptions._debug(" - cov_detection: %r", cov_detection)

cov_subscription = COVSubscription(
recipient=recipient_process,
monitoredPropertyReference=ObjectPropertyReference(
Expand Down
2 changes: 1 addition & 1 deletion py34/bacpypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Project Metadata
#

__version__ = '0.17.7'
__version__ = '0.18.0'
__author__ = 'Joel Bender'
__email__ = '[email protected]'

Expand Down
19 changes: 15 additions & 4 deletions py34/bacpypes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def process_io(self, iocb):
# look up the queue
queue = self.queue_by_address.get(destination_address, None)
if not queue:
queue = SieveQueue(self.request, destination_address)
queue = SieveQueue(self._app_request, destination_address)
self.queue_by_address[destination_address] = queue
if _debug: ApplicationIOController._debug(" - queue: %r", queue)

Expand Down Expand Up @@ -463,16 +463,27 @@ def _app_complete(self, address, apdu):
if _debug: ApplicationIOController._debug(" - queue is empty")
del self.queue_by_address[address]

def request(self, apdu):
if _debug: ApplicationIOController._debug("request %r", apdu)
def _app_request(self, apdu):
if _debug: ApplicationIOController._debug("_app_request %r", apdu)

# send it downstream
# send it downstream, bypass the guard
super(ApplicationIOController, self).request(apdu)

# if this was an unconfirmed request, it's complete, no message
if isinstance(apdu, UnconfirmedRequestPDU):
self._app_complete(apdu.pduDestination, None)

def request(self, apdu):
if _debug: ApplicationIOController._debug("request %r", apdu)

# if this is not unconfirmed request, tell the application to use
# the IOCB interface
if not isinstance(apdu, UnconfirmedRequestPDU):
raise RuntimeError("use IOCB for confirmed requests")

# send it downstream
super(ApplicationIOController, self).request(apdu)

def confirmation(self, apdu):
if _debug: ApplicationIOController._debug("confirmation %r", apdu)

Expand Down
8 changes: 6 additions & 2 deletions py34/bacpypes/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(self, sap, pdu_address):
self.apduTimeout = getattr(sap.localDevice, 'apduTimeout', sap.apduTimeout)

self.segmentationSupported = getattr(sap.localDevice, 'segmentationSupported', sap.segmentationSupported)
self.segmentTimeout = getattr(sap.localDevice, 'segmentTimeout', sap.segmentTimeout)
self.segmentTimeout = getattr(sap.localDevice, 'apduSegmentTimeout', sap.segmentTimeout)
self.maxSegmentsAccepted = getattr(sap.localDevice, 'maxSegmentsAccepted', sap.maxSegmentsAccepted)
self.maxApduLengthAccepted = getattr(sap.localDevice, 'maxApduLengthAccepted', sap.maxApduLengthAccepted)

Expand Down Expand Up @@ -530,7 +530,11 @@ def segmented_request_timeout(self):

self.segmentRetryCount += 1
self.start_timer(self.segmentTimeout)
self.fill_window(self.initialSequenceNumber)

if self.initialSequenceNumber == 0:
self.request(self.get_segment(0))
else:
self.fill_window(self.initialSequenceNumber)
else:
if _debug: ClientSSM._debug(" - abort, no response from the device")

Expand Down
4 changes: 2 additions & 2 deletions py34/bacpypes/basetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2623,8 +2623,8 @@ class PropertyReference(Sequence):

class Scale(Choice):
choiceElements = \
[ Element('floatScale', Real)
, Element('integerScale', Integer)
[ Element('floatScale', Real, 0)
, Element('integerScale', Integer, 1)
]

class SecurityKeySet(Sequence):
Expand Down
4 changes: 2 additions & 2 deletions py34/bacpypes/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def run(spin=SPIN, sigterm=stop, sigusr1=print_stack):
if _debug: run._info("keyboard interrupt")
running = False
except Exception as err:
if _debug: run._exception("an error has occurred: %s", err)
run._exception("an error has occurred: %s", err)

running = False

Expand Down Expand Up @@ -220,7 +220,7 @@ def run_once():
except KeyboardInterrupt:
if _debug: run_once._info("keyboard interrupt")
except Exception as err:
if _debug: run_once._exception("an error has occurred: %s", err)
run_once._exception("an error has occurred: %s", err)

#
# deferred
Expand Down
Loading

0 comments on commit 5c7da58

Please sign in to comment.