feat: Add OCPP 2.1 support#416
Closed
andig wants to merge 15 commits intolorenzodonini:masterfrom
Closed
Conversation
* chore: fix typo * Update types.go --------- Co-authored-by: premultiply <4681172+premultiply@users.noreply.github.com>
Initial implementation of OCPP 2.1 protocol support including: **Types package (ocpp2.1/types/):** - CustomDataType for vendor extensions (new in 2.1) - Extended AuthorizationStatus, IdTokenType enums - ChargingProfile types with new PriorityCharging, LocalGeneration, Dynamic - MeterValue/SampledValue with 50+ Measurand values - EnergyTransferMode enum (11 modes including BPT, DER, WPT) - AuthorizeCertificateStatus enum (7 values) - All validators registered with "21" suffix **Provisioning package:** - BootNotification, Reset (with ImmediateAndResume) - GetBaseReport, GetReport, NotifyReport - GetVariables, SetVariables - SetNetworkProfile (with identity, basicAuthPassword fields) **Authorization package:** - Authorize (with certificate support, AllowedEnergyTransfer) - ClearCache **Availability package:** - Heartbeat, StatusNotification, ChangeAvailability **Data package:** - DataTransfer All types conform to OCPP 2.1 JSON schemas with correct: - Field names and JSON tags - MaxLength constraints - Required/optional field handling - Enum values Closes lorenzodonini#337 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements OCPP 2.1 functional blocks with full JSON schema conformance: transactions package: - TransactionEvent (CS -> CSMS) - GetTransactionStatus (CSMS -> CS) meter package: - MeterValues (CS -> CSMS) remotecontrol package: - RequestStartTransaction (CSMS -> CS) - RequestStopTransaction (CSMS -> CS) - TriggerMessage (CSMS -> CS) - UnlockConnector (CSMS -> CS) New types in types.go: - Transaction-related: ChargingState, TransactionEvent, TriggerReason, StoppedReason, PreconditioningStatus, TransactionLimit, Transaction - Cost-related: CostDimension, TariffCost, TaxRate, Price, TotalPrice, TotalUsage, TotalCost, CostDimensionValue, ChargingPeriod, CostDetails - Remote control: MessageTrigger, TriggerMessageStatus, UnlockStatus Schema conformance fixes: - Removed MeasurandTemperature (not in OCPP 2.1) - Fixed RequestStartTransactionRequest.evseId min=1 (per schema) - Added required tag to TransactionEventRequest.seqNo - Added range validation for chargingPriority (-9 to 9) - Added min=1 to updatedPersonalMessageExtra array Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements OCPP 2.1 protocol support with full JSON schema conformance.
Phase B - Core Foundation
Phase C - Transactions & Remote Control
Types Package
All types conform to OCPP 2.1 JSON schemas with correct field names, maxLength constraints, and enum values.
Closes #337
Test plan
go build ./ocpp2.1/...)🤖 Generated with Claude Code