impl Device {
pub fn new(api: &hidapi::HidApi, motherboard: Motherboard) -> Self {
- Device {
+ let device = Device {
device: api
.open(
VID,
)
.unwrap(),
motherboard,
- }
+ };
+
+ device.set_fixed_mode();
+ device
}
pub fn get_firmware_string(&self) -> String {
.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.