FrameTypeA frame's TYPE byte

VariantOpcodeMeaning
Move0x01Cursor, wheel or pan motion, tagged by axis (PC to box).
Inject0x03Class-tagged button, key, or media override (PC to box).
Reset0x04Clear all injection (PC to box).
Query0x05Request a state snapshot (PC to box).
Resp0x06Reply to a query, with the request's seq echoed (box to PC).
RebootDl0x07Reboot a chip to download or run (PC to box).
Log0x08Unsolicited box diagnostics (box to PC).
Led0x09Drive a status LED (PC to box).
Lock0x0AWeigh a native input: block, pass, or amplify (PC to box).
Catch0x0BAdd or remove one subscription-table entry (PC to box).
MotionEvent0x0CAn unsolicited relative-axis catch event, dx/dy/dz/pan (box to PC).
UsageEvent0x0FAn unsolicited held-usage snapshot: button, key, or media (box to PC).
Option0x11Set a persistent box option by id, e.g. imperfect-clone opt-in or movement riding (PC to box).
ClipAppend0x12Append buffered-clip entries to the box's clip ring; seq = append seq (PC to box).
ClipCtrl0x13Drive clip playback: start, stop, pause, resume, restart, toggle, clear, finalize (PC to box).
ClipSet0x14Set one clip setting: auto-lock, loop, retain, or ride (PC to box).
ClipTrigger0x15Bind a native edge or a matched packet to a clip engine verb (PC to box).
TrafficEvent0x16An unsolicited byte-oriented catch event: HID, vendor, control, emit, or bus (box to PC).
Update0x17Stage or activate firmware on either chip (PC to box).
UpdateResp0x18The reply to one update op (box to PC).
Raw0x19Raw bytes on a cloned endpoint (PC to box).
Transfer0x1AOne control transfer against the real device (PC to box).
TransferResp0x1BThe native reply to a Transfer (box to PC).
Rewrite0x1CAdd, overwrite or remove one rewrite rule (PC to box).
Patch0x1DStore, apply or clear a descriptor patch (PC to box).
Transform0x1EAdd, overwrite or remove one field transform (PC to box).

DecodedFrameOne parsed frame

FieldTypeDescription
tyFrameTypeThe frame's opcode.
sequ8The sequence byte; a reply echoes the request's value.
payloadVec<u8>The raw payload bytes, already CRC-checked.
EXAMPLE
use medius::{FrameType, DecodedFrame};

// Byte -> variant is fallible; an unknown opcode is an Err.
assert_eq!(FrameType::try_from(0x06), Ok(FrameType::Resp));
assert!(FrameType::try_from(0xFF).is_err());

// Variant -> byte always works.
assert_eq!(u8::from(FrameType::Log), 0x08);

// Read a decoded frame by field: a MOTION_EVENT at ts_us=1000, host chip clock, carrying dx=5, dy=-5, dz=1, pan=0.
let frame = DecodedFrame { ty: FrameType::MotionEvent, seq: 7, payload: vec![0xE8, 3, 0, 0, 0, 5, 0, 0xFB, 0xFF, 1, 0, 0, 0] };
println!("{:?} seq={} {} bytes", frame.ty, frame.seq, frame.payload.len());

The wire layout is on the frame page. Requests and Diagnostics cover everyday work.