Skip to content

Commit

Permalink
fix: use the EVCCID in SessionSetupReq
Browse files Browse the repository at this point in the history
  • Loading branch information
uhi22 committed Mar 23, 2023
1 parent 0980ced commit 9b39bff
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
7 changes: 7 additions & 0 deletions addressManager.py
Expand Up @@ -181,6 +181,13 @@ def getLocalMacAddress(self):
print("[addressManager] will give local MAC " + prettyMac(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"):
if (resulttype=="string"):
return self.localIpv6Address;
Expand Down
2 changes: 2 additions & 0 deletions doc/todo.md
Expand Up @@ -26,4 +26,6 @@
- [ ] in addressManager, replace the print by addToTrace
- [ ] Resolve the todo-markers in the code
- [ ] 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)
7 changes: 4 additions & 3 deletions exiConnector.py
Expand Up @@ -294,7 +294,7 @@ def testTimeConsumption():
if (False):
testTimeConsumption()
exit()
if (True):
if (False):
testReadExiFromExiLogFile()
exit()

Expand All @@ -318,9 +318,10 @@ def testTimeConsumption():
if (False):
print("The request from the Ioniq after the EVSE sent ServicePaymentSelectionRes:")
testDecoder("809A00113020000A00000000", pre="DD", comment="PowerDeliveryReq")
if (False):
if (True):
print("The session setup request of the Ioniq:")
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 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")
Expand All @@ -331,7 +332,7 @@ def testTimeConsumption():

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")
if (True):
if (False):
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")

Expand Down
4 changes: 3 additions & 1 deletion fsmPev.py
Expand Up @@ -141,7 +141,8 @@ def stateFunctionWaitForSupportedApplicationProtocolResponse(self):
# todo: check the request content, and fill response parameters
self.publishStatus("Schema negotiated")
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.Tcp.transmit(msg)
self.enterState(stateWaitForSessionSetupResponse)
Expand Down Expand Up @@ -537,6 +538,7 @@ def __init__(self, addressManager, callbackAddToTrace, hardwareInterface, callba
self.hardwareInterface = hardwareInterface
self.state = stateNotYetInitialized
self.sessionId = "DEAD55AADEAD55AA"
self.evccid = addressManager.getLocalMacAsTwelfCharString()
self.cyclesInState = 0
self.DelayCycles = 0
self.rxData = []
Expand Down
2 changes: 2 additions & 0 deletions udplog.py
Expand Up @@ -10,6 +10,8 @@ def fillMac(self, macbytearray, position=6): # position 6 is the source MAC


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
# Level consists of
# Facility = 1 = "user"
Expand Down

0 comments on commit 9b39bff

Please sign in to comment.