Skip to content

Commit 07bdb07

Browse files
committed
always accept a start transaction regardless of idTag status
until now a transaction request was only processed when the idTag was "Accepted" according to database. but this can cause some problems with the behavior of various charging stations. therefore, we relax the constraints and expect the charging station to act on the contents of sent idTagInfo
1 parent 621d195 commit 07bdb07

File tree

3 files changed

+19
-31
lines changed

3 files changed

+19
-31
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>de.rwth.idsg</groupId>
55
<artifactId>steve</artifactId>
6-
<version>1.0.10</version>
6+
<version>1.0.11</version>
77
<packaging>jar</packaging>
88

99
<developers>

src/main/java/de/rwth/idsg/steve/service/CentralSystemService12_Service.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,23 +99,17 @@ public DiagnosticsStatusNotificationResponse diagnosticsStatusNotification(Diagn
9999
public StartTransactionResponse startTransaction(StartTransactionRequest parameters, String chargeBoxIdentity) {
100100
log.debug("Executing startTransaction for {}", chargeBoxIdentity);
101101

102-
// Get the authorization info of the user
103102
String idTag = parameters.getIdTag();
104-
IdTagInfo idTagInfo = userService.getIdTagInfoV12(idTag);
105-
106-
StartTransactionResponse response = new StartTransactionResponse().withIdTagInfo(idTagInfo);
107-
108-
if (AuthorizationStatus.ACCEPTED.equals(idTagInfo.getStatus())) {
109-
int connectorId = parameters.getConnectorId();
110-
Timestamp startTimestamp = new Timestamp(parameters.getTimestamp().getMillis());
111-
String startMeterValue = Integer.toString(parameters.getMeterStart());
103+
int connectorId = parameters.getConnectorId();
104+
Timestamp startTimestamp = new Timestamp(parameters.getTimestamp().getMillis());
105+
String startMeterValue = Integer.toString(parameters.getMeterStart());
112106

113-
Integer transactionId = ocppServerRepository.insertTransaction12(chargeBoxIdentity,connectorId, idTag,
114-
startTimestamp, startMeterValue);
107+
Integer transactionId = ocppServerRepository.insertTransaction12(chargeBoxIdentity, connectorId, idTag,
108+
startTimestamp, startMeterValue);
115109

116-
response.setTransactionId(transactionId);
117-
}
118-
return response;
110+
return new StartTransactionResponse()
111+
.withIdTagInfo(userService.getIdTagInfoV12(idTag))
112+
.withTransactionId(transactionId);
119113
}
120114

121115
public StopTransactionResponse stopTransaction(StopTransactionRequest parameters, String chargeBoxIdentity) {

src/main/java/de/rwth/idsg/steve/service/CentralSystemService15_Service.java

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,19 @@ public DiagnosticsStatusNotificationResponse diagnosticsStatusNotification(Diagn
112112
public StartTransactionResponse startTransaction(StartTransactionRequest parameters, String chargeBoxIdentity) {
113113
log.debug("Executing startTransaction for {}", chargeBoxIdentity);
114114

115-
// Get the authorization info of the user
116115
String idTag = parameters.getIdTag();
117-
IdTagInfo idTagInfo = userService.getIdTagInfoV15(idTag);
118-
119-
StartTransactionResponse response = new StartTransactionResponse().withIdTagInfo(idTagInfo);
120-
121-
if (AuthorizationStatus.ACCEPTED.equals(idTagInfo.getStatus())) {
122-
int connectorId = parameters.getConnectorId();
123-
Integer reservationId = parameters.getReservationId();
124-
Timestamp startTimestamp = new Timestamp(parameters.getTimestamp().getMillis());
116+
int connectorId = parameters.getConnectorId();
117+
Integer reservationId = parameters.getReservationId();
118+
Timestamp startTimestamp = new Timestamp(parameters.getTimestamp().getMillis());
119+
String startMeterValue = Integer.toString(parameters.getMeterStart());
125120

126-
String startMeterValue = Integer.toString(parameters.getMeterStart());
127-
Integer transactionId = ocppServerRepository.insertTransaction15(chargeBoxIdentity, connectorId, idTag,
128-
startTimestamp, startMeterValue,
129-
reservationId);
121+
Integer transactionId = ocppServerRepository.insertTransaction15(chargeBoxIdentity, connectorId, idTag,
122+
startTimestamp, startMeterValue,
123+
reservationId);
130124

131-
response.setTransactionId(transactionId);
132-
}
133-
return response;
125+
return new StartTransactionResponse()
126+
.withIdTagInfo(userService.getIdTagInfoV15(idTag))
127+
.withTransactionId(transactionId);
134128
}
135129

136130
public StopTransactionResponse stopTransaction(StopTransactionRequest parameters, String chargeBoxIdentity) {

0 commit comments

Comments
 (0)