Skip to content

Commit 9c20e77

Browse files
committed
more types
1 parent d7bf0ed commit 9c20e77

4 files changed

Lines changed: 30 additions & 6 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "firefly-types"
3-
version = "0.5.1"
3+
version = "0.6.0"
44
rust-version = "1.82.0"
55
edition = "2021"
66
authors = ["Firefly Zero team"]

src/serial.rs

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
//! Clients (desktop app, CLI, etc) send [`Request`]s
88
//! and the runtime (device or emulator) sends back [`Response`]s.
99
use crate::encode::Encode;
10+
use alloc::boxed::Box;
11+
use alloc::string::String;
1012
use serde::{Deserialize, Serialize};
1113

1214
/// Messages that clients send into the runtime.
@@ -22,6 +24,24 @@ pub enum Request {
2224

2325
/// Turn on/off collection and sending of runtime stats.
2426
Stats(bool),
27+
28+
/// Get the full ID of the currently running app.
29+
AppId,
30+
31+
/// Take a screenshot.
32+
Screenshot,
33+
34+
/// Launch an app.
35+
Launch((String, String)),
36+
37+
/// Launch the launcher.
38+
Exit,
39+
40+
/// Send buttons input.
41+
Buttons(u8),
42+
43+
/// Send data into the running app.
44+
Data(Box<[u8]>),
2545
}
2646

2747
impl Encode<'_> for Request {}
@@ -37,8 +57,12 @@ pub enum Response {
3757
CPU(CPU),
3858
/// Linear memory used by the wasm app.
3959
Memory(Memory),
40-
/// Log record
41-
Log(alloc::string::String),
60+
/// Log record.
61+
Log(String),
62+
/// Full ID of the currently running app.
63+
AppID((String, String)),
64+
/// A generic confirmation response for a request.
65+
Ok,
4266
}
4367

4468
impl Encode<'_> for Response {}
@@ -51,7 +75,7 @@ pub enum Callback {
5175
Update,
5276
/// The `render` wasm callback.
5377
Render,
54-
/// The `render_line` wasm callback.
78+
/// DEPRECATED: The `render_line` wasm callback.
5579
RenderLine,
5680
/// The `cheat` wasm callback.
5781
Cheat,

src/spi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub enum Response<'a> {
3333
NetIncoming([u8; 6], &'a [u8]),
3434
NetNoIncoming,
3535
NetSent,
36-
Input(Option<(i16, i16)>, u8),
36+
Input(Option<(u16, u16)>, u8),
3737
}
3838

3939
impl<'a> Encode<'a> for Response<'a> {}

0 commit comments

Comments
 (0)