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

clean up misleading debugging

This commit is contained in:
Joel Bender
2018-03-19 16:10:37 -04:00
parent afb882bad9
commit b337465352
3 changed files with 22 additions and 8 deletions

View File

@@ -357,12 +357,12 @@ class APDU(APCI, PDUData):
super(APDU, self).__init__(*args, **kwargs)
def encode(self, pdu):
if _debug: APCI._debug("encode %s", str(pdu))
if _debug: APDU._debug("encode %s", str(pdu))
APCI.encode(self, pdu)
pdu.put_data(self.pduData)
def decode(self, pdu):
if _debug: APCI._debug("decode %s", str(pdu))
if _debug: APDU._debug("decode %s", str(pdu))
APCI.decode(self, pdu)
self.pduData = pdu.get_data(len(pdu.pduData))
@@ -399,14 +399,20 @@ bacpypes_debugging(APDU)
class _APDU(APDU):
def encode(self, pdu):
if _debug: _APDU._debug("encode %r", pdu)
APCI.update(pdu, self)
pdu.put_data(self.pduData)
def decode(self, pdu):
if _debug: _APDU._debug("decode %r", pdu)
APCI.update(self, pdu)
self.pduData = pdu.get_data(len(pdu.pduData))
def set_context(self, context):
if _debug: _APDU._debug("set_context %r", context)
self.pduUserData = context.pduUserData
self.pduDestination = context.pduSource
self.pduExpectingReply = 0
@@ -428,6 +434,8 @@ class _APDU(APDU):
# put it together
return "<%s(%s) instance at %s>" % (sname, stype, hex(id(self)))
bacpypes_debugging(_APDU)
#
# ConfirmedRequestPDU
#