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: cleanup method namaspace
[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 1c70027293887f8f06d5f6063b44784bcbdcf630..3ca4d3cf406e90b9c04ea18d861572ba30d5167d 100644
(file)
--- a/
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
+++ b/
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
@@
-13,7
+13,7
@@
import {
OCPP20IncomingRequestCommand,
OCPPVersion,
} from '../../../types';
OCPP20IncomingRequestCommand,
OCPPVersion,
} from '../../../types';
-import { logger } from '../../../utils
/Logger
';
+import { logger } from '../../../utils';
import { OCPP20ServiceUtils, OCPPIncomingRequestService } from '../internal';
const moduleName = 'OCPP20IncomingRequestService';
import { OCPP20ServiceUtils, OCPPIncomingRequestService } from '../internal';
const moduleName = 'OCPP20IncomingRequestService';
@@
-23,9
+23,9
@@
export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
private incomingRequestHandlers: Map<OCPP20IncomingRequestCommand, IncomingRequestHandler>;
public constructor() {
private incomingRequestHandlers: Map<OCPP20IncomingRequestCommand, IncomingRequestHandler>;
public constructor() {
- if (new.target?.name === moduleName) {
- throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
- }
+
//
if (new.target?.name === moduleName) {
+
//
throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
+
//
}
super(OCPPVersion.VERSION_20);
this.incomingRequestHandlers = new Map<OCPP20IncomingRequestCommand, IncomingRequestHandler>([
[OCPP20IncomingRequestCommand.CLEAR_CACHE, this.handleRequestClearCache.bind(this)],
super(OCPPVersion.VERSION_20);
this.incomingRequestHandlers = new Map<OCPP20IncomingRequestCommand, IncomingRequestHandler>([
[OCPP20IncomingRequestCommand.CLEAR_CACHE, this.handleRequestClearCache.bind(this)],
@@
-40,7
+40,11
@@
export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
),
],
]);
),
],
]);
- this.validatePayload.bind(this);
+ this.validatePayload = this.validatePayload.bind(this) as (
+ chargingStation: ChargingStation,
+ commandName: OCPP20IncomingRequestCommand,
+ commandPayload: JsonType
+ ) => boolean;
}
public async incomingRequestHandler(
}
public async incomingRequestHandler(
@@
-52,7
+56,7
@@
export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
let response: JsonType;
if (
chargingStation.getOcppStrictCompliance() === true &&
let response: JsonType;
if (
chargingStation.getOcppStrictCompliance() === true &&
- chargingStation.i
sI
nPendingState() === true &&
+ chargingStation.inPendingState() === true &&
(commandName === OCPP20IncomingRequestCommand.REQUEST_START_TRANSACTION ||
commandName === OCPP20IncomingRequestCommand.REQUEST_STOP_TRANSACTION)
) {
(commandName === OCPP20IncomingRequestCommand.REQUEST_START_TRANSACTION ||
commandName === OCPP20IncomingRequestCommand.REQUEST_STOP_TRANSACTION)
) {
@@
-70,7
+74,7
@@
export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
if (
chargingStation.isRegistered() === true ||
(chargingStation.getOcppStrictCompliance() === false &&
if (
chargingStation.isRegistered() === true ||
(chargingStation.getOcppStrictCompliance() === false &&
- chargingStation.i
sI
nUnknownState() === true)
+ chargingStation.inUnknownState() === true)
) {
if (
this.incomingRequestHandlers.has(commandName) === true &&
) {
if (
this.incomingRequestHandlers.has(commandName) === true &&