fix: use the EVCCID in SessionSetupReq

This commit is contained in:
uhi22 2023-03-23 08:50:53 +01:00
parent 0980ced46b
commit 9b39bff85a
5 changed files with 18 additions and 4 deletions

View file

@ -181,6 +181,13 @@ class addressManager():
print("[addressManager] will give local MAC " + prettyMac(self.localMac)) print("[addressManager] will give local MAC " + prettyMac(self.localMac))
return self.localMac; return self.localMac;
def getLocalMacAsTwelfCharString(self):
# gives the own MAC as string of 12 hex characters, without : or spaces.
s = ""
for i in range(0, 6):
s = s + twoCharHex(self.localMac[i])
return s
def getLinkLocalIpv6Address(self, resulttype="string"): def getLinkLocalIpv6Address(self, resulttype="string"):
if (resulttype=="string"): if (resulttype=="string"):
return self.localIpv6Address; return self.localIpv6Address;

View file

@ -26,4 +26,6 @@
- [ ] in addressManager, replace the print by addToTrace - [ ] in addressManager, replace the print by addToTrace
- [ ] Resolve the todo-markers in the code - [ ] Resolve the todo-markers in the code
- [ ] Still fixed addresses (MAC, IP) used somewhere? - [ ] Still fixed addresses (MAC, IP) used somewhere?
- [ ] configurable interface name and simplify address determination (see https://openinverter.org/forum/viewtopic.php?p=54659#p54659)
- [x] in the SessionSetupRequest we need to set the EVCCID with the MAC of the car. At the moment this is not implemented, need to update in the OpenV2Gx the function encodeSessionSetupRequest(), also the fsmPev.py, and provide the MAC as command line parameter from the python to the OpenV2Gx. (see https://openinverter.org/forum/viewtopic.php?p=54667#p54667)
- [ ] (and much more) - [ ] (and much more)

View file

@ -294,7 +294,7 @@ if __name__ == "__main__":
if (False): if (False):
testTimeConsumption() testTimeConsumption()
exit() exit()
if (True): if (False):
testReadExiFromExiLogFile() testReadExiFromExiLogFile()
exit() exit()
@ -318,9 +318,10 @@ if __name__ == "__main__":
if (False): if (False):
print("The request from the Ioniq after the EVSE sent ServicePaymentSelectionRes:") print("The request from the Ioniq after the EVSE sent ServicePaymentSelectionRes:")
testDecoder("809A00113020000A00000000", pre="DD", comment="PowerDeliveryReq") testDecoder("809A00113020000A00000000", pre="DD", comment="PowerDeliveryReq")
if (False): if (True):
print("The session setup request of the Ioniq:") print("The session setup request of the Ioniq:")
testDecoder("809A02000000000000000011D01811959401930C00", pre="DD", comment="SessionSetupReq") testDecoder("809A02000000000000000011D01811959401930C00", pre="DD", comment="SessionSetupReq")
if (False):
testDecoder("80 9A 02 00 40 80 C1 01 41 81 C2 11 E0 00 00 80", pre="DD", comment="SessionSetupRes") testDecoder("80 9A 02 00 40 80 C1 01 41 81 C2 11 E0 00 00 80", pre="DD", comment="SessionSetupRes")
testDecoder("80 9A 02 00 40 80 C1 01 41 81 C2 11 94 00", pre="DD", comment="ServiceDiscoveryReq") testDecoder("80 9A 02 00 40 80 C1 01 41 81 C2 11 94 00", pre="DD", comment="ServiceDiscoveryReq")
testDecoder("80 9A 02 00 40 80 C1 01 41 81 C2 11 A0 01 20 02 41 00 84", pre="DD", comment="ServiceDiscoveryRes") testDecoder("80 9A 02 00 40 80 C1 01 41 81 C2 11 A0 01 20 02 41 00 84", pre="DD", comment="ServiceDiscoveryRes")
@ -331,7 +332,7 @@ if __name__ == "__main__":
print("The request of the Ioniq after ServicePaymentSelectionResponse") print("The request of the Ioniq after ServicePaymentSelectionResponse")
testDecoder("80 9A 02 00 40 80 C1 01 41 81 C2 10 B8", pre="DD", comment="ContractAuthenticationReq") testDecoder("80 9A 02 00 40 80 C1 01 41 81 C2 10 B8", pre="DD", comment="ContractAuthenticationReq")
if (True): if (False):
print("The response of the Alpi chargeParameterDiscovery") print("The response of the Alpi chargeParameterDiscovery")
testDecoder("80 9A 02 00 00 00 00 03 1F DC 8B D0 80 02 00 00 00 00 00 10 00 2A 80 04 00 00 14 0C 00 40 80 E1 8A 3A 0A 0A 00 A0 60 60 00 08 0A 01 E2 30 30 06 10", pre="DD", comment="ChargeParameterDiscoveryRes") testDecoder("80 9A 02 00 00 00 00 03 1F DC 8B D0 80 02 00 00 00 00 00 10 00 2A 80 04 00 00 14 0C 00 40 80 E1 8A 3A 0A 0A 00 A0 60 60 00 08 0A 01 E2 30 30 06 10", pre="DD", comment="ChargeParameterDiscoveryRes")

View file

@ -141,7 +141,8 @@ class fsmPev():
# todo: check the request content, and fill response parameters # todo: check the request content, and fill response parameters
self.publishStatus("Schema negotiated") self.publishStatus("Schema negotiated")
self.addToTrace("Checkpoint403: Schema negotiated. And Checkpoint500: Will send SessionSetupReq") self.addToTrace("Checkpoint403: Schema negotiated. And Checkpoint500: Will send SessionSetupReq")
msg = addV2GTPHeader(self.exiEncode("EDA")) # EDA for Encode, Din, SessionSetupReq self.addToTrace("EDA_"+self.evccid)
msg = addV2GTPHeader(self.exiEncode("EDA_"+self.evccid)) # EDA for Encode, Din, SessionSetupReq
self.addToTrace("responding " + prettyHexMessage(msg)) self.addToTrace("responding " + prettyHexMessage(msg))
self.Tcp.transmit(msg) self.Tcp.transmit(msg)
self.enterState(stateWaitForSessionSetupResponse) self.enterState(stateWaitForSessionSetupResponse)
@ -537,6 +538,7 @@ class fsmPev():
self.hardwareInterface = hardwareInterface self.hardwareInterface = hardwareInterface
self.state = stateNotYetInitialized self.state = stateNotYetInitialized
self.sessionId = "DEAD55AADEAD55AA" self.sessionId = "DEAD55AADEAD55AA"
self.evccid = addressManager.getLocalMacAsTwelfCharString()
self.cyclesInState = 0 self.cyclesInState = 0
self.DelayCycles = 0 self.DelayCycles = 0
self.rxData = [] self.rxData = []

View file

@ -10,6 +10,8 @@ class udplog():
def log(self, s): def log(self, s):
# return # activate this line to disable the logging completely
#
# The frame format follows the Syslog protocol, https://en.wikipedia.org/wiki/Syslog # The frame format follows the Syslog protocol, https://en.wikipedia.org/wiki/Syslog
# Level consists of # Level consists of
# Facility = 1 = "user" # Facility = 1 = "user"