mirror of
https://github.com/uhi22/pyPLC.git
synced 2024-11-10 01:05:42 +00:00
fixed crash in EVSE. Added instance prefix in the logging.
This commit is contained in:
parent
43d96f333e
commit
52538e759e
3 changed files with 4 additions and 4 deletions
|
@ -21,7 +21,7 @@ stateWaitForPowerDeliveryRequest = 8
|
|||
|
||||
class fsmEvse():
|
||||
def addToTrace(self, s):
|
||||
self.callbackAddToTrace(s)
|
||||
self.callbackAddToTrace("[EVSE] " + s)
|
||||
|
||||
def enterState(self, n):
|
||||
self.addToTrace("from " + str(self.state) + " entering " + str(n))
|
||||
|
@ -184,7 +184,7 @@ class fsmEvse():
|
|||
def __init__(self, callbackAddToTrace):
|
||||
self.callbackAddToTrace = callbackAddToTrace
|
||||
self.addToTrace("initializing fsmEvse")
|
||||
self.Tcp = pyPlcTcpSocket.pyPlcTcpServerSocket()
|
||||
self.Tcp = pyPlcTcpSocket.pyPlcTcpServerSocket(self.callbackAddToTrace)
|
||||
self.state = 0
|
||||
self.cyclesInState = 0
|
||||
self.rxData = []
|
||||
|
|
|
@ -27,7 +27,7 @@ dinEVSEProcessingType_Ongoing = "1"
|
|||
|
||||
class fsmPev():
|
||||
def addToTrace(self, s):
|
||||
self.callbackAddToTrace(s)
|
||||
self.callbackAddToTrace("[PEV] " + s)
|
||||
|
||||
def enterState(self, n):
|
||||
print("from " + str(self.state) + " entering " + str(n))
|
||||
|
|
|
@ -192,7 +192,7 @@ class pyPlcTcpServerSocket():
|
|||
client_socket, address = self.ourSocket.accept()
|
||||
# and we append this new socket to the list of sockets, which in the next loop will be handled by the select.
|
||||
self.read_list.append(client_socket)
|
||||
self.addToTrace("Connection from", address)
|
||||
self.addToTrace("Connection from " + str(address))
|
||||
else:
|
||||
# It is not the "listener socket", it is an above created "client socket" for talking with a client.
|
||||
# Let's take the data from it:
|
||||
|
|
Loading…
Reference in a new issue