]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
fix(ocpp): correct P0/P1 spec conformity gaps for OCPP 1.6 and 2.0.1
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 31 Mar 2026 18:51:32 +0000 (20:51 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 31 Mar 2026 18:51:32 +0000 (20:51 +0200)
commite8d291b613ba556b76192faa25e25a31b30f3117
tree979c7b8625ce9c25920d0bcb00679944077c156c
parentb6f8d714932ef231ce6f817a535a49b27dd9807d
fix(ocpp): correct P0/P1 spec conformity gaps for OCPP 1.6 and 2.0.1

Addresses 7 non-conformities identified during algorithmic conformity audit:

P0 - OCPP-J protocol layer:
- Add MessageTypeNotSupported and RpcFrameworkError error codes (2.0.1 §4.3)
- Send CALLERROR with messageId "-1" on JSON parse failure (2.0.1 §4.2.3)
- Implement RetryBackOff reconnection algorithm using spec variables (2.0.1 §8.1-§8.3)

P1 - OCPP 1.6 logic fixes:
- Update authorization cache on Authorize/Start/StopTransaction responses
- Fix clearChargingProfiles to use AND logic per Errata 3.25

P1 - OCPP 2.0.1 security lifecycle:
- Add certificate signing retry with exponential back-off (A02.FR.17-19)
- Add security event notification queue with guaranteed delivery (A04.FR.02)
- Update authorization cache on AuthorizeResponse (C10.FR.04)

Infrastructure:
- Consolidate exponential backoff into computeExponentialBackOffDelay()
- Replace string literals with OCPP20OptionalVariableName enum entries
- Export OCPP16IdTagInfo type, make getAuthCache() non-optional on AuthStrategy
- Factor updateAuthorizationCache() into ServiceUtils for both 1.6 and 2.0
24 files changed:
src/charging-station/ChargingStation.ts
src/charging-station/ocpp/1.6/OCPP16ResponseService.ts
src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts
src/charging-station/ocpp/2.0/OCPP20CertSigningRetryManager.ts [new file with mode: 0644]
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
src/charging-station/ocpp/2.0/OCPP20ResponseService.ts
src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts
src/charging-station/ocpp/2.0/OCPP20VariableRegistry.ts
src/charging-station/ocpp/auth/interfaces/OCPPAuthService.ts
src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts
src/charging-station/ocpp/auth/strategies/CertificateAuthStrategy.ts
src/charging-station/ocpp/auth/strategies/RemoteAuthStrategy.ts
src/types/index.ts
src/types/ocpp/1.6/Transaction.ts
src/types/ocpp/2.0/Variables.ts
src/types/ocpp/ErrorType.ts
src/utils/Utils.ts
src/utils/index.ts
tests/charging-station/ocpp/1.6/OCPP16ServiceUtils.test.ts
tests/charging-station/ocpp/2.0/OCPP20CertSigningRetryManager.test.ts [new file with mode: 0644]
tests/charging-station/ocpp/2.0/OCPP20ResponseService-CacheUpdate.test.ts
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-AuthCache.test.ts [new file with mode: 0644]
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-ReconnectDelay.test.ts [new file with mode: 0644]
tests/utils/Utils.test.ts