mirror of
https://github.com/JoelBender/bacpypes
synced 2025-09-28 22:15:23 +08:00
sync the versions
This commit is contained in:
parent
c1c4e077ac
commit
5f761b7d91
|
@ -1495,7 +1495,7 @@ class DeviceCommunicationControlRequestEnableDisable(Enumerated):
|
||||||
enumerations = \
|
enumerations = \
|
||||||
{ 'enable':0
|
{ 'enable':0
|
||||||
, 'disable':1
|
, 'disable':1
|
||||||
, 'defaultInitiation':2
|
, 'disableInitiation':2
|
||||||
}
|
}
|
||||||
|
|
||||||
class DeviceCommunicationControlRequest(ConfirmedRequestSequence):
|
class DeviceCommunicationControlRequest(ConfirmedRequestSequence):
|
||||||
|
|
|
@ -1474,7 +1474,7 @@ class ApplicationServiceAccessPoint(ApplicationServiceElement, ServiceAccessPoin
|
||||||
try:
|
try:
|
||||||
xpdu = atype()
|
xpdu = atype()
|
||||||
xpdu.decode(apdu)
|
xpdu.decode(apdu)
|
||||||
except Exception,err:
|
except Exception, err:
|
||||||
ApplicationServiceAccessPoint._exception("error PDU decoding error: %r", err)
|
ApplicationServiceAccessPoint._exception("error PDU decoding error: %r", err)
|
||||||
xpdu = Error(errorClass=0, errorCode=0)
|
xpdu = Error(errorClass=0, errorCode=0)
|
||||||
|
|
||||||
|
|
|
@ -304,7 +304,7 @@ class COVIncrementCriteria(COVDetection):
|
||||||
# continue
|
# continue
|
||||||
COVDetection.send_cov_notifications(self)
|
COVDetection.send_cov_notifications(self)
|
||||||
|
|
||||||
bacpypes_debugging(COVIncrementCriteria)
|
bacpypes_debugging(COVDetection)
|
||||||
|
|
||||||
|
|
||||||
class AccessDoorCriteria(COVDetection):
|
class AccessDoorCriteria(COVDetection):
|
||||||
|
|
|
@ -243,6 +243,7 @@ class COVDetection(DetectionAlgorithm):
|
||||||
"(" + ','.join(self.properties_tracked) + ')' + \
|
"(" + ','.join(self.properties_tracked) + ')' + \
|
||||||
">"
|
">"
|
||||||
|
|
||||||
|
|
||||||
class GenericCriteria(COVDetection):
|
class GenericCriteria(COVDetection):
|
||||||
|
|
||||||
properties_tracked = (
|
properties_tracked = (
|
||||||
|
@ -316,6 +317,7 @@ class AccessDoorCriteria(COVDetection):
|
||||||
'doorAlarmState',
|
'doorAlarmState',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class AccessPointCriteria(COVDetection):
|
class AccessPointCriteria(COVDetection):
|
||||||
|
|
||||||
properties_tracked = (
|
properties_tracked = (
|
||||||
|
@ -332,6 +334,7 @@ class AccessPointCriteria(COVDetection):
|
||||||
)
|
)
|
||||||
monitored_property_reference = 'accessEvent'
|
monitored_property_reference = 'accessEvent'
|
||||||
|
|
||||||
|
|
||||||
class CredentialDataInputCriteria(COVDetection):
|
class CredentialDataInputCriteria(COVDetection):
|
||||||
|
|
||||||
properties_tracked = (
|
properties_tracked = (
|
||||||
|
@ -344,6 +347,7 @@ class CredentialDataInputCriteria(COVDetection):
|
||||||
'updateTime',
|
'updateTime',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class LoadControlCriteria(COVDetection):
|
class LoadControlCriteria(COVDetection):
|
||||||
|
|
||||||
properties_tracked = (
|
properties_tracked = (
|
||||||
|
@ -363,6 +367,7 @@ class LoadControlCriteria(COVDetection):
|
||||||
'dutyWindow',
|
'dutyWindow',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class PulseConverterCriteria(COVDetection):
|
class PulseConverterCriteria(COVDetection):
|
||||||
|
|
||||||
properties_tracked = (
|
properties_tracked = (
|
||||||
|
@ -374,6 +379,7 @@ class PulseConverterCriteria(COVDetection):
|
||||||
'statusFlags',
|
'statusFlags',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# mapping from object type to appropriate criteria class
|
# mapping from object type to appropriate criteria class
|
||||||
criteria_type_map = {
|
criteria_type_map = {
|
||||||
'accessPoint': AccessPointCriteria,
|
'accessPoint': AccessPointCriteria,
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Application Layer Protocol Data Units
|
Application Layer Protocol Data Units
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from .errors import DecodingError
|
from .errors import DecodingError, TooManyArguments
|
||||||
from .debugging import ModuleLogger, DebugContents, bacpypes_debugging
|
from .debugging import ModuleLogger, DebugContents, bacpypes_debugging
|
||||||
|
|
||||||
from .pdu import PCI, PDUData
|
from .pdu import PCI, PDUData
|
||||||
|
@ -683,6 +683,7 @@ class APCISequence(APCI, Sequence):
|
||||||
# create a tag list and decode the rest of the data
|
# create a tag list and decode the rest of the data
|
||||||
self._tag_list = TagList()
|
self._tag_list = TagList()
|
||||||
self._tag_list.decode(apdu)
|
self._tag_list.decode(apdu)
|
||||||
|
if _debug: APCISequence._debug(" - tag list: %r", self._tag_list)
|
||||||
|
|
||||||
# pass the taglist to the Sequence for additional decoding
|
# pass the taglist to the Sequence for additional decoding
|
||||||
Sequence.decode(self, self._tag_list)
|
Sequence.decode(self, self._tag_list)
|
||||||
|
@ -690,6 +691,7 @@ class APCISequence(APCI, Sequence):
|
||||||
# trailing unmatched tags
|
# trailing unmatched tags
|
||||||
if self._tag_list:
|
if self._tag_list:
|
||||||
if _debug: APCISequence._debug(" - trailing unmatched tags")
|
if _debug: APCISequence._debug(" - trailing unmatched tags")
|
||||||
|
raise TooManyArguments()
|
||||||
|
|
||||||
def apdu_contents(self, use_dict=None, as_class=dict):
|
def apdu_contents(self, use_dict=None, as_class=dict):
|
||||||
"""Return the contents of an object as a dict."""
|
"""Return the contents of an object as a dict."""
|
||||||
|
@ -1484,9 +1486,9 @@ register_confirmed_request_type(RemoveListElementRequest)
|
||||||
|
|
||||||
class DeviceCommunicationControlRequestEnableDisable(Enumerated):
|
class DeviceCommunicationControlRequestEnableDisable(Enumerated):
|
||||||
enumerations = \
|
enumerations = \
|
||||||
{ 'enable':0
|
{ 'enable': 0
|
||||||
, 'disable':1
|
, 'disable': 1
|
||||||
, 'defaultInitiation':2
|
, 'disableInitiation': 2
|
||||||
}
|
}
|
||||||
|
|
||||||
class DeviceCommunicationControlRequest(ConfirmedRequestSequence):
|
class DeviceCommunicationControlRequest(ConfirmedRequestSequence):
|
||||||
|
|
|
@ -200,9 +200,7 @@ class Application(ApplicationServiceElement, Collector):
|
||||||
|
|
||||||
# keep track of the local device
|
# keep track of the local device
|
||||||
if localDevice:
|
if localDevice:
|
||||||
self.smap = StateMachineAccessPoint(localDevice)
|
|
||||||
self.localDevice = localDevice
|
self.localDevice = localDevice
|
||||||
self.smap._localDevice = self.localDevice
|
|
||||||
|
|
||||||
# bind the device object to this application
|
# bind the device object to this application
|
||||||
localDevice._app = self
|
localDevice._app = self
|
||||||
|
@ -226,8 +224,6 @@ class Application(ApplicationServiceElement, Collector):
|
||||||
|
|
||||||
# use the provided cache or make a default one
|
# use the provided cache or make a default one
|
||||||
self.deviceInfoCache = deviceInfoCache or DeviceInfoCache()
|
self.deviceInfoCache = deviceInfoCache or DeviceInfoCache()
|
||||||
if not self.smap.deviceInfoCache:
|
|
||||||
self.smap.deviceInfoCache = self.deviceInfoCache
|
|
||||||
|
|
||||||
# controllers for managing confirmed requests as a client
|
# controllers for managing confirmed requests as a client
|
||||||
self.controllers = {}
|
self.controllers = {}
|
||||||
|
@ -474,6 +470,14 @@ class BIPSimpleApplication(ApplicationIOController, WhoIsIAmServices, ReadWriteP
|
||||||
# include a application decoder
|
# include a application decoder
|
||||||
self.asap = ApplicationServiceAccessPoint()
|
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
|
# a network service access point will be needed
|
||||||
self.nsap = NetworkServiceAccessPoint()
|
self.nsap = NetworkServiceAccessPoint()
|
||||||
|
|
||||||
|
@ -522,6 +526,14 @@ class BIPForeignApplication(ApplicationIOController, WhoIsIAmServices, ReadWrite
|
||||||
# include a application decoder
|
# include a application decoder
|
||||||
self.asap = ApplicationServiceAccessPoint()
|
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
|
# a network service access point will be needed
|
||||||
self.nsap = NetworkServiceAccessPoint()
|
self.nsap = NetworkServiceAccessPoint()
|
||||||
|
|
||||||
|
|
|
@ -317,6 +317,7 @@ class AccessDoorCriteria(COVDetection):
|
||||||
'doorAlarmState',
|
'doorAlarmState',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class AccessPointCriteria(COVDetection):
|
class AccessPointCriteria(COVDetection):
|
||||||
|
|
||||||
properties_tracked = (
|
properties_tracked = (
|
||||||
|
@ -333,6 +334,7 @@ class AccessPointCriteria(COVDetection):
|
||||||
)
|
)
|
||||||
monitored_property_reference = 'accessEvent'
|
monitored_property_reference = 'accessEvent'
|
||||||
|
|
||||||
|
|
||||||
class CredentialDataInputCriteria(COVDetection):
|
class CredentialDataInputCriteria(COVDetection):
|
||||||
|
|
||||||
properties_tracked = (
|
properties_tracked = (
|
||||||
|
@ -345,6 +347,7 @@ class CredentialDataInputCriteria(COVDetection):
|
||||||
'updateTime',
|
'updateTime',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class LoadControlCriteria(COVDetection):
|
class LoadControlCriteria(COVDetection):
|
||||||
|
|
||||||
properties_tracked = (
|
properties_tracked = (
|
||||||
|
@ -364,6 +367,7 @@ class LoadControlCriteria(COVDetection):
|
||||||
'dutyWindow',
|
'dutyWindow',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class PulseConverterCriteria(COVDetection):
|
class PulseConverterCriteria(COVDetection):
|
||||||
|
|
||||||
properties_tracked = (
|
properties_tracked = (
|
||||||
|
@ -375,6 +379,7 @@ class PulseConverterCriteria(COVDetection):
|
||||||
'statusFlags',
|
'statusFlags',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# mapping from object type to appropriate criteria class
|
# mapping from object type to appropriate criteria class
|
||||||
criteria_type_map = {
|
criteria_type_map = {
|
||||||
'accessPoint': AccessPointCriteria,
|
'accessPoint': AccessPointCriteria,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user