Feature flags

Every iso15118 feature flag, what it gates, and how to compile only the message sets and roles your target actually needs.

Flags are additive and every one gates real code. There are nineteen flags besides default.

default = ["std", "iso2", "iso20", "sdp", "slac", "evcc", "secc", "pnc"]

Environment

FlagEffect
stdstd::error::Error implementations and Ipv6Addr helpers. Turn it off for a microcontroller.

alloc is required, not a feature: decoded EXI strings cannot borrow from the input.

Roles

FlagEffect
evccThe vehicle-side session driver.
seccThe charger-side session driver.

A role driver appears only with at least one protocol generation enabled.

Protocols

FlagEffect
iso2ISO 15118-2:2014 — all 34 body messages, the ordering graph and the charging-profile rule.
iso20Shorthand for all six -20 energy-transfer schema sets.
iso20-commonISO 15118-20 CommonMessages. Implied by each of the six below.
iso20-acAC charging.
iso20-dcDC charging.
iso20-wptWireless power transfer.
iso20-acdpAutomated connection device — the pantograph.
iso20-ac-der-iecISO 15118-20 Amd 1 AC_DER_IEC: AC with distributed-energy-resource control, IEC grid codes (service id 10). Its own schema set — the AC messages as the DER schema extends them — so it does not need iso20-ac.
iso20-ac-der-saeThe same for SAE grid codes (service id 11).

There is no iso20-bpt (the BPT_* types live inside AC and DC) and no iso20-mcs (MCS runs the DC message set). A pantograph session needs iso20-acdp and iso20-dc.

FlagEffect
sdpSECC discovery: the codec and the vehicle-side retry engine.
slacISO 15118-3 frames and the matching state machines for both roles.

Security

FlagEffect
pncThe Plug & Charge signature profile and the V2G PKI. The hash and the curve are traits, so this pulls in no cryptography. Implies iso20-common.
pnc-rustcryptoA concrete backend for those traits: sha2, sha1 and hmac, p256 and p521, and aes with cbc (ISO 15118-2), aes-gcm and cfb-mode (ISO 15118-20, the TPM wrapper) for the contract-key envelopes.
pnc-rustcrypto-ed448Adds ISO 15118-20's Ed448, X448 and SHAKE256 to that backend (ed448-goldilocks, x448, pre-releases).

pnc-rustcrypto, pnc-rustcrypto-ed448, serde and tracing are the only flags that add dependencies. The backends are off by default so a secure element can implement the traits instead.

Integration

FlagEffect
serdeSerialize/Deserialize on the message types and the session state — what -20 pause and resume across a power cycle needs. Protocol and Protocols serialise as their stable short names, so serde, Display and a hand-written match produce one spelling.
tracingStructured events from the engines — message, phase, protocol, expired timer. No spans and no payload values (a SessionID or certificate identifies a person). Compiles to nothing when off.

Compiling only what you need

A DC-only embedded vehicle controller:

cargo add iso15118 --no-default-features --features evcc,iso20-dc,pnc

gets exactly that; other message sets and their grammar tables are not in the binary. See Embedded and no_std.

Additivity

Enabling a feature never removes or changes an item. CI checks every flag alone and every pair with cargo hack check --feature-powerset --depth 2 — 160 combinations — warnings denied.