repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: improve debug log messages
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ocpp
/
2.0
/
OCPP20IncomingRequestService.ts
diff --git
a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
index 6cfb4ec1374f1b76de353b6cb4b7546d75797fa5..bda78d54f3147f5eb621ae5108836c34eea8ee6d 100644
(file)
--- a/
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
+++ b/
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
@@
-48,13
+48,13
@@
export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
) => boolean;
}
) => boolean;
}
- public async incomingRequestHandler(
+ public async incomingRequestHandler
<ReqType extends JsonType, ResType extends JsonType>
(
chargingStation: ChargingStation,
messageId: string,
commandName: OCPP20IncomingRequestCommand,
chargingStation: ChargingStation,
messageId: string,
commandName: OCPP20IncomingRequestCommand,
- commandPayload:
Json
Type,
+ commandPayload:
Req
Type,
): Promise<void> {
): Promise<void> {
- let response:
Json
Type;
+ let response:
Res
Type;
if (
chargingStation.getOcppStrictCompliance() === true &&
chargingStation.inPendingState() === true &&
if (
chargingStation.getOcppStrictCompliance() === true &&
chargingStation.inPendingState() === true &&
@@
-84,10
+84,10
@@
export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
try {
this.validatePayload(chargingStation, commandName, commandPayload);
// Call the method to build the response
try {
this.validatePayload(chargingStation, commandName, commandPayload);
// Call the method to build the response
- response =
await this.incomingRequestHandlers.get(commandName)
(
+ response =
(await this.incomingRequestHandlers.get(commandName)!
(
chargingStation,
commandPayload,
chargingStation,
commandPayload,
- );
+ )
) as ResType
;
} catch (error) {
// Log
logger.error(
} catch (error) {
// Log
logger.error(
@@
-139,7
+139,7
@@
export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
return this.validateIncomingRequestPayload(
chargingStation,
commandName,
return this.validateIncomingRequestPayload(
chargingStation,
commandName,
- this.jsonSchemas.get(commandName),
+ this.jsonSchemas.get(commandName)
!
,
commandPayload,
);
}
commandPayload,
);
}