# Reference protocols -- OTDP 0.2.2

The accompanying examples are fully specified synthetic authoring targets. Values and limits here belong to these examples only; they are not the user's bench limits. `examples/reference-vectors.json` gives exact representative exchanges and results.

**reference-psu:** Raw TCP with LF at the descriptor's port. `*IDN?` returns `OTDP Reference,reference-psu,SIM001,1.0`. `VOLT n` sets a 0-10 V setpoint; `VOLT?` reads it. `OUTP 0/1` sets disabled/enabled; `OUTP?` reads it. `MEAS:VOLT?` returns the setpoint when enabled, otherwise zero. These synthetic settings are exact within the declared readback tolerance; write commands have no direct response. `*TST?` returns `0`; `SYST:ERR?` returns `0,"No error"` when empty. Initial output is disabled and setpoint zero. The model makes no claim about a physical protection circuit.

**reference-controller:** Native UART JSON exactly as §6.2. Identify returns OTDP Reference/reference-controller/SIM002/1.0. `battery_voltage` reads 4.01 V. `led_state` initially off and accepts off/red/green/blue; writes acknowledge the effective value. Self-test returns pass with an empty detail list. One subscription at a time is supported, with an interval of at least 100 ms; subscribed parameters emit their current values at that interval until unsubscribed. Subscription IDs and sequence follow §7. Unadvertised verbs return UNSUPPORTED. Malformed requests do not change state.

**reference-can:** Passive standard CAN frame ID 418, classic CAN, four bytes. Bytes 0-1 are unsigned big-endian hundredths of volts; bytes 2-3 are signed big-endian tenths of amps. `04 D2 FF 9C` therefore yields 12.34 V and −10 A. Frames older than 100 ms do not satisfy the example's read policy. Identity is commissioned and never queried on the bus.

**reference-capture:** A custom line protocol on the declared serial link, demonstrating why an adapter can be read-only yet support capture. `ID?\n` returns `OTDP Reference,reference-capture,SIM003,1.0\n`. `V?\n` returns `3300\n` in millivolts; the adapter reports 3.3 V. `CAP? n\n` accepts integer n=1…1024 and returns one LF-terminated comma-separated line of decimal samples `1,2,…,n`, in volts at a 0.001 s interval. `ERR\n` is a device rejection for an unsupported command/count. Capture starts when CAP is sent and has no cancellation command. A timeout after CAP is dispatched is unknown. The adapter converts exactly n finite numbers to waveform_f64le through the host artifact writer. Capture byte budget must accommodate n×8 before transmission. No escaping, checksums, unsolicited frames, streaming, reset or setters exist in this synthetic protocol. Connection loss requires a fresh host instance; no retry/replay is defined.

**reference-hid-meter:** A USB-HID-class power meter behind a pinned provider contract, demonstrating the `custom` transport's declaration. The descriptor pins `reference-provider.json` (feature `otdp.transport.reference-hid/1.0.0`); the contract's grammar -- `hid_output_report` and `hid_input_report` -- is the entire protocol surface, exercised offline by exact-dict transfer scripting rather than wire vectors. Identity is adapter-sourced. `bus_power` is a read-only measurement in watts. No wire protocol, host implementation or hardware qualification is defined by this example; it is not an admitted host provider.

**reference-rawlink:** A `custom` transport with no `provider` object, demonstrating the honestly-incomplete state specification §6.4 keeps admitted. The connection key names a commissioned link whose backing is undocumented; no provider contract is declared, none may be implied, and no capability beyond `identify` is advertised. The descriptor is structurally admissible and an agent cannot mark it complete using the generic services alone. There is no wire protocol to define -- that is the point of the example.
