Merge branch 'master' into feature/rawmessagelogs
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / OCPPRequestService.ts
index 89766371dc935b63d1ca6925e51cf5ccb349e881..af23a1f4fcbdd55ac4c357dfc67c12e3c35d7e8e 100644 (file)
@@ -16,6 +16,7 @@ import OCPPError from '../../exception/OCPPError';
 import type OCPPResponseService from './OCPPResponseService';
 import PerformanceStatistics from '../../performance/PerformanceStatistics';
 import Utils from '../../utils/Utils';
+import chalk from 'chalk';
 import logger from '../../utils/Logger';
 
 export default abstract class OCPPRequestService {
@@ -151,6 +152,7 @@ export default abstract class OCPPRequestService {
           if (this.chargingStation.isWebSocketConnectionOpened()) {
             // Yes: Send Message
             const beginId = PerformanceStatistics.beginMeasure(commandName);
+            console.log(chalk`{blue >> Sending message = ${messageToSend}}`);
             // FIXME: Handle sending error
             this.chargingStation.wsConnection.send(messageToSend);
             PerformanceStatistics.endMeasure(commandName, beginId);
@@ -317,7 +319,8 @@ export default abstract class OCPPRequestService {
     }
   }
 
-  public abstract sendMessageHandler<Response extends JsonType>(
+  // eslint-disable-next-line @typescript-eslint/no-unused-vars
+  public abstract sendMessageHandler<Request extends JsonType, Response extends JsonType>(
     commandName: RequestCommand,
     commandParams?: JsonType,
     params?: SendParams