1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-09-28 22:15:23 +08:00

sync the versions

This commit is contained in:
Joel Bender 2017-09-07 00:23:53 -04:00
parent c1c4e077ac
commit 5f761b7d91
7 changed files with 36 additions and 11 deletions

View File

@ -1495,7 +1495,7 @@ class DeviceCommunicationControlRequestEnableDisable(Enumerated):
enumerations = \
{ 'enable':0
, 'disable':1
, 'defaultInitiation':2
, 'disableInitiation':2
}
class DeviceCommunicationControlRequest(ConfirmedRequestSequence):

View File

@ -1474,7 +1474,7 @@ class ApplicationServiceAccessPoint(ApplicationServiceElement, ServiceAccessPoin
try:
xpdu = atype()
xpdu.decode(apdu)
except Exception,err:
except Exception, err:
ApplicationServiceAccessPoint._exception("error PDU decoding error: %r", err)
xpdu = Error(errorClass=0, errorCode=0)

View File

@ -304,7 +304,7 @@ class COVIncrementCriteria(COVDetection):
# continue
COVDetection.send_cov_notifications(self)
bacpypes_debugging(COVIncrementCriteria)
bacpypes_debugging(COVDetection)
class AccessDoorCriteria(COVDetection):

View File

@ -243,6 +243,7 @@ class COVDetection(DetectionAlgorithm):
"(" + ','.join(self.properties_tracked) + ')' + \
">"
class GenericCriteria(COVDetection):
properties_tracked = (
@ -316,6 +317,7 @@ class AccessDoorCriteria(COVDetection):
'doorAlarmState',
)
class AccessPointCriteria(COVDetection):
properties_tracked = (
@ -332,6 +334,7 @@ class AccessPointCriteria(COVDetection):
)
monitored_property_reference = 'accessEvent'
class CredentialDataInputCriteria(COVDetection):
properties_tracked = (
@ -344,6 +347,7 @@ class CredentialDataInputCriteria(COVDetection):
'updateTime',
)
class LoadControlCriteria(COVDetection):
properties_tracked = (
@ -363,6 +367,7 @@ class LoadControlCriteria(COVDetection):
'dutyWindow',
)
class PulseConverterCriteria(COVDetection):
properties_tracked = (
@ -374,6 +379,7 @@ class PulseConverterCriteria(COVDetection):
'statusFlags',
)
# mapping from object type to appropriate criteria class
criteria_type_map = {
'accessPoint': AccessPointCriteria,

View File

@ -4,7 +4,7 @@
Application Layer Protocol Data Units
"""
from .errors import DecodingError
from .errors import DecodingError, TooManyArguments
from .debugging import ModuleLogger, DebugContents, bacpypes_debugging
from .pdu import PCI, PDUData
@ -683,6 +683,7 @@ class APCISequence(APCI, Sequence):
# create a tag list and decode the rest of the data
self._tag_list = TagList()
self._tag_list.decode(apdu)
if _debug: APCISequence._debug(" - tag list: %r", self._tag_list)
# pass the taglist to the Sequence for additional decoding
Sequence.decode(self, self._tag_list)
@ -690,6 +691,7 @@ class APCISequence(APCI, Sequence):
# trailing unmatched tags
if self._tag_list:
if _debug: APCISequence._debug(" - trailing unmatched tags")
raise TooManyArguments()
def apdu_contents(self, use_dict=None, as_class=dict):
"""Return the contents of an object as a dict."""
@ -1484,9 +1486,9 @@ register_confirmed_request_type(RemoveListElementRequest)
class DeviceCommunicationControlRequestEnableDisable(Enumerated):
enumerations = \
{ 'enable':0
, 'disable':1
, 'defaultInitiation':2
{ 'enable': 0
, 'disable': 1
, 'disableInitiation': 2
}
class DeviceCommunicationControlRequest(ConfirmedRequestSequence):

View File

@ -200,9 +200,7 @@ class Application(ApplicationServiceElement, Collector):
# keep track of the local device
if localDevice:
self.smap = StateMachineAccessPoint(localDevice)
self.localDevice = localDevice
self.smap._localDevice = self.localDevice
# bind the device object to this application
localDevice._app = self
@ -226,8 +224,6 @@ class Application(ApplicationServiceElement, Collector):
# use the provided cache or make a default one
self.deviceInfoCache = deviceInfoCache or DeviceInfoCache()
if not self.smap.deviceInfoCache:
self.smap.deviceInfoCache = self.deviceInfoCache
# controllers for managing confirmed requests as a client
self.controllers = {}
@ -474,6 +470,14 @@ class BIPSimpleApplication(ApplicationIOController, WhoIsIAmServices, ReadWriteP
# include a application decoder
self.asap = ApplicationServiceAccessPoint()
# pass the device object to the state machine access point so it
# can know if it should support segmentation
self.smap = StateMachineAccessPoint(localDevice)
# the segmentation state machines need access to the same device
# information cache as the application
self.smap.deviceInfoCache = self.deviceInfoCache
# a network service access point will be needed
self.nsap = NetworkServiceAccessPoint()
@ -522,6 +526,14 @@ class BIPForeignApplication(ApplicationIOController, WhoIsIAmServices, ReadWrite
# include a application decoder
self.asap = ApplicationServiceAccessPoint()
# pass the device object to the state machine access point so it
# can know if it should support segmentation
self.smap = StateMachineAccessPoint(localDevice)
# the segmentation state machines need access to the same device
# information cache as the application
self.smap.deviceInfoCache = self.deviceInfoCache
# a network service access point will be needed
self.nsap = NetworkServiceAccessPoint()

View File

@ -317,6 +317,7 @@ class AccessDoorCriteria(COVDetection):
'doorAlarmState',
)
class AccessPointCriteria(COVDetection):
properties_tracked = (
@ -333,6 +334,7 @@ class AccessPointCriteria(COVDetection):
)
monitored_property_reference = 'accessEvent'
class CredentialDataInputCriteria(COVDetection):
properties_tracked = (
@ -345,6 +347,7 @@ class CredentialDataInputCriteria(COVDetection):
'updateTime',
)
class LoadControlCriteria(COVDetection):
properties_tracked = (
@ -364,6 +367,7 @@ class LoadControlCriteria(COVDetection):
'dutyWindow',
)
class PulseConverterCriteria(COVDetection):
properties_tracked = (
@ -375,6 +379,7 @@ class PulseConverterCriteria(COVDetection):
'statusFlags',
)
# mapping from object type to appropriate criteria class
criteria_type_map = {
'accessPoint': AccessPointCriteria,