| Crates.io | qhyccd-rs |
| lib.rs | qhyccd-rs |
| version | 0.1.9 |
| created_at | 2023-10-29 07:37:14.119795+00 |
| updated_at | 2026-01-19 00:54:34.830613+00 |
| description | Rust bindings for the QHYCCD SDK. This crate provides a safe interface to the QHYCCD SDK for controlling QHYCCD cameras, filter wheels and focusers. The libqhyccd-sys crate provides the raw FFI bindings. It uses tracing for logging and eyre for error handling. |
| homepage | https://github.com/ivonnyssen/qhyccd-rs/wiki |
| repository | https://github.com/ivonnyssen/qhyccd-rs |
| max_upload_size | |
| id | 1017359 |
| size | 382,203 |
libqhyccd bindings for Rust.
Current bindings are not complete, but will grow as functionality is needed for the ASCOM alpaca drivers or other projects. It is very early in the dev cycle and I am still learning a ton about Rust, so things might be in flux for a while.
[dependencies]
qhyccd-rs = "0.1.9"
qhyccd-rs works with stable Rust. The minimum required Rust version is 1.68.
Currently the library works with QHYCCD SDK 25.09.29. The library supports Linux, Windows, and macOS (experimental).
This project is licensed under either of
at your option.
The repository contains files from the QHYCCD SDK, these are not covered by these licenses and only provided, so builds in CI pass reasonably.
All contributions are welcome.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in qhyccd-rs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
sudo apt-get install libusb-1.0-0-dev
sudo dnf install libusb1-devel
wget https://www.qhyccd.com/file/repository/publish/SDK/25.09.29/sdk_Arm64_25.09.29.tgz
tar xzvf sdk_Arm64_25.09.29.tgz
cd sdk_Arm64_25.09.29/
sudo sh install.sh
wget https://www.qhyccd.com/file/repository/publish/SDK/25.09.29/sdk_linux64_25.09.29.tgz
tar xzvf sdk_linux64_25.09.29.tgz
cd sdk_linux64_25.09.29/
sudo sh install.sh
Download and install the QHYCCD SDK from the official website.
Download and install the QHYCCD SDK from the official website.
The simulation feature enables testing and development without physical hardware. When enabled, Sdk::new() automatically provides a simulated camera environment with realistic behavior.
Add the feature to your Cargo.toml:
[dependencies]
qhyccd-rs = { version = "0.1.9", features = ["simulation"] }
Or use it for development dependencies:
[dev-dependencies]
qhyccd-rs = { version = "0.1.9", features = ["simulation"] }
With the simulation feature enabled, your code works identically whether using real or simulated hardware:
use qhyccd_rs::Sdk;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Same code for both real and simulated cameras
let sdk = Sdk::new()?;
let cameras = sdk.cameras();
println!("Found {} camera(s)", cameras.count());
if let Some(camera) = cameras.first() {
println!("Camera: {}", camera.id()?);
// Check for filter wheel
let filter_wheels = sdk.filter_wheels();
if let Some(fw) = filter_wheels.first() {
fw.open()?;
println!("Filter wheel with {} positions", fw.get_number_of_filters()?);
fw.close()?;
}
}
Ok(())
}
When using the simulation feature, Sdk::new() automatically provides:
Camera: QHY178M-Simulated (SIM-QHY178M)
Filter Wheel: 7-position CFW
sdk.filter_wheels()For advanced use cases requiring custom camera configurations, use Sdk::new_simulated() and add_simulated_camera():
use qhyccd_rs::{Sdk, simulation::SimulatedCameraConfig};
let mut sdk = Sdk::new_simulated();
// Add custom camera with specific configuration
let config = SimulatedCameraConfig::default()
.with_id("CUSTOM-CAM-001")
.with_model("Custom Camera Model")
.with_filter_wheel(5) // 5-position wheel
.with_cooler();
sdk.add_simulated_camera(config);
# Build with simulation
cargo build --features simulation
# Run tests with simulation
cargo test --features simulation
# Run examples with simulation
cargo run --features simulation --bin SingleFrameMode