flipper-rpc 0.9.5

Rust bindings and serial transport helpers for the Flipper Zero RPC protocol.
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScreenFrame {
    #[prost(bytes = "vec", tag = "1")]
    pub data: ::prost::alloc::vec::Vec<u8>,
    #[prost(enumeration = "ScreenOrientation", tag = "2")]
    pub orientation: i32,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StartScreenStreamRequest {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StopScreenStreamRequest {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SendInputEventRequest {
    #[prost(enumeration = "InputKey", tag = "1")]
    pub key: i32,
    #[prost(enumeration = "InputType", tag = "2")]
    pub r#type: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartVirtualDisplayRequest {
    /// *< Optional: screen frame to show
    #[prost(message, optional, tag = "1")]
    pub first_frame: ::core::option::Option<ScreenFrame>,
    /// *< Optional: send flipper input
    #[prost(bool, tag = "2")]
    pub send_input: bool,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StopVirtualDisplayRequest {}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InputKey {
    Up = 0,
    Down = 1,
    Right = 2,
    Left = 3,
    Ok = 4,
    Back = 5,
}
impl InputKey {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Up => "UP",
            Self::Down => "DOWN",
            Self::Right => "RIGHT",
            Self::Left => "LEFT",
            Self::Ok => "OK",
            Self::Back => "BACK",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "UP" => Some(Self::Up),
            "DOWN" => Some(Self::Down),
            "RIGHT" => Some(Self::Right),
            "LEFT" => Some(Self::Left),
            "OK" => Some(Self::Ok),
            "BACK" => Some(Self::Back),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InputType {
    /// *< Press event, emitted after de-bounce
    Press = 0,
    /// *< Release event, emitted after de-bounce
    Release = 1,
    /// *< Short event, emitted after InputTypeRelease done withing INPUT_LONG_PRESS interval
    Short = 2,
    /// *< Long event, emitted after INPUT_LONG_PRESS interval, asynchronous to InputTypeRelease
    Long = 3,
    /// *< Repeat event, emitted with INPUT_REPEATE_PRESS period after InputTypeLong event
    Repeat = 4,
}
impl InputType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Press => "PRESS",
            Self::Release => "RELEASE",
            Self::Short => "SHORT",
            Self::Long => "LONG",
            Self::Repeat => "REPEAT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PRESS" => Some(Self::Press),
            "RELEASE" => Some(Self::Release),
            "SHORT" => Some(Self::Short),
            "LONG" => Some(Self::Long),
            "REPEAT" => Some(Self::Repeat),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ScreenOrientation {
    /// *< Horizontal
    Horizontal = 0,
    /// *< Horizontal flipped (180)
    HorizontalFlip = 1,
    /// *< Vertical (90)
    Vertical = 2,
    /// *< Vertical flipped (270)
    VerticalFlip = 3,
}
impl ScreenOrientation {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Horizontal => "HORIZONTAL",
            Self::HorizontalFlip => "HORIZONTAL_FLIP",
            Self::Vertical => "VERTICAL",
            Self::VerticalFlip => "VERTICAL_FLIP",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "HORIZONTAL" => Some(Self::Horizontal),
            "HORIZONTAL_FLIP" => Some(Self::HorizontalFlip),
            "VERTICAL" => Some(Self::Vertical),
            "VERTICAL_FLIP" => Some(Self::VerticalFlip),
            _ => None,
        }
    }
}