Commit 0abfaff8 authored by Michael Buesch's avatar Michael Buesch
Browse files

dp: Print debug message, if slave requeste Set_Prm frame

parent 5538b2e1
......@@ -305,7 +305,7 @@ class DpTelegram_SlaveDiag_Con(DpTelegram):
dsap=DpTelegram.SSAP_MS0,
ssap=DpTelegram.DSAP_SLAVE_DIAG):
DpTelegram.__init__(self, da=da, sa=sa, fc=fc,
dsap=dsap, ssap=ssap)
dsap=dsap, ssap=ssap)
self.b0 = 0
self.b1 = 0
self.b2 = 0
......@@ -376,19 +376,20 @@ class DpTelegram_SlaveDiag_Con(DpTelegram):
def hasOnebit(self):
return (self.b1 & self.B1_ONE) != 0
def prmReq(self):
return (self.b1 & self.B1_PRMREQ) != 0
def needsNewPrmCfg(self):
return ((self.b0 & self.B0_CFGFLT) != 0 or\
(self.b0 & self.B0_PRMFLT) != 0 or\
return ((self.b0 & self.B0_CFGFLT) != 0 or
(self.b0 & self.B0_PRMFLT) != 0 or
(self.b1 & self.B1_PRMREQ) != 0)
def isReadyDataEx(self):
return not ((self.b0 & (\
self.B0_STANOEX |\
self.B0_STANORDY |\
self.B0_CFGFLT |\
self.B0_PRMFLT)) != 0 or\
(self.b1 & (\
self.B1_PRMREQ)) != 0)
return ((self.b0 & (self.B0_STANOEX |
self.B0_STANORDY |
self.B0_CFGFLT |
self.B0_PRMFLT)) == 0 and
(self.b1 & (self.B1_PRMREQ)) == 0)
class DpTelegram_SetPrm_Req(DpTelegram):
# Station status
......
......@@ -529,6 +529,10 @@ class DpMaster(object):
self.__errorMsg("Slave %d reports a faulty "
"parameterization (Set_Prm)." %\
slave.slaveDesc.slaveAddr)
if telegram.prmReq():
self.__debugMsg("Slave %d requests a new "
"parameterization (Set_Prm)." %\
slave.slaveDesc.slaveAddr)
if telegram.isNotSupp():
self.__errorMsg("Slave %d replied with "
"\"function not supported\". "
......@@ -543,9 +547,9 @@ class DpMaster(object):
self.__debugMsg("Slave %d diagnostic "
"always-one-bit is zero." %\
slave.slaveDesc.slaveAddr)
if telegram.hasExtDiag():
pass#TODO turn on red DIAG-LED
if telegram.isReadyDataEx():
slave.setState(slave.STATE_DX)
return None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment