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 sessionGetting started
Understand the layeringArchitecture
Know which request is legal whenSessions and ordering
Encode or decode V2G messages yourselfThe EXI profile
Bring the link upSLAC, then discovery and framing
Sign or verify a contract credentialPlug & Charge
Decide whether a key is one to trustCertificates
Ship it on a microcontrollerEmbedded and no_std
Know whether to trust the wire formatVerification

The shape of every engine

Five engines — station, vehicle, SECC discovery and both halves of SLAC — are driven the same way:

StepSession enginesDiscovery and SLAC
Bytes from the wirehandle_input(now, &bytes)handle_datagram / handle_frame
What happenedpoll_event()poll_event()
Your answerrespond (SECC) · request (EVCC)— the engine decides
Bytes for the wiretake_transmit()poll_transmit()
The next deadlinepoll_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 with respond; below IP the engines answer for themselves.
  • Errors. handle_input returns a Result, and the session is already closed when the error reaches you (Event::Closed(Close::Fatal) queued). SLAC's handle_frame returns 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

TermMeaning
EVCCElectric Vehicle Communication Controller — the vehicle's side.
SECCSupply Equipment Communication Controller — the charging station's side.
EXIEfficient XML Interchange, the binary encoding every V2G message uses.
V2GTPThe eight-byte frame header that wraps every message on TCP or UDP.
SDPSECC Discovery Protocol — how the vehicle finds the station's TCP port.
SLACSignal Level Attenuation Characterization — which station this cable is plugged into.
PnCPlug & Charge — authenticating with a contract certificate instead of a card.
BPTBidirectional 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.