Skip to main content

Module session

Module session 

Source
Expand description

High-level session management and connection lifecycle.

ProtocolSession is the central state machine for communicating with a RØDECaster. It manages device discovery, keeps track of the active layout, decodes incoming payloads into DeviceEvents, and encodes Commands into wire payloads.

§The Session Lifecycle

  1. Initialization: Create a new session with ProtocolSession::new. At this stage, the session is waiting for the device to introduce itself.
  2. Full Sync: When first connected (or after a handshake), the device sends a full state snapshot (fullSync). Ingesting this yields SessionUpdate::Ready, which populates DeviceCapabilities and yields initial_events describing the current state of all faders, mutes, and routing.
  3. Steady State: While connected, incoming messages yield SessionUpdate::Event for real-time updates (fader movements, knob adjustments, button presses). You can also call ProtocolSession::encode to send commands to the device.
  4. Resync: If the device tree topology changes (e.g. major mode switch), the session yields SessionUpdate::NeedsFullSync and resets its layout. Your transport should request a fresh full sync before resuming commands.

Structs§

ProtocolSession
Stateful, transport-independent RODECaster protocol session.

Enums§

SessionError
Failure to decode a payload, establish a layout, or encode a command.
SessionUpdate
Result of ingesting one complete JUCE change-frame payload.