MCPcopy Create free account
hub / github.com/FrameworkComputer/framework-system / set_haptic_intensity

Function set_haptic_intensity

framework_lib/src/touchpad.rs:64–76  ·  view source on GitHub ↗
(value: u8)

Source from the content-addressed store, hash-verified

62}
63
64pub fn set_haptic_intensity(value: u8) -> Result<(), HidError> {
65 if !HAPTIC_INTENSITY_LEVELS.contains(&value) {
66 return Err(hid_err(format!(
67 "Haptic intensity must be one of: {:?}",
68 HAPTIC_INTENSITY_LEVELS
69 )));
70 }
71 let device =
72 open_haptic_touchpad().ok_or_else(|| hid_err("Could not find a haptic touchpad"))?;
73 let buf = [HAPTIC_INTENSITY_REPORT_ID, value];
74 debug!(" send_feature_report (haptic intensity) {:X?}", buf);
75 device.send_feature_report(&buf)
76}
77
78pub fn set_click_force(force: ClickForce) -> Result<(), HidError> {
79 let device =

Callers 1

run_with_argsFunction · 0.85

Calls 2

hid_errFunction · 0.85
open_haptic_touchpadFunction · 0.85

Tested by

no test coverage detected