From 7839bb335dea18600afa26a473b8b6740b22e29f Mon Sep 17 00:00:00 2001 From: uhi22 Date: Sun, 20 Nov 2022 19:48:52 +0100 Subject: [PATCH] endless PreCharge for testing --- fsmPev.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fsmPev.py b/fsmPev.py index 9fce896..e4fd8ef 100644 --- a/fsmPev.py +++ b/fsmPev.py @@ -167,6 +167,9 @@ class fsmPev(): self.enterState(0) def stateFunctionWaitForPreChargeResponse(self): + if (self.DelayCycles>0): + self.DelayCycles-=1 + return if (len(self.rxData)>0): print("In state WaitForPreChargeResponse, received " + prettyHexMessage(self.rxData)) exidata = removeV2GTPHeader(self.rxData) @@ -176,7 +179,11 @@ class fsmPev(): if (strConverterResult.find("PreChargeRes")>0): # todo: check the request content, and fill response parameters print("PreCharge aknowledge received.") - print("As Demo, we stay in PreCharge until the timeout elapses.") + print("As Demo, we stay in PreCharge forever.") + msg = addV2GTPHeader(exiEncode("EDG_"+self.sessionId)) # EDG for Encode, Din, PreCharge + print("responding " + prettyHexMessage(msg)) + self.Tcp.transmit(msg) + self.DelayCycles=15 # wait with the next evaluation approx half a second if (self.isTooLong()): self.enterState(0) @@ -216,6 +223,7 @@ class fsmPev(): self.state = stateNotYetInitialized self.sessionId = "DEAD55AADEAD55AA" self.cyclesInState = 0 + self.DelayCycles = 0 self.rxData = [] # we do NOT call the reInit, because we want to wait with the connection until external trigger comes