import {
- DiagnosticsStatus,
IncomingRequestCommand,
RequestCommand,
ResponseType,
import { HandleErrorParams } from '../../types/Error';
import { JsonType } from '../../types/JsonType';
import { MessageType } from '../../types/ocpp/MessageType';
-import { MeterValue } from '../../types/ocpp/MeterValues';
import OCPPError from '../../exception/OCPPError';
import type OCPPResponseService from './OCPPResponseService';
import PerformanceStatistics from '../../performance/PerformanceStatistics';
chargingStation: ChargingStation,
ocppResponseService: OCPPResponseService
): T {
- if (!OCPPRequestService.instances.has(chargingStation.id)) {
+ if (!OCPPRequestService.instances.has(chargingStation.hashId)) {
OCPPRequestService.instances.set(
- chargingStation.id,
+ chargingStation.hashId,
new this(chargingStation, ocppResponseService)
);
}
- return OCPPRequestService.instances.get(chargingStation.id) as T;
+ return OCPPRequestService.instances.get(chargingStation.hashId) as T;
}
public async sendResult(
resolve(payload);
} catch (error) {
reject(error);
- throw error;
} finally {
self.chargingStation.requests.delete(messageId);
}
}
}
- public abstract sendMessageHandler(
+ public abstract sendMessageHandler<Response extends JsonType>(
commandName: RequestCommand,
commandParams?: JsonType,
params?: SendParams
- ): Promise<ResponseType>;
-
- public abstract sendDiagnosticsStatusNotification(
- diagnosticsStatus: DiagnosticsStatus
- ): Promise<void>;
+ ): Promise<Response>;
}