(device: &HidDevice)
| 94 | } |
| 95 | |
| 96 | fn magic_unlock(device: &HidDevice) { |
| 97 | device.set_blocking_mode(true).unwrap(); |
| 98 | |
| 99 | // Same for both images |
| 100 | info!("Magic unlock"); |
| 101 | device |
| 102 | .send_feature_report(&[ |
| 103 | ReportIdCmd::E4 as u8, |
| 104 | 0x42, |
| 105 | 0x43, |
| 106 | 0x59, |
| 107 | 0x00, |
| 108 | 0x00, |
| 109 | 0x00, |
| 110 | 0x0B, |
| 111 | ]) |
| 112 | .expect("Failed to unlock device"); |
| 113 | |
| 114 | // Returns Err but seems to work anyway. OH! Probably because it resets the device!! |
| 115 | // TODO: I have a feeling the last five bytes are ignored. They're the same in all commands. |
| 116 | // Seems to work with all of them set to 0x00 |
| 117 | info!("Bridge Mode"); |
| 118 | let _ = send_command(device, CmdId::Cmd0x06, CmdParam::BridgeMode as u8); |
| 119 | } |
| 120 | |
| 121 | fn get_fw_info(device: &HidDevice) -> HidFirmwareInfo { |
| 122 | // Get 0x40 bytes from 0xE0 |
no test coverage detected