1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-27 00:57:47 +08:00

a little more debugging, starting on the next layer

This commit is contained in:
Joel Bender
2015-09-28 20:51:31 -04:00
parent 60cba9c949
commit 5e9f5ea693
6 changed files with 46 additions and 0 deletions

View File

@@ -681,6 +681,10 @@ class APCISequence(APCI, Sequence):
# pass the taglist to the Sequence for additional decoding
Sequence.decode(self, self._tag_list)
# trailing unmatched tags
if self._tag_list:
if _debug: APCISequence._debug(" - trailing unmatched tags")
def apdu_contents(self, use_dict=None, as_class=dict):
"""Return the contents of an object as a dict."""
if _debug: APCISequence._debug("apdu_contents use_dict=%r as_class=%r", use_dict, as_class)

View File

@@ -28,6 +28,17 @@ class Element:
self.context = context
self.optional = optional
def __repr__(self):
desc = "%s(%s" % (self.__class__.__name__, self.name)
desc += " " + self.klass.__name__
if self.context is not None:
desc += ", context=%r" % (self.context,)
if self.optional:
desc += ", optional"
desc += ")"
return '<' + desc + ' instance at 0x%08x' % (id(self),) + '>'
#
# Sequence
#