Added support for Ajazz AKP03E

This commit is contained in:
Andrey Viktorov authored and ninjadev64 committed 2025-02-25 18:02:54 +00:00
1 parent 7dccee852d
commit ee06e69bf2
6 files changed
+47 -34

No files matched your search

+4
View File
@@ -14,6 +14,7 @@ SUBSYSTEM=="usb", ATTR{idVendor}=="5548", ATTR{idProduct}=="6674", MODE="0660",
SUBSYSTEM=="usb", ATTR{idVendor}=="0300", ATTR{idProduct}=="1003", MODE="0660", TAG+="uaccess", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0300", ATTR{idProduct}=="1010", MODE="0660", TAG+="uaccess", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0300", ATTR{idProduct}=="1020", MODE="0660", TAG+="uaccess", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0300", ATTR{idProduct}=="3002", MODE="0660", TAG+="uaccess", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", MODE="0660", TAG+="uaccess", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0063", MODE="0660", TAG+="uaccess", GROUP="plugdev"
@@ -31,6 +32,7 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6674", MODE="0660"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1003", MODE="0660", TAG+="uaccess", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1010", MODE="0660", TAG+="uaccess", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1020", MODE="0660", TAG+="uaccess", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="3002", MODE="0660", TAG+="uaccess", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="0060", MODE="0660", TAG+="uaccess", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="0063", MODE="0660", TAG+="uaccess", GROUP="plugdev"
@@ -48,6 +50,7 @@ KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="5548", ATTR{idProduct}=
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0300", ATTR{idProduct}=="1003", MODE="0660", TAG+="uaccess", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0300", ATTR{idProduct}=="1010", MODE="0660", TAG+="uaccess", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0300", ATTR{idProduct}=="1020", MODE="0660", TAG+="uaccess", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0300", ATTR{idProduct}=="3002", MODE="0660", TAG+="uaccess", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", MODE="0660", TAG+="uaccess", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0063", MODE="0660", TAG+="uaccess", GROUP="plugdev"
@@ -65,3 +68,4 @@ KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="5548", ATTRS{idProduct
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1003", MODE="0660", TAG+="uaccess", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1010", MODE="0660", TAG+="uaccess", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1020", MODE="0660", TAG+="uaccess", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="3002", MODE="0660", TAG+="uaccess", GROUP="plugdev"
+1
View File
@@ -78,5 +78,6 @@ As it stands, this library should support the following devices:
- Ajazz AKP153E (thanks to [@teras](https://github.com/teras))
- Ajazz AKP153R (thanks to [@teras](https://github.com/teras), [@damnkrat](https://github.com/damnkrat) and [@4ndv](https://github.com/4ndv))
- Ajazz AKP815 (thanks to [@teras](https://github.com/teras))
- Ajazz AKP03E (thanks to [@4ndv](https://github.com/4ndv) and [@geekosaurusR3x](https://github.com/geekosaurusR3x))
- Ajazz AKP03R (thanks to [@4ndv](https://github.com/4ndv))
- MiraBox HSV293S (thanks to [@czyz](https://github.com/czyz))
+2 -2
View File
@@ -222,7 +222,7 @@ impl AsyncDeviceStateReader {
StreamDeckInput::ButtonStateChange(buttons) => {
for (index, (their, mine)) in zip(buttons.iter(), my_states.buttons.iter()).enumerate() {
match self.device.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
if *their {
updates.push(DeviceStateUpdate::ButtonDown(index as u8));
updates.push(DeviceStateUpdate::ButtonUp(index as u8));
@@ -254,7 +254,7 @@ impl AsyncDeviceStateReader {
StreamDeckInput::EncoderStateChange(encoders) => {
for (index, (their, mine)) in zip(encoders.iter(), my_states.encoders.iter()).enumerate() {
match self.device.kind {
Kind::Akp03R => {
Kind::Akp03E | Kind::Akp03R => {
if *their {
updates.push(DeviceStateUpdate::EncoderDown(index as u8));
updates.push(DeviceStateUpdate::EncoderUp(index as u8));
+13 -5
View File
@@ -43,6 +43,9 @@ pub const PID_AJAZZ_AKP153E: u16 = 0x1010;
/// Product ID of Ajazz AKP153R Desk Controller
pub const PID_AJAZZ_AKP153R: u16 = 0x1020;
/// Product ID of Ajazz AKP03E Desk Controller
pub const PID_AJAZZ_AKP03E: u16 = 0x3002;
/// Product ID of Ajazz AKP03R Desk Controller
pub const PID_AJAZZ_AKP03R: u16 = 0x1003;
@@ -84,6 +87,8 @@ pub enum Kind {
Akp153R,
/// Ajazz AKP815 Desk Controller
Akp815,
/// Ajazz AKP03E Desk Controller
Akp03E,
/// Ajazz AKP03R Desk Controller
Akp03R,
/// MiraBox HSV293S
@@ -113,6 +118,7 @@ impl Kind {
PID_AJAZZ_AKP153E => Some(Kind::Akp153E),
PID_AJAZZ_AKP153R => Some(Kind::Akp153R),
PID_AJAZZ_AKP815 => Some(Kind::Akp815),
PID_AJAZZ_AKP03E => Some(Kind::Akp03E),
PID_AJAZZ_AKP03R => Some(Kind::Akp03R),
PID_MIRABOX_HSV293S => Some(Kind::MiraBoxHSV293S),
_ => None,
@@ -139,6 +145,7 @@ impl Kind {
Kind::Akp815 => PID_AJAZZ_AKP815,
Kind::Akp153E => PID_AJAZZ_AKP153E,
Kind::Akp153R => PID_AJAZZ_AKP153R,
Kind::Akp03E => PID_AJAZZ_AKP03E,
Kind::Akp03R => PID_AJAZZ_AKP03R,
Kind::MiraBoxHSV293S => PID_MIRABOX_HSV293S,
}
@@ -161,6 +168,7 @@ impl Kind {
Kind::Akp815 => AJAZZ_VENDOR_ID_1,
Kind::Akp153E => AJAZZ_VENDOR_ID_2,
Kind::Akp153R => AJAZZ_VENDOR_ID_2,
Kind::Akp03E => AJAZZ_VENDOR_ID_2,
Kind::Akp03R => AJAZZ_VENDOR_ID_2,
Kind::MiraBoxHSV293S => AJAZZ_VENDOR_ID_1,
}
@@ -176,7 +184,7 @@ impl Kind {
Kind::Neo | Kind::Plus => 8,
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::MiraBoxHSV293S => 15 + 3,
Kind::Akp815 => 15,
Kind::Akp03R => 6 + 3,
Kind::Akp03E | Kind::Akp03R => 6 + 3,
}
}
@@ -190,7 +198,7 @@ impl Kind {
Kind::Neo | Kind::Plus => 2,
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::MiraBoxHSV293S => 3,
Kind::Akp815 => 5,
Kind::Akp03R => 3,
Kind::Akp03E | Kind::Akp03R => 3,
}
}
@@ -204,7 +212,7 @@ impl Kind {
Kind::Neo | Kind::Plus => 4,
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::MiraBoxHSV293S => 6,
Kind::Akp815 => 3,
Kind::Akp03R => 3,
Kind::Akp03E | Kind::Akp03R => 3,
}
}
@@ -212,7 +220,7 @@ impl Kind {
pub fn encoder_count(&self) -> u8 {
match self {
Kind::Plus => 4,
Kind::Akp03R => 3,
Kind::Akp03E | Kind::Akp03R => 3,
_ => 0,
}
}
@@ -300,7 +308,7 @@ impl Kind {
mirror: ImageMirroring::None,
},
Kind::Akp03R => ImageFormat {
Kind::Akp03E | Kind::Akp03R => ImageFormat {
mode: ImageMode::JPEG,
size: (60, 60),
rotation: ImageRotation::Rot0,
+25 -25
View File
@@ -160,7 +160,7 @@ impl StreamDeck {
/// Returns serial number of the device
pub fn serial_number(&self) -> Result<String, StreamDeckError> {
match self.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
let serial = self.device.get_serial_number_string()?;
match serial {
Some(serial) => {
@@ -200,7 +200,7 @@ impl StreamDeck {
Ok(extract_str(&bytes[5..])?)
}
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
let bytes = get_feature_report(&self.device, 0x01, 20)?;
Ok(extract_str(&bytes[0..])?)
}
@@ -219,7 +219,7 @@ impl StreamDeck {
}
self.initialized.store(true, Ordering::Release);
match self.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
let mut buf = vec![0x00, 0x43, 0x52, 0x54, 0x00, 0x00, 0x44, 0x49, 0x53];
ajazz_extend_packet(&self.kind, &mut buf);
write_data(&self.device, buf.as_slice())?;
@@ -279,7 +279,7 @@ impl StreamDeck {
Ok(StreamDeckInput::ButtonStateChange(read_button_states(&self.kind, &states)))
}
Kind::Akp03R => {
Kind::Akp03E | Kind::Akp03R => {
let data = read_data(&self.device, 512, timeout)?;
if data[0] == 0 {
@@ -316,7 +316,7 @@ impl StreamDeck {
Ok(send_feature_report(&self.device, buf.as_slice())?)
}
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
self.set_brightness(100)?;
self.clear_all_button_images()?;
Ok(())
@@ -346,7 +346,7 @@ impl StreamDeck {
Ok(send_feature_report(&self.device, buf.as_slice())?)
}
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
let mut buf = vec![0x00, 0x43, 0x52, 0x54, 0x00, 0x00, 0x4c, 0x49, 0x47, 0x00, 0x00, percent];
ajazz_extend_packet(&self.kind, &mut buf);
@@ -371,8 +371,8 @@ impl StreamDeck {
return Err(StreamDeckError::InvalidKeyIndex);
}
// Key count is 9 for Akp03R, but only the first 6 have screens, so don't output anything after 6
if self.kind == Kind::Akp03R && key > 6 {
// Key count is 9 for Akp03*, but only the first 6 have screens, so don't output anything after 6
if (self.kind == Kind::Akp03E || self.kind == Kind::Akp03R) && key > 6 {
return Ok(());
}
@@ -391,7 +391,7 @@ impl StreamDeck {
}
match self.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
let mut buf = vec![
0x00,
0x43,
@@ -425,7 +425,7 @@ impl StreamDeck {
Kind::Mini | Kind::MiniMk2 => vec![0x02, 0x01, page_number as u8, 0, if last_package { 1 } else { 0 }, key + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => vec![0x00],
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => vec![0x00],
_ => vec![
0x02,
@@ -565,10 +565,10 @@ impl StreamDeck {
pub fn clear_button_image(&self, key: u8) -> Result<(), StreamDeckError> {
self.initialize()?;
match self.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
let key = if self.kind == Kind::Akp815 {
inverse_key_index(&self.kind, key)
} else if self.kind == Kind::Akp03R {
} else if self.kind == Kind::Akp03E || self.kind == Kind::Akp03R {
key
} else {
elgato_to_ajazz153(&self.kind, key)
@@ -593,10 +593,10 @@ impl StreamDeck {
self.initialize()?;
match self.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::MiraBoxHSV293S => self.clear_button_image(0xff),
Kind::Akp03R => {
Kind::Akp03E | Kind::Akp03R => {
self.clear_button_image(0xFF)?;
// Akp03R requires STP to commit clearing the screen
// Akp03* requires STP to commit clearing the screen
let mut buf = vec![0x00, 0x43, 0x52, 0x54, 0x00, 0x00, 0x53, 0x54, 0x50];
ajazz_extend_packet(&self.kind, &mut buf);
write_data(&self.device, buf.as_slice())?;
@@ -625,7 +625,7 @@ impl StreamDeck {
pub fn set_logo_image(&self, image: DynamicImage) -> Result<(), StreamDeckError> {
self.initialize()?;
match self.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => (),
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => (),
_ => return Err(StreamDeckError::UnsupportedOperation),
}
@@ -701,13 +701,13 @@ impl StreamDeck {
let image_report_length = match self.kind {
Kind::Original => 8191,
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::MiraBoxHSV293S => 513,
Kind::Akp03R => 1025,
Kind::Akp03E | Kind::Akp03R => 1025,
_ => 1024,
};
let image_report_header_length = match self.kind {
Kind::Original | Kind::Mini | Kind::MiniMk2 => 16,
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => 1,
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => 1,
_ => 8,
};
@@ -761,7 +761,7 @@ impl StreamDeck {
pub fn sleep(&self) -> Result<(), StreamDeckError> {
self.initialize()?;
match self.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
let mut buf = vec![0x00, 0x43, 0x52, 0x54, 0x00, 0x00, 0x48, 0x41, 0x4e];
ajazz_extend_packet(&self.kind, &mut buf);
@@ -779,7 +779,7 @@ impl StreamDeck {
pub fn keep_alive(&self) -> Result<(), StreamDeckError> {
self.initialize()?;
match self.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
let mut buf = vec![0x00, 0x43, 0x52, 0x54, 0x00, 0x00, 0x43, 0x4F, 0x4E, 0x4E, 0x45, 0x43, 0x54];
ajazz_extend_packet(&self.kind, &mut buf);
write_data(&self.device, buf.as_slice())?;
@@ -794,7 +794,7 @@ impl StreamDeck {
pub fn shutdown(&self) -> Result<(), StreamDeckError> {
self.initialize()?;
match self.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R => {
let mut buf = vec![0x00, 0x43, 0x52, 0x54, 0x00, 0x00, 0x43, 0x4c, 0x45, 0x00, 0x00, 0x44, 0x43];
ajazz_extend_packet(&self.kind, &mut buf);
write_data(&self.device, buf.as_slice())?;
@@ -823,7 +823,7 @@ impl StreamDeck {
}
match self.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
let mut buf = vec![0x00, 0x43, 0x52, 0x54, 0x00, 0x00, 0x53, 0x54, 0x50];
ajazz_extend_packet(&self.kind, &mut buf);
@@ -894,13 +894,13 @@ impl WriteImageParameters {
let image_report_length = match kind {
Kind::Original => 8191,
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::MiraBoxHSV293S => 513,
Kind::Akp03R => 1025,
Kind::Akp03E | Kind::Akp03R => 1025,
_ => 1024,
};
let image_report_header_length = match kind {
Kind::Original | Kind::Mini | Kind::MiniMk2 => 16,
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => 1,
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => 1,
_ => 8,
};
@@ -1053,7 +1053,7 @@ impl DeviceStateReader {
StreamDeckInput::ButtonStateChange(buttons) => {
for (index, (their, mine)) in zip(buttons.iter(), my_states.buttons.iter()).enumerate() {
match self.device.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
if *their {
updates.push(DeviceStateUpdate::ButtonDown(index as u8));
updates.push(DeviceStateUpdate::ButtonUp(index as u8));
@@ -1084,7 +1084,7 @@ impl DeviceStateReader {
StreamDeckInput::EncoderStateChange(encoders) => {
for (index, (their, mine)) in zip(encoders.iter(), my_states.encoders.iter()).enumerate() {
match self.device.kind {
Kind::Akp03R => {
Kind::Akp03E | Kind::Akp03R => {
if *their {
updates.push(DeviceStateUpdate::EncoderDown(index as u8));
updates.push(DeviceStateUpdate::EncoderUp(index as u8));
+2 -2
View File
@@ -115,7 +115,7 @@ pub fn flip_key_index(kind: &Kind, key: u8) -> u8 {
/// Extends buffer up to required packet length
pub fn ajazz_extend_packet(kind: &Kind, buf: &mut Vec<u8>) {
let length = match kind {
Kind::Akp03R => 1025,
Kind::Akp03E | Kind::Akp03R => 1025,
_ => 513,
};
@@ -129,7 +129,7 @@ pub fn read_button_states(kind: &Kind, states: &[u8]) -> Vec<bool> {
}
match kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03E | Kind::Akp03R | Kind::MiraBoxHSV293S => {
let mut bools = vec![];
for i in 0..kind.key_count() {