mirror of
https://github.com/uhi22/pyPLC.git
synced 2024-11-20 01:13:58 +00:00
feature: try to SDP already after the setkey, to avoid the need for GetKey. Longer timeout for pairing time.
This commit is contained in:
parent
bcfa89f854
commit
f7058c59f7
2 changed files with 4 additions and 3 deletions
|
@ -28,6 +28,7 @@ CONNMGR_CYCLES_PER_SECOND = 33 # 33 cycles for one second, is 30ms call cycle
|
||||||
CONNMGR_TIMER_MAX = (5*33) # 5 seconds until an OkReport is forgotten.
|
CONNMGR_TIMER_MAX = (5*33) # 5 seconds until an OkReport is forgotten.
|
||||||
CONNMGR_TIMER_MAX_10s = (10*33) # 10 seconds until an OkReport is forgotten.
|
CONNMGR_TIMER_MAX_10s = (10*33) # 10 seconds until an OkReport is forgotten.
|
||||||
CONNMGR_TIMER_MAX_15s = (15*33) # 15 seconds until an OkReport is forgotten.
|
CONNMGR_TIMER_MAX_15s = (15*33) # 15 seconds until an OkReport is forgotten.
|
||||||
|
CONNMGR_TIMER_MAX_20s = (20*33) # 20 seconds until an OkReport is forgotten.
|
||||||
|
|
||||||
|
|
||||||
class connMgr():
|
class connMgr():
|
||||||
|
@ -126,7 +127,7 @@ class connMgr():
|
||||||
# The SetKey was sent to the local modem. This leads to restart of the
|
# The SetKey was sent to the local modem. This leads to restart of the
|
||||||
# local modem, and potenially also for the remote modem. If both modems are up,
|
# local modem, and potenially also for the remote modem. If both modems are up,
|
||||||
# they need additional time to pair. We need to be patient during this process. */
|
# they need additional time to pair. We need to be patient during this process. */
|
||||||
self.timerSlac = CONNMGR_TIMER_MAX_15s
|
self.timerSlac = CONNMGR_TIMER_MAX_20s
|
||||||
|
|
||||||
def SdpOk(self):
|
def SdpOk(self):
|
||||||
self.timerSDP = CONNMGR_TIMER_MAX
|
self.timerSDP = CONNMGR_TIMER_MAX
|
||||||
|
|
|
@ -985,8 +985,8 @@ class pyPlcHomeplug():
|
||||||
self.enterState(STATE_INITIAL)
|
self.enterState(STATE_INITIAL)
|
||||||
|
|
||||||
def runSdpStateMachine(self):
|
def runSdpStateMachine(self):
|
||||||
if (self.connMgr.getConnectionLevel()<20):
|
if (self.connMgr.getConnectionLevel()<15):
|
||||||
# We have no AVLN established. It does not make sense to start SDP.
|
# We have no AVLN established and SLAC not ongoing. It does not make sense to start SDP.
|
||||||
self.sdp_state = 0
|
self.sdp_state = 0
|
||||||
return
|
return
|
||||||
if (self.connMgr.getConnectionLevel()>20):
|
if (self.connMgr.getConnectionLevel()>20):
|
||||||
|
|
Loading…
Reference in a new issue