cargo fmt
[temp2RGB.git] / src / asus_aura_usb.rs
index 74face1..e639d38 100644 (file)
@@ -28,7 +28,7 @@ pub struct Device {
 
 impl Device {
     pub fn new(api: &hidapi::HidApi, motherboard: Motherboard) -> Self {
-        Device {
+        let device = Device {
             device: api
                 .open(
                     VID,
@@ -39,7 +39,10 @@ impl Device {
                 )
                 .unwrap(),
             motherboard,
-        }
+        };
+
+        device.set_fixed_mode();
+        device
     }
 
     pub fn get_firmware_string(&self) -> String {
@@ -91,7 +94,7 @@ impl Device {
             .expect("slice with incorrect length")
     }
 
-    pub fn set_fixed_mode(&self) {
+    fn set_fixed_mode(&self) {
         let mut buffer = [0u8; 65];
         buffer[0] = 0xEC;
         buffer[1] = 0x35; // Control mode.