Commit | Line | Data |
---|---|---|
c8eeb62b JB |
1 | // Partial Copyright Jerome Benoit. 2021. All Rights Reserved. |
2 | ||
e7aeea18 | 3 | import { |
e7aeea18 | 4 | OCPP16AuthorizationStatus, |
ef6fa3fb | 5 | OCPP16AuthorizeRequest, |
e7aeea18 | 6 | OCPP16AuthorizeResponse, |
ef6fa3fb | 7 | OCPP16StartTransactionRequest, |
e7aeea18 | 8 | OCPP16StartTransactionResponse, |
ef6fa3fb | 9 | OCPP16StopTransactionRequest, |
e7aeea18 | 10 | OCPP16StopTransactionResponse, |
e7aeea18 JB |
11 | } from '../../../types/ocpp/1.6/Transaction'; |
12 | import { | |
ef6fa3fb JB |
13 | OCPP16BootNotificationRequest, |
14 | OCPP16HeartbeatRequest, | |
e7aeea18 | 15 | OCPP16RequestCommand, |
ef6fa3fb | 16 | OCPP16StatusNotificationRequest, |
e7aeea18 JB |
17 | } from '../../../types/ocpp/1.6/Requests'; |
18 | import { | |
e7aeea18 | 19 | OCPP16BootNotificationResponse, |
f22266fd | 20 | OCPP16HeartbeatResponse, |
e7aeea18 | 21 | OCPP16RegistrationStatus, |
f22266fd | 22 | OCPP16StatusNotificationResponse, |
e7aeea18 | 23 | } from '../../../types/ocpp/1.6/Responses'; |
ef6fa3fb JB |
24 | import { |
25 | OCPP16MeterValuesRequest, | |
26 | OCPP16MeterValuesResponse, | |
27 | } from '../../../types/ocpp/1.6/MeterValues'; | |
c0560973 | 28 | |
73b9adec | 29 | import type ChargingStation from '../../ChargingStation'; |
a4bc2942 | 30 | import { ErrorType } from '../../../types/ocpp/ErrorType'; |
d1888640 | 31 | import { JsonType } from '../../../types/JsonType'; |
93b4a429 | 32 | import { OCPP16ChargePointErrorCode } from '../../../types/ocpp/1.6/ChargePointErrorCode'; |
c0560973 | 33 | import { OCPP16ChargePointStatus } from '../../../types/ocpp/1.6/ChargePointStatus'; |
fd0c36fa | 34 | import { OCPP16ServiceUtils } from './OCPP16ServiceUtils'; |
c0560973 | 35 | import { OCPP16StandardParametersKey } from '../../../types/ocpp/1.6/Configuration'; |
e58068fd | 36 | import OCPPError from '../../../exception/OCPPError'; |
c0560973 | 37 | import OCPPResponseService from '../OCPPResponseService'; |
74c6a954 | 38 | import { ResponseHandler } from '../../../types/ocpp/Responses'; |
c0560973 | 39 | import Utils from '../../../utils/Utils'; |
9f2e3130 | 40 | import logger from '../../../utils/Logger'; |
c0560973 | 41 | |
909dcf2d JB |
42 | const moduleName = 'OCPP16ResponseService'; |
43 | ||
c0560973 | 44 | export default class OCPP16ResponseService extends OCPPResponseService { |
58144adb JB |
45 | private responseHandlers: Map<OCPP16RequestCommand, ResponseHandler>; |
46 | ||
9f2e3130 | 47 | public constructor(chargingStation: ChargingStation) { |
909dcf2d | 48 | if (new.target?.name === moduleName) { |
06127450 | 49 | throw new TypeError(`Cannot construct ${new.target?.name} instances directly`); |
9f2e3130 | 50 | } |
58144adb JB |
51 | super(chargingStation); |
52 | this.responseHandlers = new Map<OCPP16RequestCommand, ResponseHandler>([ | |
53 | [OCPP16RequestCommand.BOOT_NOTIFICATION, this.handleResponseBootNotification.bind(this)], | |
54 | [OCPP16RequestCommand.HEARTBEAT, this.handleResponseHeartbeat.bind(this)], | |
55 | [OCPP16RequestCommand.AUTHORIZE, this.handleResponseAuthorize.bind(this)], | |
56 | [OCPP16RequestCommand.START_TRANSACTION, this.handleResponseStartTransaction.bind(this)], | |
57 | [OCPP16RequestCommand.STOP_TRANSACTION, this.handleResponseStopTransaction.bind(this)], | |
58 | [OCPP16RequestCommand.STATUS_NOTIFICATION, this.handleResponseStatusNotification.bind(this)], | |
e7aeea18 | 59 | [OCPP16RequestCommand.METER_VALUES, this.handleResponseMeterValues.bind(this)], |
58144adb JB |
60 | ]); |
61 | } | |
62 | ||
e7aeea18 JB |
63 | public async handleResponse( |
64 | commandName: OCPP16RequestCommand, | |
65 | payload: JsonType | string, | |
66 | requestPayload: JsonType | |
67 | ): Promise<void> { | |
68 | if ( | |
69 | this.chargingStation.isRegistered() || | |
70 | commandName === OCPP16RequestCommand.BOOT_NOTIFICATION | |
71 | ) { | |
124f3553 JB |
72 | if (this.responseHandlers.has(commandName)) { |
73 | try { | |
74 | await this.responseHandlers.get(commandName)(payload, requestPayload); | |
75 | } catch (error) { | |
e7aeea18 JB |
76 | logger.error( |
77 | this.chargingStation.logPrefix() + ' Handle request response error: %j', | |
78 | error | |
79 | ); | |
124f3553 JB |
80 | throw error; |
81 | } | |
82 | } else { | |
83 | // Throw exception | |
e7aeea18 JB |
84 | throw new OCPPError( |
85 | ErrorType.NOT_IMPLEMENTED, | |
86 | `${commandName} is not implemented to handle request response payload ${JSON.stringify( | |
87 | payload, | |
88 | null, | |
89 | 2 | |
90 | )}`, | |
91 | commandName | |
92 | ); | |
887fef76 | 93 | } |
c0560973 | 94 | } else { |
e7aeea18 JB |
95 | throw new OCPPError( |
96 | ErrorType.SECURITY_ERROR, | |
97 | `${commandName} cannot be issued to handle request response payload ${JSON.stringify( | |
98 | payload, | |
99 | null, | |
100 | 2 | |
101 | )} while the charging station is not registered on the central server. `, | |
102 | commandName | |
103 | ); | |
c0560973 JB |
104 | } |
105 | } | |
106 | ||
624df199 | 107 | private handleResponseBootNotification(payload: OCPP16BootNotificationResponse): void { |
c0560973 | 108 | if (payload.status === OCPP16RegistrationStatus.ACCEPTED) { |
e7aeea18 JB |
109 | this.chargingStation.addConfigurationKey( |
110 | OCPP16StandardParametersKey.HeartBeatInterval, | |
a95873d8 JB |
111 | payload.interval.toString(), |
112 | {}, | |
113 | { overwrite: true, save: true } | |
e7aeea18 JB |
114 | ); |
115 | this.chargingStation.addConfigurationKey( | |
116 | OCPP16StandardParametersKey.HeartbeatInterval, | |
117 | payload.interval.toString(), | |
00db15b8 | 118 | { visible: false }, |
a95873d8 | 119 | { overwrite: true, save: true } |
e7aeea18 JB |
120 | ); |
121 | this.chargingStation.heartbeatSetInterval | |
122 | ? this.chargingStation.restartHeartbeat() | |
123 | : this.chargingStation.startHeartbeat(); | |
672fed6e | 124 | } |
74c6a954 | 125 | if (Object.values(OCPP16RegistrationStatus).includes(payload.status)) { |
e7aeea18 JB |
126 | const logMsg = `${this.chargingStation.logPrefix()} Charging station in '${ |
127 | payload.status | |
128 | }' state on the central server`; | |
129 | payload.status === OCPP16RegistrationStatus.REJECTED | |
130 | ? logger.warn(logMsg) | |
131 | : logger.info(logMsg); | |
c0560973 | 132 | } else { |
e7aeea18 JB |
133 | logger.error( |
134 | this.chargingStation.logPrefix() + | |
135 | ' Charging station boot notification response received: %j with undefined registration status', | |
136 | payload | |
137 | ); | |
c0560973 JB |
138 | } |
139 | } | |
140 | ||
6f35d2da JB |
141 | // eslint-disable-next-line @typescript-eslint/no-empty-function |
142 | private handleResponseHeartbeat(): void {} | |
58144adb | 143 | |
e7aeea18 JB |
144 | private handleResponseAuthorize( |
145 | payload: OCPP16AuthorizeResponse, | |
ef6fa3fb | 146 | requestPayload: OCPP16AuthorizeRequest |
e7aeea18 | 147 | ): void { |
58144adb | 148 | let authorizeConnectorId: number; |
734d790d | 149 | for (const connectorId of this.chargingStation.connectors.keys()) { |
e7aeea18 JB |
150 | if ( |
151 | connectorId > 0 && | |
152 | this.chargingStation.getConnectorStatus(connectorId)?.authorizeIdTag === | |
153 | requestPayload.idTag | |
154 | ) { | |
734d790d | 155 | authorizeConnectorId = connectorId; |
58144adb JB |
156 | break; |
157 | } | |
158 | } | |
159 | if (payload.idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED) { | |
a2653482 | 160 | this.chargingStation.getConnectorStatus(authorizeConnectorId).idTagAuthorized = true; |
e7aeea18 JB |
161 | logger.debug( |
162 | `${this.chargingStation.logPrefix()} IdTag ${ | |
163 | requestPayload.idTag | |
164 | } authorized on connector ${authorizeConnectorId}` | |
165 | ); | |
58144adb | 166 | } else { |
a2653482 | 167 | this.chargingStation.getConnectorStatus(authorizeConnectorId).idTagAuthorized = false; |
734d790d | 168 | delete this.chargingStation.getConnectorStatus(authorizeConnectorId).authorizeIdTag; |
e7aeea18 | 169 | logger.debug( |
e8e865ea | 170 | `${this.chargingStation.logPrefix()} IdTag ${requestPayload.idTag} refused with status '${ |
e7aeea18 | 171 | payload.idTagInfo.status |
e8e865ea | 172 | }' on connector ${authorizeConnectorId}` |
e7aeea18 | 173 | ); |
58144adb JB |
174 | } |
175 | } | |
176 | ||
e7aeea18 JB |
177 | private async handleResponseStartTransaction( |
178 | payload: OCPP16StartTransactionResponse, | |
ef6fa3fb | 179 | requestPayload: OCPP16StartTransactionRequest |
e7aeea18 | 180 | ): Promise<void> { |
c0560973 JB |
181 | const connectorId = requestPayload.connectorId; |
182 | ||
183 | let transactionConnectorId: number; | |
734d790d JB |
184 | for (const id of this.chargingStation.connectors.keys()) { |
185 | if (id > 0 && id === connectorId) { | |
186 | transactionConnectorId = id; | |
c0560973 JB |
187 | break; |
188 | } | |
189 | } | |
190 | if (!transactionConnectorId) { | |
e7aeea18 JB |
191 | logger.error( |
192 | this.chargingStation.logPrefix() + | |
193 | ' Trying to start a transaction on a non existing connector Id ' + | |
194 | connectorId.toString() | |
195 | ); | |
c0560973 JB |
196 | return; |
197 | } | |
e7aeea18 JB |
198 | if ( |
199 | this.chargingStation.getConnectorStatus(connectorId).transactionRemoteStarted && | |
200 | this.chargingStation.getAuthorizeRemoteTxRequests() && | |
201 | this.chargingStation.getLocalAuthListEnabled() && | |
202 | this.chargingStation.hasAuthorizedTags() && | |
203 | !this.chargingStation.getConnectorStatus(connectorId).idTagLocalAuthorized | |
204 | ) { | |
205 | logger.error( | |
206 | this.chargingStation.logPrefix() + | |
207 | ' Trying to start a transaction with a not local authorized idTag ' + | |
208 | this.chargingStation.getConnectorStatus(connectorId).localAuthorizeIdTag + | |
209 | ' on connector Id ' + | |
210 | connectorId.toString() | |
211 | ); | |
a2653482 JB |
212 | await this.resetConnectorOnStartTransactionError(connectorId); |
213 | return; | |
214 | } | |
e7aeea18 JB |
215 | if ( |
216 | this.chargingStation.getConnectorStatus(connectorId).transactionRemoteStarted && | |
217 | this.chargingStation.getAuthorizeRemoteTxRequests() && | |
218 | this.chargingStation.getMayAuthorizeAtRemoteStart() && | |
219 | !this.chargingStation.getConnectorStatus(connectorId).idTagLocalAuthorized && | |
220 | !this.chargingStation.getConnectorStatus(connectorId).idTagAuthorized | |
221 | ) { | |
222 | logger.error( | |
223 | this.chargingStation.logPrefix() + | |
224 | ' Trying to start a transaction with a not authorized idTag ' + | |
225 | this.chargingStation.getConnectorStatus(connectorId).authorizeIdTag + | |
226 | ' on connector Id ' + | |
227 | connectorId.toString() | |
228 | ); | |
a2653482 JB |
229 | await this.resetConnectorOnStartTransactionError(connectorId); |
230 | return; | |
231 | } | |
e7aeea18 JB |
232 | if ( |
233 | this.chargingStation.getConnectorStatus(connectorId).idTagAuthorized && | |
234 | this.chargingStation.getConnectorStatus(connectorId).authorizeIdTag !== requestPayload.idTag | |
235 | ) { | |
236 | logger.error( | |
237 | this.chargingStation.logPrefix() + | |
238 | ' Trying to start a transaction with an idTag ' + | |
239 | requestPayload.idTag + | |
240 | ' different from the authorize request one ' + | |
241 | this.chargingStation.getConnectorStatus(connectorId).authorizeIdTag + | |
242 | ' on connector Id ' + | |
243 | connectorId.toString() | |
244 | ); | |
a2653482 JB |
245 | await this.resetConnectorOnStartTransactionError(connectorId); |
246 | return; | |
247 | } | |
e7aeea18 JB |
248 | if ( |
249 | this.chargingStation.getConnectorStatus(connectorId).idTagLocalAuthorized && | |
250 | this.chargingStation.getConnectorStatus(connectorId).localAuthorizeIdTag !== | |
251 | requestPayload.idTag | |
252 | ) { | |
253 | logger.error( | |
254 | this.chargingStation.logPrefix() + | |
255 | ' Trying to start a transaction with an idTag ' + | |
256 | requestPayload.idTag + | |
257 | ' different from the local authorized one ' + | |
258 | this.chargingStation.getConnectorStatus(connectorId).localAuthorizeIdTag + | |
259 | ' on connector Id ' + | |
260 | connectorId.toString() | |
261 | ); | |
a2653482 | 262 | await this.resetConnectorOnStartTransactionError(connectorId); |
163547b1 JB |
263 | return; |
264 | } | |
734d790d | 265 | if (this.chargingStation.getConnectorStatus(connectorId)?.transactionStarted) { |
e7aeea18 JB |
266 | logger.debug( |
267 | this.chargingStation.logPrefix() + | |
268 | ' Trying to start a transaction on an already used connector ' + | |
269 | connectorId.toString() + | |
270 | ': %j', | |
271 | this.chargingStation.getConnectorStatus(connectorId) | |
272 | ); | |
c0560973 JB |
273 | return; |
274 | } | |
e7aeea18 JB |
275 | if ( |
276 | this.chargingStation.getConnectorStatus(connectorId)?.status !== | |
277 | OCPP16ChargePointStatus.AVAILABLE && | |
278 | this.chargingStation.getConnectorStatus(connectorId)?.status !== | |
279 | OCPP16ChargePointStatus.PREPARING | |
280 | ) { | |
281 | logger.error( | |
282 | `${this.chargingStation.logPrefix()} Trying to start a transaction on connector ${connectorId.toString()} with status ${ | |
283 | this.chargingStation.getConnectorStatus(connectorId)?.status | |
284 | }` | |
285 | ); | |
290d006c JB |
286 | return; |
287 | } | |
f3a6f63b | 288 | if (!Number.isInteger(payload.transactionId)) { |
e7aeea18 JB |
289 | logger.warn( |
290 | `${this.chargingStation.logPrefix()} Trying to start a transaction on connector ${connectorId.toString()} with a non integer transaction Id ${ | |
291 | payload.transactionId | |
292 | }, converting to integer` | |
293 | ); | |
f3a6f63b JB |
294 | payload.transactionId = Utils.convertToInt(payload.transactionId); |
295 | } | |
c0560973 | 296 | |
f0c6ed89 | 297 | if (payload.idTagInfo?.status === OCPP16AuthorizationStatus.ACCEPTED) { |
734d790d JB |
298 | this.chargingStation.getConnectorStatus(connectorId).transactionStarted = true; |
299 | this.chargingStation.getConnectorStatus(connectorId).transactionId = payload.transactionId; | |
300 | this.chargingStation.getConnectorStatus(connectorId).transactionIdTag = requestPayload.idTag; | |
e7aeea18 JB |
301 | this.chargingStation.getConnectorStatus( |
302 | connectorId | |
303 | ).transactionEnergyActiveImportRegisterValue = 0; | |
304 | this.chargingStation.getConnectorStatus(connectorId).transactionBeginMeterValue = | |
305 | OCPP16ServiceUtils.buildTransactionBeginMeterValue( | |
306 | this.chargingStation, | |
307 | connectorId, | |
308 | requestPayload.meterStart | |
309 | ); | |
310 | this.chargingStation.getBeginEndMeterValues() && | |
ef6fa3fb JB |
311 | (await this.chargingStation.ocppRequestService.sendMessageHandler< |
312 | OCPP16MeterValuesRequest, | |
313 | OCPP16MeterValuesResponse | |
314 | >(OCPP16RequestCommand.METER_VALUES, { | |
93b4a429 | 315 | connectorId, |
ef6fa3fb JB |
316 | transactionId: payload.transactionId, |
317 | meterValue: | |
318 | this.chargingStation.getConnectorStatus(connectorId).transactionBeginMeterValue, | |
319 | })); | |
320 | await this.chargingStation.ocppRequestService.sendMessageHandler< | |
321 | OCPP16StatusNotificationRequest, | |
322 | OCPP16StatusNotificationResponse | |
323 | >(OCPP16RequestCommand.STATUS_NOTIFICATION, { | |
324 | connectorId, | |
325 | status: OCPP16ChargePointStatus.CHARGING, | |
326 | errorCode: OCPP16ChargePointErrorCode.NO_ERROR, | |
327 | }); | |
e7aeea18 JB |
328 | this.chargingStation.getConnectorStatus(connectorId).status = |
329 | OCPP16ChargePointStatus.CHARGING; | |
330 | logger.info( | |
331 | this.chargingStation.logPrefix() + | |
332 | ' Transaction ' + | |
333 | payload.transactionId.toString() + | |
334 | ' STARTED on ' + | |
335 | this.chargingStation.stationInfo.chargingStationId + | |
336 | '#' + | |
337 | connectorId.toString() + | |
338 | ' for idTag ' + | |
339 | requestPayload.idTag | |
340 | ); | |
c0560973 JB |
341 | if (this.chargingStation.stationInfo.powerSharedByConnectors) { |
342 | this.chargingStation.stationInfo.powerDivider++; | |
343 | } | |
e7aeea18 JB |
344 | const configuredMeterValueSampleInterval = this.chargingStation.getConfigurationKey( |
345 | OCPP16StandardParametersKey.MeterValueSampleInterval | |
346 | ); | |
347 | this.chargingStation.startMeterValues( | |
348 | connectorId, | |
349 | configuredMeterValueSampleInterval | |
350 | ? Utils.convertToInt(configuredMeterValueSampleInterval.value) * 1000 | |
351 | : 60000 | |
352 | ); | |
c0560973 | 353 | } else { |
e7aeea18 JB |
354 | logger.warn( |
355 | this.chargingStation.logPrefix() + | |
356 | ' Starting transaction id ' + | |
357 | payload.transactionId.toString() + | |
e8e865ea | 358 | " REJECTED with status '" + |
e7aeea18 | 359 | payload?.idTagInfo?.status + |
e8e865ea | 360 | "', idTag " + |
e7aeea18 JB |
361 | requestPayload.idTag |
362 | ); | |
a2653482 JB |
363 | await this.resetConnectorOnStartTransactionError(connectorId); |
364 | } | |
365 | } | |
366 | ||
367 | private async resetConnectorOnStartTransactionError(connectorId: number): Promise<void> { | |
368 | this.chargingStation.resetConnectorStatus(connectorId); | |
e7aeea18 JB |
369 | if ( |
370 | this.chargingStation.getConnectorStatus(connectorId).status !== | |
371 | OCPP16ChargePointStatus.AVAILABLE | |
372 | ) { | |
ef6fa3fb JB |
373 | await this.chargingStation.ocppRequestService.sendMessageHandler< |
374 | OCPP16StatusNotificationRequest, | |
375 | OCPP16StatusNotificationResponse | |
376 | >(OCPP16RequestCommand.STATUS_NOTIFICATION, { | |
377 | connectorId, | |
378 | status: OCPP16ChargePointStatus.AVAILABLE, | |
379 | errorCode: OCPP16ChargePointErrorCode.NO_ERROR, | |
380 | }); | |
e7aeea18 JB |
381 | this.chargingStation.getConnectorStatus(connectorId).status = |
382 | OCPP16ChargePointStatus.AVAILABLE; | |
c0560973 JB |
383 | } |
384 | } | |
385 | ||
e7aeea18 JB |
386 | private async handleResponseStopTransaction( |
387 | payload: OCPP16StopTransactionResponse, | |
ef6fa3fb | 388 | requestPayload: OCPP16StopTransactionRequest |
e7aeea18 | 389 | ): Promise<void> { |
f479a792 JB |
390 | const transactionConnectorId = this.chargingStation.getConnectorIdByTransactionId( |
391 | requestPayload.transactionId | |
392 | ); | |
c0560973 | 393 | if (!transactionConnectorId) { |
e7aeea18 JB |
394 | logger.error( |
395 | this.chargingStation.logPrefix() + | |
396 | ' Trying to stop a non existing transaction ' + | |
397 | requestPayload.transactionId.toString() | |
398 | ); | |
c0560973 JB |
399 | return; |
400 | } | |
401 | if (payload.idTagInfo?.status === OCPP16AuthorizationStatus.ACCEPTED) { | |
e7aeea18 JB |
402 | this.chargingStation.getBeginEndMeterValues() && |
403 | !this.chargingStation.getOcppStrictCompliance() && | |
404 | this.chargingStation.getOutOfOrderEndMeterValues() && | |
ef6fa3fb JB |
405 | (await this.chargingStation.ocppRequestService.sendMessageHandler< |
406 | OCPP16MeterValuesRequest, | |
407 | OCPP16MeterValuesResponse | |
408 | >(OCPP16RequestCommand.METER_VALUES, { | |
409 | connectorId: transactionConnectorId, | |
410 | transactionId: requestPayload.transactionId, | |
411 | meterValue: OCPP16ServiceUtils.buildTransactionEndMeterValue( | |
412 | this.chargingStation, | |
413 | transactionConnectorId, | |
414 | requestPayload.meterStop | |
415 | ), | |
416 | })); | |
e7aeea18 JB |
417 | if ( |
418 | !this.chargingStation.isChargingStationAvailable() || | |
419 | !this.chargingStation.isConnectorAvailable(transactionConnectorId) | |
420 | ) { | |
ef6fa3fb JB |
421 | await this.chargingStation.ocppRequestService.sendMessageHandler< |
422 | OCPP16StatusNotificationRequest, | |
423 | OCPP16StatusNotificationResponse | |
424 | >(OCPP16RequestCommand.STATUS_NOTIFICATION, { | |
425 | connectorId: transactionConnectorId, | |
426 | status: OCPP16ChargePointStatus.UNAVAILABLE, | |
427 | errorCode: OCPP16ChargePointErrorCode.NO_ERROR, | |
428 | }); | |
e7aeea18 JB |
429 | this.chargingStation.getConnectorStatus(transactionConnectorId).status = |
430 | OCPP16ChargePointStatus.UNAVAILABLE; | |
c0560973 | 431 | } else { |
ef6fa3fb JB |
432 | await this.chargingStation.ocppRequestService.sendMessageHandler< |
433 | OCPP16BootNotificationRequest, | |
434 | OCPP16BootNotificationResponse | |
435 | >(OCPP16RequestCommand.STATUS_NOTIFICATION, { | |
436 | connectorId: transactionConnectorId, | |
437 | status: OCPP16ChargePointStatus.AVAILABLE, | |
438 | errorCode: OCPP16ChargePointErrorCode.NO_ERROR, | |
439 | }); | |
e7aeea18 JB |
440 | this.chargingStation.getConnectorStatus(transactionConnectorId).status = |
441 | OCPP16ChargePointStatus.AVAILABLE; | |
c0560973 JB |
442 | } |
443 | if (this.chargingStation.stationInfo.powerSharedByConnectors) { | |
444 | this.chargingStation.stationInfo.powerDivider--; | |
445 | } | |
e7aeea18 JB |
446 | logger.info( |
447 | this.chargingStation.logPrefix() + | |
448 | ' Transaction ' + | |
449 | requestPayload.transactionId.toString() + | |
450 | ' STOPPED on ' + | |
451 | this.chargingStation.stationInfo.chargingStationId + | |
452 | '#' + | |
453 | transactionConnectorId.toString() | |
454 | ); | |
a2653482 | 455 | this.chargingStation.resetConnectorStatus(transactionConnectorId); |
c0560973 | 456 | } else { |
e7aeea18 JB |
457 | logger.warn( |
458 | this.chargingStation.logPrefix() + | |
459 | ' Stopping transaction id ' + | |
460 | requestPayload.transactionId.toString() + | |
e8e865ea JB |
461 | " REJECTED with status '" + |
462 | payload.idTagInfo?.status + | |
463 | "'" | |
e7aeea18 | 464 | ); |
c0560973 JB |
465 | } |
466 | } | |
467 | ||
6f35d2da JB |
468 | // eslint-disable-next-line @typescript-eslint/no-empty-function |
469 | private handleResponseStatusNotification(): void {} | |
c0560973 | 470 | |
6f35d2da JB |
471 | // eslint-disable-next-line @typescript-eslint/no-empty-function |
472 | private handleResponseMeterValues(): void {} | |
c0560973 | 473 | } |