Skip to main content

Crate medius

Crate medius 

Source
Expand description

Host control library for the medius transparent mouse passthrough box.

Re-exports§

pub use types::Action;
pub use types::Axis;
pub use types::Bearing;
pub use types::BearingMode;
pub use types::Blanket;
pub use types::BusEvent;
pub use types::Button;
pub use types::CLIP_EDGES_MAX;
pub use types::CLIP_ENTRY_MAX;
pub use types::CLIP_RAW_MAX;
pub use types::Caps;
pub use types::Capture;
pub use types::CatchClass;
pub use types::CatchEntry;
pub use types::CatchEvent;
pub use types::CatchFilter;
pub use types::CatchState;
pub use types::ChipFirmware;
pub use types::Class;
pub use types::ClipAction;
pub use types::ClipBuilder;
pub use types::ClipFrame;
pub use types::ClipPacketTrigger;
pub use types::ClipPacketTriggerEntry;
pub use types::ClipSettings;
pub use types::ClipState;
pub use types::ClipStatus;
pub use types::ClipTrigger;
pub use types::ClockDomain;
pub use types::ClockEstimate;
pub use types::ControlStatus;
pub use types::CountersSnapshot;
pub use types::DeviceInfo;
pub use types::DeviceKind;
pub use types::Direction;
pub use types::DirectionMeaning;
pub use types::Edge;
pub use types::EmitPace;
pub use types::EmitPaceStatus;
pub use types::FirmwareInfo;
pub use types::Health;
pub use types::ImageState;
pub use types::ImperfectStatus;
pub use types::Input;
pub use types::InputEvent;
pub use types::KbdCaps;
pub use types::Key;
pub use types::LedMode;
pub use types::LedTarget;
pub use types::LockEntry;
pub use types::LockScope;
pub use types::LockTarget;
pub use types::Locks;
pub use types::LogLevel;
pub use types::LogLine;
pub use types::MediaKey;
pub use types::Motion;
pub use types::MotionEvent;
pub use types::MouseCaps;
pub use types::MoveTiming;
pub use types::Patch;
pub use types::PatchEntry;
pub use types::PatchKey;
pub use types::PatchSection;
pub use types::PatchSet;
pub use types::PendingMotion;
pub use types::PortInfo;
pub use types::Rate;
pub use types::RebootTarget;
pub use types::RenderMode;
pub use types::RenderStatus;
pub use types::RewriteAction;
pub use types::RewriteClass;
pub use types::RewriteEntry;
pub use types::RewriteKey;
pub use types::RewriteRule;
pub use types::RewriteTable;
pub use types::Setup;
pub use types::SpreadStatus;
pub use types::Stamped;
pub use types::Stats;
pub use types::Timeline;
pub use types::Timestamped;
pub use types::TrafficClass;
pub use types::TrafficEvent;
pub use types::TransferOutcome;
pub use types::TransferStatus;
pub use types::Transform;
pub use types::TransformKey;
pub use types::TransformOp;
pub use types::Transforms;
pub use types::UpdateProgress;
pub use types::UpdateStatus;
pub use types::UpdateTarget;
pub use types::Usage;
pub use types::UsageSnapshot;
pub use types::Version;

Modules§

types

Structs§

AsyncClipHandle
Async view over a ClipHandle (§3.11); see AsyncDevice::clip.
AsyncDevice
Async view over a Device: the same Link core. Queries are async and await the correlated RESP with the default timeout; commands send at once.
BoxInfo
Discovered box: serial port, firmware version, and the device it clones.
ClipHandle
Handle to one box’s buffered-clip playback, from Device::clip. Clones share the append-sequence counter.
DecodedFrame
Decoded frame.
Device
Control handle for one medius box.
EventStream
Live stream of CatchEvents from the box (CATCH, §3.9).
InputStream
Live stream of decoded InputEvents: press and release edges, and motion.
LogStream
Receiver for the device LOG stream.
MockBox
Scriptable fake box for hardware-free tests (feature = mock).

Enums§

Error
Crate-wide error type.
FrameType
A frame opcode (the TYPE byte, §3 / §4).

Constants§

BEARING_WINDOW_DEFAULT
Bearing window at boot, before any host sets one.
CATCH_MAX_ENTRIES
Entries the box’s subscription table holds (CATCH_TAB_MAX). The box refuses more and signals it only in RESP(CATCH).table_full.
CLIP_PKT_MATCH_POOL
Match bytes the box holds across every packet trigger (CLIP_PKT_MATCH_POOL); it bounds RESP(CLIP) to one frame.
CLIP_PKT_TRIG_MAX
Packet triggers the box holds beside its input bindings (CLIP_PKT_TRIG_MAX).
DEFAULT_KEEPALIVE_CADENCE
Default keepalive cadence for re-sending a held override.
DEFAULT_QUERY_TIMEOUT
Default RESP wait before Error::QueryTimeout.
DEFAULT_TRANSFER_TIMEOUT
How long a transfer waits for the device’s reply before Error::QueryTimeout. Longer than DEFAULT_QUERY_TIMEOUT, as a real device can be slower than a box-local query.
EMIT_MAX_HZ
Emit-rate ceiling in Hz (the 1 ms frame-clock limit); the firmware clamps a higher EmitPace::Fixed rate to it.
LOCK_SCALE_BLOCK
LOCK scale (§3.8), an i16 on the wire: percent of the physical value kept. 0 blocks, 100 passes untouched, above 100 amplifies, up to 255 (2.55x).
LOCK_SCALE_MAX
LOCK_SCALE_MIN
Most negative LOCK scale. A negative scale weighs the physical value and reverses it: -100 inverts, -50 keeps half, reversed. The slot is picked by the delta’s sign before the weigh, so a directional negative is well defined. A momentary usage carries one bit, so it takes 0 ..= LOCK_SCALE_MAX.
LOCK_SCALE_PASS
MAX_PAYLOAD
Maximum payload length (§2); a larger LEN is rejected as bogus.
NAME_MAX
Max box-name length in bytes (printable ASCII), the firmware’s CTRL_NAME_MAX.
PATCH_MAX_ENTRIES
Entries the box’s descriptor-patch store holds (PATCH_MAX); past it a patch is refused, flagged in RESP(PATCHES).table_full.
PKT_MATCH_MAX
Max match/mask bytes the box compares against a packet head (PKT_MATCH_MAX), for rewrite rules and clip packet triggers alike.
PROTO_VER
Control-protocol version in RESP(VERSION) (§4.1). The handshake refuses a box reporting any other with Error::BadProtoVer; update that box from https://medius.k4tech.net/dashboard.
REWRITE_MATCH_MAX
Max match/mask bytes one rewrite rule compares (REWRITE_MATCH_MAX).
REWRITE_MAX_ENTRIES
Entries the box’s rewrite table holds (REWRITE_TAB_MAX); past it a rule is refused, flagged in RESP(REWRITE).table_full.
REWRITE_PAYLOAD_POOL
Payload bytes the rewrite table holds across all rules (REWRITE_POOL), match and mask bytes excluded; a rule that does not fit is refused, flagged in RESP(REWRITE).table_full.
TRANSFORM_MAX_ENTRIES
Entries the box’s transform table holds (CTRL_TRANSFORM_MAXN); past it an entry is refused, flagged in RESP(TRANSFORMS).table_full.

Functions§

find_medius
Medius boxes: USB serial ports with the WCH vendor id and CH343 product id.

Type Aliases§

Result
Crate-wide Result alias.