SwitchEV / RISE-V2G

The only fully-featured reference implementation of the Vehicle-2-Grid communication interface ISO 15118
MIT License
219 stars 92 forks source link

Don't set timeout for receiving a message before sending the first one. #62

Open rousku opened 3 years ago

rousku commented 3 years ago

RISE-V2G-EVCC/src/main/java/com/v2gclarity/risev2g/evcc/session/V2GCommunicationSessionHandlerEVCC.java

if (!startTransportLayerClient(seccDiscoveryRes, seccAddress)) return false;

setV2gCommunicationSessionEVCC(new V2GCommunicationSessionEVCC(getTransportLayerClient()));

/*
 * Tell the TCP- or TLSClient to notify if 
 * - a new V2GTPMessage has arrived
 * - a timeout has occurred while waiting for the respective response message
 */
getTransportLayerClient().addObserver(getV2gCommunicationSessionEVCC());

getV2gCommunicationSessionEVCC().addObserver(this);

// Set TLS security flag for communication session
boolean secureConn = (((Byte) getSecurity()).compareTo((Byte) GlobalValues.V2G_SECURITY_WITH_TLS.getByteValue()) == 0) ? true : false;
getV2gCommunicationSessionEVCC().setTlsConnection(secureConn);

sendSupportedAppProtocolReq();

The timeout for receiving a message in TCPClient/TCPClient can expire before SupportedAppProtocolReq is sent if the creation of an evController takes too long (in new V2GCommunicationSessionEVCC).