Skip to content

Commit d008b89

Browse files
committed
Merge ocpp-1.6-impl into master
resolved conflicts: views/op15/UpdateFirmware.jsp
2 parents 5c17e03 + 879dad3 commit d008b89

143 files changed

Lines changed: 6043 additions & 1423 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ SteVe is considered as an open platform to implement, test and evaluate novel id
1515
Electric charge points using the following OCPP versions are supported:
1616

1717
* OCPP1.2S
18-
* OCPP1.5S
1918
* OCPP1.2J
19+
* OCPP1.5S
2020
* OCPP1.5J
21+
* OCPP1.6S <sup>[1]</sup>
22+
* OCPP1.6J <sup>[1]</sup>
2123

2224
We have successfully tested SteVe with charge points manufactured by EBG and Mennekes. If your charge point also works well with SteVe, please let us know! We will update the list.
2325

26+
[1]: All profiles with the exception of "Smart Charging" are implemented: Core, Firmware Management, Local Auth List Management, Reservation and Remote Trigger profiles
27+
2428
### System Requirements
2529

2630
SteVe requires

src/main/java/de/rwth/idsg/steve/config/OcppConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public class OcppConfiguration {
4141

4242
@Autowired private ocpp.cs._2010._08.CentralSystemService ocpp12Server;
4343
@Autowired private ocpp.cs._2012._06.CentralSystemService ocpp15Server;
44+
@Autowired private ocpp.cs._2015._10.CentralSystemService ocpp16Server;
4445

4546
@Autowired
4647
@Qualifier("FromAddressInterceptor")
@@ -56,6 +57,7 @@ public void init() {
5657

5758
createOcppService(ocpp12Server, "/CentralSystemServiceOCPP12", interceptors);
5859
createOcppService(ocpp15Server, "/CentralSystemServiceOCPP15", interceptors);
60+
createOcppService(ocpp16Server, "/CentralSystemServiceOCPP16", interceptors);
5961
}
6062

6163
/**

src/main/java/de/rwth/idsg/steve/config/WebSocketConfiguration.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import de.rwth.idsg.steve.ocpp.ws.OcppWebSocketUpgrader;
66
import de.rwth.idsg.steve.ocpp.ws.ocpp12.Ocpp12WebSocketEndpoint;
77
import de.rwth.idsg.steve.ocpp.ws.ocpp15.Ocpp15WebSocketEndpoint;
8+
import de.rwth.idsg.steve.ocpp.ws.ocpp16.Ocpp16WebSocketEndpoint;
89
import de.rwth.idsg.steve.repository.ChargePointRepository;
910
import de.rwth.idsg.steve.service.NotificationService;
1011
import lombok.extern.slf4j.Slf4j;
@@ -38,6 +39,7 @@ public class WebSocketConfiguration implements WebSocketConfigurer {
3839

3940
@Autowired private Ocpp12WebSocketEndpoint ocpp12WebSocketEndpoint;
4041
@Autowired private Ocpp15WebSocketEndpoint ocpp15WebSocketEndpoint;
42+
@Autowired private Ocpp16WebSocketEndpoint ocpp16WebSocketEndpoint;
4143

4244
public static final long PING_INTERVAL = TimeUnit.MINUTES.toMinutes(15);
4345
private static final long IDLE_TIMEOUT = TimeUnit.HOURS.toMillis(2);
@@ -69,7 +71,7 @@ public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
6971
* The order affects the choice!
7072
*/
7173
private List<AbstractWebSocketEndpoint> getEndpoints() {
72-
return Lists.newArrayList(ocpp15WebSocketEndpoint, ocpp12WebSocketEndpoint);
74+
return Lists.newArrayList(ocpp16WebSocketEndpoint, ocpp15WebSocketEndpoint, ocpp12WebSocketEndpoint);
7375
}
7476

7577
// -------------------------------------------------------------------------
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package de.rwth.idsg.steve.ocpp;
2+
3+
import de.rwth.idsg.steve.ocpp.task.ClearChargingProfileTask;
4+
import de.rwth.idsg.steve.ocpp.task.GetCompositeScheduleTask;
5+
import de.rwth.idsg.steve.ocpp.task.SetChargingProfileTask;
6+
import de.rwth.idsg.steve.ocpp.task.TriggerMessageTask;
7+
import de.rwth.idsg.steve.repository.dto.ChargePointSelect;
8+
9+
/**
10+
* @author Sevket Goekay <goekay@dbis.rwth-aachen.de>
11+
* @since 13.03.2018
12+
*/
13+
public interface ChargePointService16_Invoker extends ChargePointService15_Invoker {
14+
15+
void clearChargingProfile(ChargePointSelect cp, ClearChargingProfileTask task);
16+
17+
void setChargingProfile(ChargePointSelect cp, SetChargingProfileTask task);
18+
19+
void getCompositeSchedule(ChargePointSelect cp, GetCompositeScheduleTask task);
20+
21+
void triggerMessage(ChargePointSelect cp, TriggerMessageTask task);
22+
23+
}
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
package de.rwth.idsg.steve.ocpp;
2+
3+
import de.rwth.idsg.steve.ocpp.soap.ClientProvider;
4+
import de.rwth.idsg.steve.ocpp.task.CancelReservationTask;
5+
import de.rwth.idsg.steve.ocpp.task.ChangeAvailabilityTask;
6+
import de.rwth.idsg.steve.ocpp.task.ChangeConfigurationTask;
7+
import de.rwth.idsg.steve.ocpp.task.ClearCacheTask;
8+
import de.rwth.idsg.steve.ocpp.task.ClearChargingProfileTask;
9+
import de.rwth.idsg.steve.ocpp.task.DataTransferTask;
10+
import de.rwth.idsg.steve.ocpp.task.GetCompositeScheduleTask;
11+
import de.rwth.idsg.steve.ocpp.task.GetConfigurationTask;
12+
import de.rwth.idsg.steve.ocpp.task.GetDiagnosticsTask;
13+
import de.rwth.idsg.steve.ocpp.task.GetLocalListVersionTask;
14+
import de.rwth.idsg.steve.ocpp.task.RemoteStartTransactionTask;
15+
import de.rwth.idsg.steve.ocpp.task.RemoteStopTransactionTask;
16+
import de.rwth.idsg.steve.ocpp.task.ReserveNowTask;
17+
import de.rwth.idsg.steve.ocpp.task.ResetTask;
18+
import de.rwth.idsg.steve.ocpp.task.SendLocalListTask;
19+
import de.rwth.idsg.steve.ocpp.task.SetChargingProfileTask;
20+
import de.rwth.idsg.steve.ocpp.task.TriggerMessageTask;
21+
import de.rwth.idsg.steve.ocpp.task.UnlockConnectorTask;
22+
import de.rwth.idsg.steve.ocpp.task.UpdateFirmwareTask;
23+
import de.rwth.idsg.steve.ocpp.ws.AbstractChargePointServiceInvoker;
24+
import de.rwth.idsg.steve.ocpp.ws.ocpp16.Ocpp16TypeStore;
25+
import de.rwth.idsg.steve.ocpp.ws.ocpp16.Ocpp16WebSocketEndpoint;
26+
import de.rwth.idsg.steve.ocpp.ws.pipeline.OutgoingCallPipeline;
27+
import de.rwth.idsg.steve.repository.dto.ChargePointSelect;
28+
import ocpp.cp._2015._10.ChargePointService;
29+
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
30+
import org.springframework.stereotype.Service;
31+
32+
/**
33+
* @author Sevket Goekay <goekay@dbis.rwth-aachen.de>
34+
* @since 13.03.2018
35+
*/
36+
@Service
37+
public class ChargePointService16_InvokerImpl
38+
extends AbstractChargePointServiceInvoker
39+
implements ChargePointService16_Invoker {
40+
41+
public ChargePointService16_InvokerImpl(OutgoingCallPipeline pipeline, Ocpp16WebSocketEndpoint endpoint) {
42+
super(pipeline, endpoint, Ocpp16TypeStore.INSTANCE);
43+
}
44+
45+
@Override
46+
public void clearChargingProfile(ChargePointSelect cp, ClearChargingProfileTask task) {
47+
// TODO
48+
throw new RuntimeException("Not implemented");
49+
}
50+
51+
@Override
52+
public void setChargingProfile(ChargePointSelect cp, SetChargingProfileTask task) {
53+
// TODO
54+
throw new RuntimeException("Not implemented");
55+
}
56+
57+
@Override
58+
public void getCompositeSchedule(ChargePointSelect cp, GetCompositeScheduleTask task) {
59+
// TODO
60+
throw new RuntimeException("Not implemented");
61+
}
62+
63+
@Override
64+
public void triggerMessage(ChargePointSelect cp, TriggerMessageTask task) {
65+
if (cp.isSoap()) {
66+
create(cp).triggerMessageAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
67+
} else {
68+
runPipeline(cp, task);
69+
}
70+
}
71+
72+
@Override
73+
public void reset(ChargePointSelect cp, ResetTask task) {
74+
if (cp.isSoap()) {
75+
create(cp).resetAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
76+
} else {
77+
runPipeline(cp, task);
78+
}
79+
}
80+
81+
@Override
82+
public void clearCache(ChargePointSelect cp, ClearCacheTask task) {
83+
if (cp.isSoap()) {
84+
create(cp).clearCacheAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
85+
} else {
86+
runPipeline(cp, task);
87+
}
88+
}
89+
90+
@Override
91+
public void getDiagnostics(ChargePointSelect cp, GetDiagnosticsTask task) {
92+
if (cp.isSoap()) {
93+
create(cp).getDiagnosticsAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
94+
} else {
95+
runPipeline(cp, task);
96+
}
97+
}
98+
99+
@Override
100+
public void updateFirmware(ChargePointSelect cp, UpdateFirmwareTask task) {
101+
if (cp.isSoap()) {
102+
create(cp).updateFirmwareAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
103+
} else {
104+
runPipeline(cp, task);
105+
}
106+
}
107+
108+
@Override
109+
public void unlockConnector(ChargePointSelect cp, UnlockConnectorTask task) {
110+
if (cp.isSoap()) {
111+
create(cp).unlockConnectorAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
112+
113+
} else {
114+
runPipeline(cp, task);
115+
}
116+
}
117+
118+
@Override
119+
public void changeAvailability(ChargePointSelect cp, ChangeAvailabilityTask task) {
120+
if (cp.isSoap()) {
121+
create(cp).changeAvailabilityAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
122+
} else {
123+
runPipeline(cp, task);
124+
}
125+
}
126+
127+
@Override
128+
public void changeConfiguration(ChargePointSelect cp, ChangeConfigurationTask task) {
129+
if (cp.isSoap()) {
130+
create(cp).changeConfigurationAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
131+
} else {
132+
runPipeline(cp, task);
133+
}
134+
}
135+
136+
@Override
137+
public void remoteStartTransaction(ChargePointSelect cp, RemoteStartTransactionTask task) {
138+
if (cp.isSoap()) {
139+
create(cp).remoteStartTransactionAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
140+
} else {
141+
runPipeline(cp, task);
142+
}
143+
}
144+
145+
@Override
146+
public void remoteStopTransaction(ChargePointSelect cp, RemoteStopTransactionTask task) {
147+
if (cp.isSoap()) {
148+
create(cp).remoteStopTransactionAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
149+
} else {
150+
runPipeline(cp, task);
151+
}
152+
}
153+
154+
@Override
155+
public void dataTransfer(ChargePointSelect cp, DataTransferTask task) {
156+
if (cp.isSoap()) {
157+
create(cp).dataTransferAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
158+
} else {
159+
runPipeline(cp, task);
160+
}
161+
}
162+
163+
@Override
164+
public void getConfiguration(ChargePointSelect cp, GetConfigurationTask task) {
165+
if (cp.isSoap()) {
166+
create(cp).getConfigurationAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
167+
} else {
168+
runPipeline(cp, task);
169+
}
170+
}
171+
172+
@Override
173+
public void getLocalListVersion(ChargePointSelect cp, GetLocalListVersionTask task) {
174+
if (cp.isSoap()) {
175+
create(cp).getLocalListVersionAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
176+
} else {
177+
runPipeline(cp, task);
178+
}
179+
}
180+
181+
@Override
182+
public void sendLocalList(ChargePointSelect cp, SendLocalListTask task) {
183+
if (cp.isSoap()) {
184+
create(cp).sendLocalListAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
185+
} else {
186+
runPipeline(cp, task);
187+
}
188+
}
189+
190+
@Override
191+
public void reserveNow(ChargePointSelect cp, ReserveNowTask task) {
192+
if (cp.isSoap()) {
193+
create(cp).reserveNowAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
194+
} else {
195+
runPipeline(cp, task);
196+
}
197+
}
198+
199+
@Override
200+
public void cancelReservation(ChargePointSelect cp, CancelReservationTask task) {
201+
if (cp.isSoap()) {
202+
create(cp).cancelReservationAsync(task.getOcpp16Request(), cp.getChargeBoxId(), task.getOcpp16Handler(cp.getChargeBoxId()));
203+
} else {
204+
runPipeline(cp, task);
205+
}
206+
}
207+
208+
private static ChargePointService create(ChargePointSelect cp) {
209+
JaxWsProxyFactoryBean f = ClientProvider.getBean(cp.getEndpointAddress());
210+
f.setServiceClass(ChargePointService.class);
211+
return (ChargePointService) f.create();
212+
}
213+
}

src/main/java/de/rwth/idsg/steve/ocpp/CommunicationTask.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ public CommunicationTask(OcppVersion ocppVersion, S params) {
7373
}
7474

7575
callbackList.add(defaultCallback());
76-
77-
// FIXME: dirty, because creating a request only to parse its class name
78-
operationName = StringUtils.getOperationName(getRequest());
76+
operationName = StringUtils.getOperationName(this);
7977
}
8078

