Skip to main content
The EVCore host protocol is the line-based interface between the Brick firmware and a host such as EVCore Studio. It is implemented in firmware/src/evcore_console.c and software/evcore-studio/public/transport.js. The current version is protocol 2. This page describes transport framing, request tags, the full command set, and reply formats.

Transport and framing

The protocol is written for a byte stream and does not depend on the transport. The intended transport is USB CDC over USB-C, which is not implemented yet (roadmap item 77). Today it runs over the simulator’s stdin/stdout.
  • A command is printable ASCII (32 to 126), at most 63 bytes, and ends with LF or CRLF.
  • A lone CR, a control byte, or an overlong line makes the whole line invalid.
  • After a receive error the transport calls EV_ConsoleTransportLost, which discards input through the next LF.
  • Replies are single lines. The longest reply is REPORT JSON (under 2,048 bytes).

Request tags (protocol 2)

A host prefixes each command with # and 1 to 9 digits, then a space:
The device repeats the tag exactly as sent (leading zeros included) on every reply line, and ends the reply with a tagged END line:
This lets the host know when a multi-line reply is complete, and prevents a late reply to a timed-out request from being mistaken for the answer to a newer one. Untagged commands behave as protocol 1: no prefix and no END, so a person can still type at a terminal. A malformed tag gets the untagged reply ERR invalid tag. An invalid or oversized line also returns ERR invalid or oversized command, because its tag cannot be trusted. A host waiting for a tagged reply treats either as a timeout, meaning the device state is unconfirmed.

Commands

Anything else gets ERR unknown command. ERR response unavailable means a reply could not be formatted within its buffer. That should not happen, and it is reported rather than truncated.

Reply formats

Fields are space-separated key=value pairs. Keys are [a-z_]+. The last field may contain spaces (for example reason=within profile limits), so parse values up to the next key= boundary.

INFO

The identifier fields are [A-Za-z0-9._-]{1,32} or unknown.

PROFILES

name is the name the device’s screen shows (or Profile <id>) and runs to the end of the line.

STATUS (also the first line of REPORT)

reason reads not complete until a test finishes. The bit meanings of outputs and faults are the EV_OUT_* and EV_FAULT_* constants in evcore_safety.h.

REPORT sample line

Kinds: 0 voltage, 1 current, 2 resistance, 3 frequency, 4 back-EMF. Flags: 1 invalid, 2 clipped, 4 uncalibrated.

REPORT phase line

REPORT fault line (one per record)

Fault records explain why a test has no conclusion. They describe the instrument, its interlocks, its setup, or the operator, never the device under test. The catalog of codes, names, and evidence meanings is in firmware/src/evcore_fault.c. Codes are stable and only ever appended.

CODE reply

This is the same text the device’s local screen shows. Vehicle codes (M, S) appear only for FAIL; a result without a conclusion carries only E codes.

SCREEN

Text fields run to the end of the line. top and total place the visible window in the page, for a scroll bar. This mirrors the local screen (firmware/src/evcore_ui.c) so a host can show it; it cannot press the knob. The knob and the STOP button are physical controls and have no protocol command.

SAFETY

A trip is one fault episode; faults added while already faulted accumulate into it. The recovery fields record what the last successful reset cleared and the timestamp of the healthy input snapshot that allowed it.

LOG

Event codes: 0 boot, 1 state, 2 fault, 3 start, 4 sample, 5 result, 6 cancel, 7 reset.

REPORT JSON (report schema 1)

Each fault_records entry has the same fields as the REPORT fault line, plus value (a number, or null when none applies). fault_records_dropped counts records that did not fit (at most 8 are kept). Non-finite numbers are never written; a report containing one is refused. mismatch_percent is null when no comparison applies. knowledge is the diagnostic code library version; calibration is null until that subsystem exists.

Not yet in the protocol

The following capabilities are planned but not yet implemented:
  • Capability discovery (CAPS, roadmap item 59)
  • Host lease so a remote-started test stops if the host goes silent (item 58)
  • Progress events (item 60)
  • Live measurement streaming (item 61)
  • Knowledge and calibration queries and uploads (items 62 and 63)
  • Authentication (item 64)
Until then, tests are bounded by device-owned timeouts and the device’s local STOP. EVCore Studio requires protocol 2 and rejects older firmware.