Crates.io | ajazz-sdk |
lib.rs | ajazz-sdk |
version | 0.2.1 |
created_at | 2025-05-02 19:49:33.136725+00 |
updated_at | 2025-05-23 20:24:18.590048+00 |
description | HidApi driver for Ajazz devices |
homepage | https://github.com/mishamyrt/ajazz-sdk |
repository | https://github.com/mishamyrt/ajazz-sdk |
max_upload_size | |
id | 1658136 |
size | 540,876 |
Rust library for interacting with Ajazz Stream Docks.
cargo add ajazz-sdk
use ajazz_sdk::{new_hidapi, Ajazz};
// Create instance of HidApi
let hid = new_hidapi();
// List devices and unsafely take first one
let (kind, serial) = Ajazz::list_devices(&hid).remove(0);
// Connect to the device
let mut device = Ajazz::connect(&hid, kind, &serial)
.expect("Failed to connect");
// Print out some info from the device
println!(
"Connected to '{}' with version '{}'",
device.serial_number().unwrap(),
device.firmware_version().unwrap()
);
// Set device brightness
device.set_brightness(35).unwrap();
// Use image-rs to load an image
let image = image::open("no-place-like-localhost.jpg").unwrap();
// Write it to the device
device.set_button_image(5, image).unwrap();
// Flush
device.flush().unwrap();
More examples can be found in the examples directory:
ajazz-sdk
is an unofficial product and is not affiliated with Ajazz company.