8179
public void addCallback(OcppCallback<RESPONSE> cb) {
@@ -132,6 +130,7 @@ public RequestType getRequest() {
132130
switch (ocppVersion) {
133131
case V_12: return getOcpp12Request();
134132
case V_15: return getOcpp15Request();
133+
case V_16: return getOcpp16Request();
135134
default: throw new RuntimeException("Request type not found");
136135
}
137136
}
@@ -140,6 +139,7 @@ public <T extends ResponseType> AsyncHandler<T> getHandler(String chargeBoxId) {
140139
switch (ocppVersion) {
141140
case V_12: return getOcpp12Handler(chargeBoxId);
142141
case V_15: return getOcpp15Handler(chargeBoxId);
142+
case V_16: return getOcpp16Handler(chargeBoxId);
143143
default: throw new RuntimeException("ResponseType handler not found");
144144
}
145145
}
@@ -150,10 +150,14 @@ public <T extends ResponseType> AsyncHandler<T> getHandler(String chargeBoxId) {
150150

151151
public abstract <T extends RequestType> T getOcpp15Request();
152152

153+
public abstract <T extends RequestType> T getOcpp16Request();
154+
153155
public abstract <T extends ResponseType> AsyncHandler<T> getOcpp12Handler(String chargeBoxId);
154156

155157
public abstract <T extends ResponseType> AsyncHandler<T> getOcpp15Handler(String chargeBoxId);
156158

159+
public abstract <T extends ResponseType> AsyncHandler<T> getOcpp16Handler(String chargeBoxId);
160+
157161
// -------------------------------------------------------------------------
158162
// Classes
159163
// -------------------------------------------------------------------------

src/main/java/de/rwth/idsg/steve/ocpp/OcppProtocol.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ public enum OcppProtocol {
1414
V_12_JSON(OcppVersion.V_12, OcppTransport.JSON),
1515

1616
V_15_SOAP(OcppVersion.V_15, OcppTransport.SOAP),
17-
V_15_JSON(OcppVersion.V_15, OcppTransport.JSON);
17+
V_15_JSON(OcppVersion.V_15, OcppTransport.JSON),
18+
19+
V_16_SOAP(OcppVersion.V_16, OcppTransport.SOAP),
20+
V_16_JSON(OcppVersion.V_16, OcppTransport.JSON);
1821

1922
private final OcppVersion version;
2023
private final OcppTransport transport;

src/main/java/de/rwth/idsg/steve/ocpp/OcppVersion.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
@Getter
1414
public enum OcppVersion {
1515
V_12("ocpp1.2"),
16-
V_15("ocpp1.5");
16+
V_15("ocpp1.5"),
17+
V_16("ocpp1.6");
1718

1819
private final String value;
1920

0 commit comments

Comments
 (0)