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
Hook the OCPP 2.0 stack into the main code
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ocpp
/
OCPPRequestService.ts
diff --git
a/src/charging-station/ocpp/OCPPRequestService.ts
b/src/charging-station/ocpp/OCPPRequestService.ts
index da39fb9e4367f6dfa7a0ad93388c987d7a88190d..125baf4073366623f05c67797d6e375ef532f148 100644
(file)
--- a/
src/charging-station/ocpp/OCPPRequestService.ts
+++ b/
src/charging-station/ocpp/OCPPRequestService.ts
@@
-10,13
+10,13
@@
import type { JsonObject, JsonType } from '../../types/JsonType';
import { ErrorType } from '../../types/ocpp/ErrorType';
import { MessageType } from '../../types/ocpp/MessageType';
import {
import { ErrorType } from '../../types/ocpp/ErrorType';
import { MessageType } from '../../types/ocpp/MessageType';
import {
- ErrorCallback,
- IncomingRequestCommand,
- OutgoingRequest,
+
type
ErrorCallback,
+
type
IncomingRequestCommand,
+
type
OutgoingRequest,
RequestCommand,
RequestCommand,
- RequestParams,
- ResponseCallback,
- ResponseType,
+
type
RequestParams,
+
type
ResponseCallback,
+
type
ResponseType,
} from '../../types/ocpp/Requests';
import type { ErrorResponse, Response } from '../../types/ocpp/Responses';
import Constants from '../../utils/Constants';
} from '../../types/ocpp/Requests';
import type { ErrorResponse, Response } from '../../types/ocpp/Responses';
import Constants from '../../utils/Constants';
@@
-189,10
+189,10
@@
export default abstract class OCPPRequestService {
// Check if wsConnection opened
if (chargingStation.isWebSocketConnectionOpened() === true) {
// Yes: Send Message
// Check if wsConnection opened
if (chargingStation.isWebSocketConnectionOpened() === true) {
// Yes: Send Message
- const beginId = PerformanceStatistics.beginMeasure(commandName);
+ const beginId = PerformanceStatistics.beginMeasure(commandName
as string
);
// FIXME: Handle sending error
chargingStation.wsConnection.send(messageToSend);
// FIXME: Handle sending error
chargingStation.wsConnection.send(messageToSend);
- PerformanceStatistics.endMeasure(commandName, beginId);
+ PerformanceStatistics.endMeasure(commandName
as string
, beginId);
logger.debug(
`${chargingStation.logPrefix()} >> Command '${commandName}' sent ${this.getMessageTypeString(
messageType
logger.debug(
`${chargingStation.logPrefix()} >> Command '${commandName}' sent ${this.getMessageTypeString(
messageType
@@
-376,10
+376,10
@@
export default abstract class OCPPRequestService {
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- public abstract requestHandler<Req
uestType extends JsonType, Response
Type extends JsonType>(
+ public abstract requestHandler<Req
Type extends JsonType, Res
Type extends JsonType>(
chargingStation: ChargingStation,
commandName: RequestCommand,
commandParams?: JsonType,
params?: RequestParams
chargingStation: ChargingStation,
commandName: RequestCommand,
commandParams?: JsonType,
params?: RequestParams
- ): Promise<Res
ponse
Type>;
+ ): Promise<ResType>;
}
}