This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PENDING state boot notification handling
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
- Loading branch information
Jérôme Benoit
committed
Feb 4, 2022
1 parent
c3ee95a
commit 16cd35a
Showing
4 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,9 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer | |
|
||
public async handleRequest(messageId: string, commandName: OCPP16IncomingRequestCommand, commandPayload: Record<string, unknown>): Promise<void> { | ||
let result: Record<string, unknown>; | ||
if (this.chargingStation.isRegistered()) { | ||
if (this.chargingStation.isRegistered() && | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jerome-benoit
Owner
|
||
!(this.chargingStation.isInPendingState | ||
This comment has been minimized.
Sorry, something went wrong. |
||
&& (commandName === OCPP16IncomingRequestCommand.REMOTE_START_TRANSACTION || commandName === OCPP16IncomingRequestCommand.REMOTE_STOP_TRANSACTION))) { | ||
if (this.incomingRequestHandlers.has(commandName)) { | ||
try { | ||
// Call the method to build the result | ||
|
@@ -295,7 +297,7 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer | |
if (this.chargingStation.getAuthorizeRemoteTxRequests()) { | ||
let authorized = false; | ||
if (this.chargingStation.getLocalAuthListEnabled() && this.chargingStation.hasAuthorizedTags() | ||
&& this.chargingStation.authorizedTags.find((value) => value === commandPayload.idTag)) { | ||
&& this.chargingStation.authorizedTags.find((value) => value === commandPayload.idTag)) { | ||
this.chargingStation.getConnectorStatus(transactionConnectorId).localAuthorizeIdTag = commandPayload.idTag; | ||
this.chargingStation.getConnectorStatus(transactionConnectorId).idTagLocalAuthorized = true; | ||
authorized = true; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 points regarding this condition
Let's think of this case:
1- In the initialisation, CPO accepts token and then CPO sets the charging station in pending phase, create the auth token and issues a changeConfig with new ocppUrl with Auth token.
In the handleRequest,
if evaluates the following:
(isRegistered == true && not isPendingState == false && (command == 'ChangeConfig' hence false )) --> false
then throws error: security error, The charging station is not registered on the central server. change configuration
But our capability of being able to auto-config ocpp URL should be dependent on CS's capability of enabling config request or not. In this case independent of the CS's capabilities, any CS will not allow auto-config, with the above request specification which is sent by a CPO.
2- Also the error is not correct. isRegistered() == true, hence "charging station is not registered" is not a compatible error text. The other conditions which result in false do not mean that CS is not registered.
Would you agree? What are your comments about this?