diff --git a/doc/todo.md b/doc/todo.md index f5c6645..2e2b48a 100644 --- a/doc/todo.md +++ b/doc/todo.md @@ -32,4 +32,5 @@ - [ ] configurable serial interface and baud rate - [ ] add plausibilization between EVSEPresentVoltage and physicalVoltage before closing contactors (configurable) - [ ] find out how a normal end of charging session works (Stopped on charger, stopped on car) +- [ ] PevMode: Evaluate the error code reported by the charger, and enter into state stateUnrecoverableError. - [ ] (and some more) diff --git a/fsmPev.py b/fsmPev.py index 3ca4b57..828630c 100644 --- a/fsmPev.py +++ b/fsmPev.py @@ -30,6 +30,7 @@ stateWaitForCurrentDemandResponse = 13 stateWaitForWeldingDetectionResponse = 14 stateWaitForSessionStopResponse = 15 stateChargingFinished = 16 +stateUnrecoverableError = 88 stateSequenceTimeout = 99 @@ -578,6 +579,11 @@ class fsmPev(): # lower layers SLAC, SDP, together with the connection manager. Nothing to do here. self.publishStatus("ERROR Timeout") + def stateFunctionUnrecoverableError(self): + # Here we end, if the EVSE reported an error code, which terminates the charging session. + # This is an end of the PEV state machine. The re-init is performed by the lower layers. Nothing more to do here. + self.publishStatus("ERROR reported") + stateFunctions = { stateNotYetInitialized: stateFunctionNotYetInitialized, stateConnecting: stateFunctionConnecting, @@ -596,6 +602,7 @@ class fsmPev(): stateWaitForWeldingDetectionResponse: stateFunctionWaitForWeldingDetectionResponse, stateWaitForSessionStopResponse: stateFunctionWaitForSessionStopResponse, stateChargingFinished: stateFunctionChargingFinished, + stateUnrecoverableError: stateFunctionUnrecoverableError, stateSequenceTimeout: stateFunctionSequenceTimeout }