pub enum Request {
Hello {
version: Version,
},
Describe,
Availability,
Applies {
action: String,
},
Status,
LiveChoices {
id: String,
},
Perform {
action: String,
params: BTreeMap<String, ParamValue>,
value: Option<u16>,
},
BoundInputs {
action: String,
inputs: Vec<String>,
},
HeldInputs {
action: String,
held: Vec<String>,
},
Configure {
values: BTreeMap<String, String>,
},
ReadSignals,
Shutdown,
}Expand description
What the daemon asks an addon to do.
Deliberately not #[non_exhaustive], matching DeviceEvent and
Effect in the daemon and for the same reason: a wildcard arm is how a
newly added request gets silently ignored. Adding one should fail to compile
in every implementation that has to answer it.
Variants§
Hello
Version handshake. Always first.
Describe
Everything static about the addon: what it is and what it offers.
One request rather than six, because none of it changes while the addon runs and six round trips at startup would be six chances to be half described.
Availability
Whether it could act right now.
Applies
Whether one action is worth offering at the moment.
Status
A sentence for the interface, if it has one.
LiveChoices
The current options for a live choice source (ADR-0022).
Sent when somebody opens a picker, and at no other time — never on a timer, which would cost idle CPU for a menu nobody has open.
Perform
Do something.
Fields
params: BTreeMap<String, ParamValue>What the binding was configured with (ADR-0012).
Omitted when empty, and value when absent. Most performs are a
bare press, and "params":{},"value":null on every one of them is
noise in a log somebody is reading to find out what happened.
BoundInputs
The inputs bound to one action, in device order (006-FR-014a).
Sent unprompted whenever the set or its order changes, which is the one
place the daemon tells an addon something rather than asking it. It is
still a request on the wire — the addon answers Done — because a
second message shape would need a second reader at both ends.
Fields
HeldInputs
Which of one action’s inputs the user is holding right now.
Sent when the set changes. Empty is the ordinary case and is omitted on the wire, so an addon that never receives one has nothing held — which is also what an older host that never sends one means.
Fields
held: Vec<String>The inputs currently held, in the same vocabulary as
Self::BoundInputs.
Configure
Take these settings.
ReadSignals
Read every signal it publishes, now.
Shutdown
Stop. The addon should exit; the daemon kills it if it does not.