Skip to main content

Module device

Module device 

Source
Expand description

Background engine (feature device): owns the MIDI connection (or a capture replay), finds and connects to the pedal, performs the startup sync, sends edits and reports every message.

With feature ble the engine also finds the pedal over Bluetooth LE MIDI (the pedal’s Wireless setting). A Bluetooth pedal is listed as a port named "<name> (Bluetooth)" and behaves like a USB one; auto-connect prefers USB when both are there.

Device::spawn starts the engine on its own thread and returns a Device handle. Send it Commands (or use the helper methods) and read Updates from it. The engine only moves bytes; apply Update::Messages to a DeviceState to follow the pedal’s state, and reset that state on Update::Reset.

SysEx requests and writes go through a RequestQueue (one in flight, 1 s reply timeout, docs/03). Live CCs/PCs (Device::send) bypass it. The pedal never echoes host messages, so every message the engine sends is reported as an Update::Message with Origin::Host; applying those keeps a DeviceState in step with your own edits.

Dropping the Device disconnects and stops the engine thread.

Structs§

Config
Engine settings.
Device
Handle to the engine thread. Cheap methods; nothing blocks except the recv* calls.

Enums§

Command
Status
Update