mirror of
https://github.com/cccb/servicepoint.git
synced 2025-01-18 10:00:14 +01:00
add BitmapLegacy
This commit is contained in:
parent
c7456f0a67
commit
638249c2b9
|
@ -26,6 +26,8 @@ pub enum Command {
|
|||
FadeOut,
|
||||
CharBrightness(Window, Vec<Brightness>),
|
||||
Brightness(Brightness),
|
||||
#[deprecated]
|
||||
BitmapLegacy,
|
||||
BitmapLinear(Offset, BitVec),
|
||||
BitmapLinearAnd(Offset, BitVec),
|
||||
BitmapLinearOr(Offset, BitVec),
|
||||
|
@ -53,6 +55,8 @@ impl Into<Packet> for Command {
|
|||
Command::Clear => command_code_only(CommandCode::Clear),
|
||||
Command::FadeOut => command_code_only(CommandCode::FadeOut),
|
||||
Command::HardReset => command_code_only(CommandCode::HardReset),
|
||||
#[allow(deprecated)]
|
||||
Command::BitmapLegacy => command_code_only(CommandCode::BitmapLegacy),
|
||||
|
||||
Command::CharBrightness(window, payload) => {
|
||||
window_and_payload(CommandCode::CharBrightness, window, payload)
|
||||
|
@ -159,7 +163,10 @@ impl TryFrom<Packet> for Command {
|
|||
payload.clone(),
|
||||
))
|
||||
}
|
||||
CommandCode::BitmapLegacy => { todo!() }
|
||||
#[allow(deprecated)]
|
||||
CommandCode::BitmapLegacy => {
|
||||
Ok(Command::BitmapLegacy)
|
||||
}
|
||||
CommandCode::BitmapLinear => { todo!() }
|
||||
CommandCode::BitmapLinearWin => {
|
||||
Ok(Command::BitmapLinearWin(
|
||||
|
|
|
@ -10,6 +10,7 @@ pub enum CommandCode {
|
|||
Brightness = 0x0007,
|
||||
HardReset = 0x000b,
|
||||
FadeOut = 0x000d,
|
||||
#[deprecated]
|
||||
BitmapLegacy = 0x0010,
|
||||
BitmapLinear = 0x0012,
|
||||
BitmapLinearWin = 0x0013,
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#[derive(Debug)]
|
||||
pub struct Header(pub u16, pub u16, pub u16, pub u16, pub u16);
|
||||
|
||||
pub type Payload = Vec<u8>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Packet(pub Header, pub Payload);
|
||||
|
||||
impl Into<Vec<u8>> for Packet {
|
||||
|
|
Loading…
Reference in a new issue