#[non_exhaustive]pub enum ClientMessage {
Hello {
api: u32,
client: String,
},
SetLock {
on: bool,
},
GetState,
SetIcon {
id: String,
svg: Option<String>,
png: Option<String>,
},
SetCommands {
app: App,
commands: Vec<Command>,
},
SetEnvironments {
environments: Vec<Environment>,
},
SetEnvironment {
id: String,
},
SetUnavailable {
commands: Vec<String>,
},
Focus {
on: bool,
},
SetLcd {
brightness: Option<u8>,
text_size: Option<TextSize>,
theme: Option<Theme>,
},
GetScreen,
Unknown,
}Expand description
What a client sends.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Hello
SetLock
GetState
SetIcon
API 2: an icon for tiles and the header, kept per connection under id. One of svg
(SVG source) and png (base64).
SetCommands
API 2: the application and its command catalogue; replaces the previous one.
SetEnvironments
API 2: the environments with their key assignments; replaces the previous ones.
Fields
environments: Vec<Environment>SetEnvironment
API 2: show environment id (from set_environments); its keys run their commands.
API 2: the commands that cannot run now (since 0.2.1); their tiles are drawn greyed out. Replaces the previous list; an empty one means every command can run.
Focus
API 2: this client’s window got (true) or lost (false) the input focus.
SetLcd
API 2: change the LCD settings (for every client) until smed restarts.
GetScreen
API 2: ask for the current LCD page as a PNG; smed answers with screen.
Unknown
A message type smed does not know (from a newer client); smed ignores it.