MCPcopy Index your code
hub / github.com/RizeCrime/linuxblaster_control / reset

Method reset

src/lib.rs:203–216  ·  view source on GitHub ↗

### Important This does **not** reset the USB Connection! This is a managed reset function that takes device quirks into account. It resets "all" features to their default values, where "all" means a hard-coded list of features that this software touches. Does not reset Output device. If this software doesn't modify a feature, it won't be included in the reset. I don't know where this would bec

(&self)

Source from the content-addressed store, hash-verified

201 /// I don't know where this would become relevant,
202 /// but I figured it'd be worth noting down.
203 pub fn reset(&self) -> Result<(), Box<dyn Error>> {
204 // yeah the return type might be stupid, I'll fix it soon™️
205 let features: Vec<Feature> = features::all_features();
206 features.iter().for_each(|feature| {
207 if feature.id == FeatureId::Output {
208 return;
209 }
210 feature.write_to_device(0.0);
211 });
212
213 self.read_state_from_device();
214
215 Ok(())
216 }
217
218 pub fn save_profile(&self, path: PathBuf) -> Result<(), Box<dyn Error>> {
219 // save the current state of the features to a profile

Callers 4

bitmask_sniffer.pyFile · 0.80
reset_usbMethod · 0.80
updateMethod · 0.80
test_usb.pyFile · 0.80

Calls 3

all_featuresFunction · 0.85
write_to_deviceMethod · 0.80

Tested by

no test coverage detected