Skip to content

Traits v2_1: rebase main #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 253 commits into
base: main
Choose a base branch
from
Open

Traits v2_1: rebase main #165

wants to merge 253 commits into from

Conversation

AnlangA
Copy link

@AnlangA AnlangA commented May 6, 2025

I have added traits for the datatype, and every trait has tests. All tests have passed.

- Add comprehensive BootNotificationRequest and BootNotificationResponse structs
- Introduce new enumerations: BootReasonEnumType and RegistrationStatusEnumType
- Implement validation for datetime and field lengths
- Add support for custom data and modem information
- Improve test coverage with various validation scenarios
- Update Cargo.toml to include lazy_static and serde_json dependencies
- Introduce new GenericStatusEnumType enumeration
- Support serialization and deserialization of status
- Add Accepted and Rejected status variants
- Update enumerations module to export the new type
- Introduce new HashAlgorithmEnumType enumeration
- Support serialization and deserialization of hash algorithms
- Include SHA256, SHA384, and SHA512 variants
- Update enumerations module to export the new type
- Introduce new AuthorizationStatusEnumType enumeration
- Support serialization and deserialization of authorization statuses
- Include multiple status variants like Accepted, Blocked, Expired, etc.
- Update enumerations module to export the new type
- Introduce new CertificateSigningUseEnumType enumeration
- Support serialization and deserialization of certificate signing use types
- Include variants for Charging Station, V2G, and V2G 2.0 certificates
- Update enumerations module to export the new type
- Introduce new DayOfWeekEnumType enumeration
- Support serialization and deserialization of days of the week
- Include all seven days from Monday to Sunday
- Update enumerations module to export the new type
- Introduce new EvseKindEnumType enumeration
- Support serialization and deserialization of EVSE types
- Include AC and DC variants
- Update enumerations module to export the new type
- Introduce new ChargingStateEnumType enumeration
- Support serialization and deserialization of charging states
- Include variants for EV connection, charging, suspended states, and idle
- Update enumerations module to export the new type
- Introduce new APNAuthenticationEnumType enumeration
- Support serialization and deserialization of APN authentication methods
- Include variants for PAP, CHAP, NONE, and AUTO authentication
- Update enumerations module to export the new type
- Introduce new ChargingRateUnitEnumType enumeration
- Support serialization and deserialization of charging rate units
- Include variants for Watts (W) and Amperes (A)
- Update enumerations module to export the new type
- Introduce new ConnectorStatusEnumType enumeration
- Support serialization and deserialization of connector statuses
- Include variants for Available, Occupied, Reserved, Unavailable, and Faulted
- Update enumerations module to export the new type
- Introduce new ResetStatusEnumType enumeration
- Support serialization and deserialization of reset statuses
- Include variants for Accepted, Rejected, and Scheduled
- Update enumerations module to export the new type
- Introduce new GetCertificateStatusEnumType enumeration
- Support serialization and deserialization of certificate status retrieval
- Include variants for Accepted and Failed
- Update enumerations module to export the new type
- Introduce new MessageTriggerEnumType enumeration
- Support serialization and deserialization of message trigger types
- Include variants for various notification and status messages
- Update enumerations module to export the new type
- Introduce new OCPPInterfaceEnumType enumeration
- Support serialization and deserialization of network interfaces
- Include variants for wired and wireless interfaces (0-3) and any interface
- Update enumerations module to export the new type
- Introduce new OCPPTransportEnumType enumeration
- Support serialization and deserialization of transport protocols
- Include variants for SOAP and JSON
- Update enumerations module to export the new type
- Introduce new OCPPVersionEnumType enumeration
- Support serialization and deserialization of OCPP versions
- Include variants for OCPP versions 1.2, 1.5, 1.6, 2.0, 2.0.1, and 2.1
- Update enumerations module to export the new type
- Add note about backwards compatibility with JSON schema
- Introduce new VPNEnumType enumeration
- Support serialization and deserialization of VPN types
- Include variants for IKEv2, IPSec, L2TP, and PPTP
- Update enumerations module to export the new type
- Introduce new DERControlEnumType enumeration
- Support serialization and deserialization of Distributed Energy Resource (DER) control types
- Include variants for various control modes such as EnterService, FreqDroop, VoltVar, and more
- Update enumerations module to export the new type
- Introduce new EventNotificationEnumType enumeration
- Support serialization and deserialization of event notification types
- Include variants for HardWiredNotification, HardWiredMonitor, PreconfiguredMonitor, and CustomMonitor
- Update enumerations module to export the new type
- Introduce new ChargingProfilePurposeEnumType enumeration
- Support serialization and deserialization of charging profile purposes
- Include variants for ChargingStationExternalConstraints, ChargingStationMaxProfile, TxDefaultProfile, TxProfile, PriorityCharging, and LocalGeneration
- Update enumerations module to export the new type
- Introduce new ChargingLimitSourceEnumType enumeration
- Support serialization and deserialization of charging limit sources
- Include variants for Energy Management System (EMS), System Operator (SO), Charging Station Operator (CSO), and Other
- Update enumerations module to export the new type
- Introduce new ChargingProfileKindEnumType enumeration
- Support serialization and deserialization of charging profile kinds
- Include variants for Absolute, Recurring, Relative, and Dynamic
- Update enumerations module to export the new type
- Introduce new ChargingProfileStatusEnumType enumeration
- Support serialization and deserialization of charging profile processing status
- Include variants for Accepted and Rejected
- Add documentation explaining the meaning of the status
- Update enumerations module to export the new type
- Introduce new OperationModeEnumType enumeration
- Support serialization and deserialization of charging operation modes
- Include variants for Idle, ChargingOnly, CentralSetpoint, ExternalSetpoint, ExternalLimits, CentralFrequency, LocalFrequency, and LocalLoadBalancing
- Add documentation explaining the default behavior when the mode is absent
- Update enumerations module to export the new type
…pe to enumerations module

- Import and expose new ChargingProfileKindEnumType and ChargingProfileStatusEnumType
- Update module to include new enumeration types for OCPP v2.1
- Extend support for charging profile-related enumerations
AnlangA and others added 27 commits May 15, 2025 14:52
Improve tariff module with accurate descriptions and slices

Updates the tariff module with more detailed and specific documentation that
accurately describes each component's purpose. Improves type safety by
returning slices instead of vector references, and updates the TariffFixedType
to align with OCPP 2.1 specification by supporting multiple price elements.
Update tax_rule and total_cost to match ISO 15118-20 spec
AI:

Update price and usage fields to match OCPP 2.1 spec
AI: I've reviewed the code changes and created a commit message that accurately describes the changes. The message reflects the main purpose of the commit - replacing floating point values with Decimal types in specific data structures. This will improve numerical precision and consistency in financial calculations.
Refactor VariableAttributeType to use enumerated attributes

Improves VariableAttributeType by switching from string-based type field
to an enumerated AttributeEnumType. Updates related parts in the codebase
to support this change including VariableCharacteristicsType which now
uses improved builder pattern for optional fields.
Add v2_ feature that bundles v2_0_1 and v2_1 features

AI:

Add v2_ feature that bundles v2_0_1 and v2_1 features
AI: Format multiline assertion statements for improved readability
@AnlangA AnlangA requested a review from tommymalmqvist May 15, 2025 16:13
@AnlangA
Copy link
Author

AnlangA commented May 15, 2025

hi, you can review now @tommymalmqvist

@tommymalmqvist
Copy link
Member

hi, you can review now @tommymalmqvist

Will do this weekend. Going to take some time since is a lot of code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants