use wmi::{COMLibrary, Variant, WMIConnection};
-use crate::{a770, corsair_vengeance, rgb::RGB, sensors_jiji, AsusAuraUSB};
+use crate::{
+ a770, asus_aura_usb, corsair_lighting_pro, corsair_vengeance, cpu_temperature, machine,
+ rgb::RGB, winring0, wrapper_winring0,
+};
pub fn tests() {
println!("Running some tests...");
- test_asus_aura_usb(AsusAuraUSB::Motherboard::AsusCrosshairVIIIHero);
+ winring0::init();
+
+ // test_asus_aura_usb(asus_aura_usb::Motherboard::AsusCrosshairVIIIHero);
+ // test_corsair_lighting_pro();
// list_usb_devices();
// test_roccat();
// test_wmi();
// test_corsair();
// test_a770();
- // test_read_temp();
+ test_read_temperature_cpu();
+ // test_read_temperatur_a770
+
+ winring0::deinit();
println!("Press any key to continue...");
std::io::stdin().read_line(&mut String::new()).unwrap();
// );
// }
-fn test_asus_aura_usb(motherboard: AsusAuraUSB::Motherboard) {
+fn test_asus_aura_usb(motherboard: asus_aura_usb::Motherboard) {
let api = hidapi::HidApi::new().unwrap();
- let device = AsusAuraUSB::Device::new(&api, motherboard);
+ let device = asus_aura_usb::Device::new(&api, motherboard);
println!("Firmware: {}", device.get_firmware_string());
device.save_current_color();
}
+fn test_corsair_lighting_pro() {
+ let api = hidapi::HidApi::new().unwrap();
+ let device = corsair_lighting_pro::Device::new(&api);
+
+ device.set_color(&RGB {
+ red: 0,
+ green: 0,
+ blue: 255,
+ });
+}
+
fn test_corsair() {
let corsair_controllers = [
corsair_vengeance::Controller::new(0x19),
a770.set_color(255, 0, 0);
}
-fn test_read_temp() {
- let sensors = sensors_jiji::Sensors::new();
- println!("temp cpu: {}", sensors.read_cpu_temp());
- println!("temp gpu: {}", sensors.read_gpu_temp());
+const F17H_M01H_THM_TCON_CUR_TMP: u32 = 0x00059800;
+const F17H_TEMP_OFFSET_FLAG: u32 = 0x80000;
+const FAMILY_17H_PCI_CONTROL_REGISTER: u32 = 0x60;
+
+fn test_read_temperature_cpu() {
+ println!("temp cpu: {}", cpu_temperature::read())
}
+
+fn test_read_temperatur_a770() {
+ let jiji: &dyn machine::Machine = &machine::MachineJiji::new();
+ println!("temp gpu: {}", jiji.get_gpu_tmp());
+}
+