mirror of
https://github.com/uhi22/pyPLC.git
synced 2024-11-10 01:05:42 +00:00
fix: use the EVCCID in SessionSetupReq
This commit is contained in:
parent
0980ced46b
commit
9b39bff85a
5 changed files with 18 additions and 4 deletions
|
@ -181,6 +181,13 @@ class addressManager():
|
|||
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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -294,7 +294,7 @@ if __name__ == "__main__":
|
|||
if (False):
|
||||
testTimeConsumption()
|
||||
exit()
|
||||
if (True):
|
||||
if (False):
|
||||
testReadExiFromExiLogFile()
|
||||
exit()
|
||||
|
||||
|
@ -318,9 +318,10 @@ if __name__ == "__main__":
|
|||
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")
|
||||
|
@ -331,7 +332,7 @@ if __name__ == "__main__":
|
|||
|
||||
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")
|
||||
|
||||
|
|
|
@ -141,7 +141,8 @@ class fsmPev():
|
|||
# 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)
|
||||
|
@ -537,6 +538,7 @@ class fsmPev():
|
|||
self.hardwareInterface = hardwareInterface
|
||||
self.state = stateNotYetInitialized
|
||||
self.sessionId = "DEAD55AADEAD55AA"
|
||||
self.evccid = addressManager.getLocalMacAsTwelfCharString()
|
||||
self.cyclesInState = 0
|
||||
self.DelayCycles = 0
|
||||
self.rxData = []
|
||||
|
|
|
@ -10,6 +10,8 @@ class udplog():
|
|||
|
||||
|
||||
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"
|
||||
|
|
Loading…
Reference in a new issue