codetics-ocpp21
Every OCPP 2.1 (Edition 2) message as plain Rust types, including the new functional areas (bidirectional
power transfer and DER control, dynamic and priority charging profiles, local cost calculation with tariffs,
battery swapping, periodic event streams) and the unconfirmed SEND message type.
serdemappings matching the message definitions;customDataextensions are preserved;Validateimplementations for length, range and cardinality constraints, with violations mapped to OCPP-J error codes;Actionwith message direction, and typed dispatch:StationCall,CsmsCallandStationSend.
use ;
assert_eq!;
assert!;
let p = r#"{"id":1,"pending":0,"basetime":"2025-01-01T00:00:00Z","data":[{"t":0,"v":"230.4"}]}"#;
let NotifyPeriodicEventStream = decode.unwrap;
assert_eq!;
Part of Codetics OCPP
This crate belongs to Codetics OCPP, a complete OCPP 1.6J / 2.0.1 / 2.1 implementation in Rust written by Kevin Vavelin (Codetics). It can be used as is; contributions are welcome.
License and credit
Licensed under the Apache License, Version 2.0.
Copyright 2026 Kevin Vavelin, Codetics. Any redistribution of this crate or of a work derived from it (including forks and products embedding it) must keep the copyright notice and include the NOTICE file crediting Kevin Vavelin / Codetics as the origin of the work.