Change OCPP classes methods scope to protected
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 13 Aug 2021 21:33:34 +0000 (23:33 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 13 Aug 2021 21:33:34 +0000 (23:33 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/OCPPIncomingRequestService.ts
src/charging-station/ocpp/OCPPRequestService.ts
src/utils/Constants.ts

index ff2dfd4c18d4f4098d1374cdb45767a48dd27c55..6f91ead088003a09baf2f5b3c419da349fe0c35a 100644 (file)
@@ -9,7 +9,7 @@ export default abstract class OCPPIncomingRequestService {
     this.chargingStation = chargingStation;
   }
 
-  public handleIncomingRequestError(commandName: IncomingRequestCommand, error: Error, ocppResponse?): unknown {
+  protected handleIncomingRequestError(commandName: IncomingRequestCommand, error: Error, ocppResponse?): unknown {
     logger.error(this.chargingStation.logPrefix() + ' Incoming request command ' + commandName + ' error: %j', error);
     if (ocppResponse) {
       return ocppResponse;
index 6c24665ac1042b5591184f69627e83b3b265f1f1..ccc6fc2b4a919f02030440b17a2fa7af4236c51d 100644 (file)
@@ -106,7 +106,7 @@ export default abstract class OCPPRequestService {
     });
   }
 
-  public handleRequestError(commandName: RequestCommand, error: Error): void {
+  protected handleRequestError(commandName: RequestCommand, error: Error): void {
     logger.error(this.chargingStation.logPrefix() + ' Request command ' + commandName + ' error: %j', error);
     throw error;
   }
index 9327b988404932015944de790828ce3dc3162d99..d497628ac2e0bd260feaf7e6a8dc0444d584f76e 100644 (file)
@@ -3,9 +3,6 @@ import { AvailabilityStatus, ChargingProfileStatus, ClearChargingProfileStatus,
 import { MeterValueMeasurand } from '../types/ocpp/MeterValues';
 
 export default class Constants {
-  static readonly ENTITY_CHARGING_STATION = 'ChargingStation';
-  static readonly ENTITY_AUTOMATIC_TRANSACTION_GENERATOR = 'AutomaticTransactionGenerator';
-
   static readonly OCPP_RESPONSE_EMPTY = Object.freeze({});
   static readonly OCPP_RESPONSE_ACCEPTED = Object.freeze({ status: DefaultStatus.ACCEPTED });
   static readonly OCPP_RESPONSE_REJECTED = Object.freeze({ status: DefaultStatus.REJECTED });