Documentation
How the iso15118 crate is put together: the EXI codec, the ISO 15118-2 and -20 message sets, session ordering, SLAC, discovery and Plug & Charge signatures.
The ISO 15118 communication suite — what a vehicle and a charging station speak over the CCS cable — from the powerline link coming up to the charge loop turning, with none of the I/O.
Where to start
| If you want to… | Read |
|---|---|
| Install it and run a session | Getting started |
| Understand the layering | Architecture |
| Know which request is legal when | Sessions and ordering |
| Encode or decode V2G messages yourself | The EXI profile |
| Bring the link up | SLAC, then discovery and framing |
| Sign or verify a contract credential | Plug & Charge |
| Decide whether a key is one to trust | Certificates |
| Ship it on a microcontroller | Embedded and no_std |
| Know whether to trust the wire format | Verification |
The shape of every engine
Five engines — station, vehicle, SECC discovery and both halves of SLAC — are driven the same way:
| Step | Session engines | Discovery and SLAC |
|---|---|---|
| Bytes from the wire | handle_input(now, &bytes) | handle_datagram / handle_frame |
| What happened | poll_event() | poll_event() |
| Your answer | respond (SECC) · request (EVCC) | — the engine decides |
| Bytes for the wire | take_transmit() | poll_transmit() |
| The next deadline | poll_timeout(), then handle_timeout(now) | same |
- Streams versus frames. A session engine reassembles a TCP stream; discovery and SLAC take one complete datagram or Ethernet frame at a time.
- Who answers. The vehicle drives with
request, the station answers withrespond; below IP the engines answer for themselves. - Errors.
handle_inputreturns aResult, and the session is already closed when the error reaches you (Event::Closed(Close::Fatal)queued). SLAC'shandle_framereturns nothing: on a shared medium a malformed frame is ordinary, and reporting one would let anyone in earshot end someone else's run.
None of it reads a clock, opens a socket or spawns a task; the clock, transport, randomness and cryptography are yours. So the same logic runs under Tokio and on a bare-metal controller, and a whole DC session runs as a unit test.
Terms
| Term | Meaning |
|---|---|
| EVCC | Electric Vehicle Communication Controller — the vehicle's side. |
| SECC | Supply Equipment Communication Controller — the charging station's side. |
| EXI | Efficient XML Interchange, the binary encoding every V2G message uses. |
| V2GTP | The eight-byte frame header that wraps every message on TCP or UDP. |
| SDP | SECC Discovery Protocol — how the vehicle finds the station's TCP port. |
| SLAC | Signal Level Attenuation Characterization — which station this cable is plugged into. |
| PnC | Plug & Charge — authenticating with a contract certificate instead of a card. |
| BPT | Bidirectional Power Transfer — the vehicle discharging back to the grid. |
"ISO 15118" names two incompatible generations, so Protocol::as_str() is always "iso15118-2" or "iso15118-20" and a bare "iso15118" does not parse — see Getting started.
Scope
The engines own framing, decoding, the handshake, session ids, ordering and the spec timers. Whether to authorize, which schedule to offer and how much current to deliver are the application's. What is deliberately outside the crate is listed under Limitations.