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
fix: ensure the latest schedule period within the charging profile
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ocpp
/
OCPPIncomingRequestService.ts
diff --git
a/src/charging-station/ocpp/OCPPIncomingRequestService.ts
b/src/charging-station/ocpp/OCPPIncomingRequestService.ts
index d364f7aa8df2866a59bf5f2da7d0059da475d569..b7ab8ef66382b1ac0e799294eccca7f676480855 100644
(file)
--- a/
src/charging-station/ocpp/OCPPIncomingRequestService.ts
+++ b/
src/charging-station/ocpp/OCPPIncomingRequestService.ts
@@
-33,11
+33,15
@@
export abstract class OCPPIncomingRequestService extends AsyncResource {
multipleOfPrecision: 2,
});
ajvFormats(this.ajv);
multipleOfPrecision: 2,
});
ajvFormats(this.ajv);
- this.incomingRequestHandler = this.incomingRequestHandler.bind(this) as (
+ this.incomingRequestHandler = this.incomingRequestHandler.bind(this) as <
+ ReqType extends JsonType,
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ ResType extends JsonType,
+ >(
chargingStation: ChargingStation,
messageId: string,
commandName: IncomingRequestCommand,
chargingStation: ChargingStation,
messageId: string,
commandName: IncomingRequestCommand,
- commandPayload:
Json
Type,
+ commandPayload:
Req
Type,
) => Promise<void>;
this.validateIncomingRequestPayload = this.validateIncomingRequestPayload.bind(this) as <
T extends JsonType,
) => Promise<void>;
this.validateIncomingRequestPayload = this.validateIncomingRequestPayload.bind(this) as <
T extends JsonType,
@@
-96,7
+100,7
@@
export abstract class OCPPIncomingRequestService extends AsyncResource {
validate.errors,
);
throw new OCPPError(
validate.errors,
);
throw new OCPPError(
- OCPPServiceUtils.ajvErrorsToErrorType(validate.errors),
+ OCPPServiceUtils.ajvErrorsToErrorType(validate.errors
!
),
'Incoming request PDU is invalid',
commandName,
JSON.stringify(validate.errors, null, 2),
'Incoming request PDU is invalid',
commandName,
JSON.stringify(validate.errors, null, 2),
@@
-104,16
+108,17
@@
export abstract class OCPPIncomingRequestService extends AsyncResource {
}
protected handleRequestClearCache(chargingStation: ChargingStation): ClearCacheResponse {
}
protected handleRequestClearCache(chargingStation: ChargingStation): ClearCacheResponse {
- if (chargingStation.idTagsCache.deleteIdTags(getIdTagsFile(chargingStation.stationInfo))) {
+ if (chargingStation.idTagsCache.deleteIdTags(getIdTagsFile(chargingStation.stationInfo)
!
)) {
return OCPPConstants.OCPP_RESPONSE_ACCEPTED;
}
return OCPPConstants.OCPP_RESPONSE_REJECTED;
}
return OCPPConstants.OCPP_RESPONSE_ACCEPTED;
}
return OCPPConstants.OCPP_RESPONSE_REJECTED;
}
- public abstract incomingRequestHandler(
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ public abstract incomingRequestHandler<ReqType extends JsonType, ResType extends JsonType>(
chargingStation: ChargingStation,
messageId: string,
commandName: IncomingRequestCommand,
chargingStation: ChargingStation,
messageId: string,
commandName: IncomingRequestCommand,
- commandPayload:
Json
Type,
+ commandPayload:
Req
Type,
): Promise<void>;
}
): Promise<void>;
}