Created
July 15, 2020 17:15
-
-
Save JoelBender/5ddb15970d5ea1d0dd7926e5dfb9ca61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bacpypes.primitivedata import TagList | |
from bacpypes.basetypes import ( | |
DeviceObjectPropertyReference, | |
EventParameterAccessEventAccessEvent, | |
) | |
x = EventParameterAccessEventAccessEvent( | |
listOfAccessEvents=["deniedMaxAttempts"], | |
accessEventTimeReference=DeviceObjectPropertyReference( | |
objectIdentifier=("analogValue", 1), propertyIdentifier="presentValue" | |
), | |
) | |
print("x:") | |
x.debug_contents() | |
# listOfAccessEvents | |
# [0] = 'deniedMaxAttempts' | |
# accessEventTimeReference | |
# objectIdentifier = ('analogValue', 1) | |
# propertyIdentifier = 'presentValue' | |
tl = TagList() | |
x.encode(tl) | |
print("tag list:") | |
tl.debug_contents() | |
# <bacpypes.primitivedata.OpeningTag(open(0)) instance at 0x7fcdad7e7160> | |
# tagClass = 2 opening | |
# tagNumber = 0 | |
# tagLVT = 0 | |
# <bacpypes.primitivedata.Tag(enumerated) instance at 0x7fcdb1873da0> | |
# tagClass = 0 application | |
# tagNumber = 9 enumerated | |
# tagLVT = 1 | |
# tagData = '8c' | |
# <bacpypes.primitivedata.ClosingTag(close(0)) instance at 0x7fcdb1873e10> | |
# tagClass = 3 closing | |
# tagNumber = 0 | |
# tagLVT = 0 | |
# tagData = '' | |
# <bacpypes.primitivedata.OpeningTag(open(1)) instance at 0x7fcdace86f98> | |
# tagClass = 2 opening | |
# tagNumber = 1 | |
# tagLVT = 0 | |
# tagData = '' | |
# <bacpypes.primitivedata.ContextTag(context(0)) instance at 0x7fcdace93128> | |
# tagClass = 1 context | |
# tagNumber = 0 | |
# tagLVT = 4 | |
# tagData = '00.80.00.01' | |
# <bacpypes.primitivedata.ContextTag(context(1)) instance at 0x7fcdace93160> | |
# tagClass = 1 context | |
# tagNumber = 1 | |
# tagLVT = 1 | |
# tagData = '55' | |
# <bacpypes.primitivedata.ClosingTag(close(1)) instance at 0x7fcdace930f0> | |
# tagClass = 3 closing | |
# tagNumber = 1 | |
# tagLVT = 0 | |
# tagData = '' | |
y = EventParameterAccessEventAccessEvent() | |
y.decode(tl) | |
print("y:") | |
y.debug_contents() | |
# listOfAccessEvents | |
# [0] = 'deniedMaxAttempts' | |
# accessEventTimeReference | |
# objectIdentifier = ('analogValue', 1) | |
# propertyIdentifier = 'presentValue' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment