(force: ClickForce)
| 76 | } |
| 77 | |
| 78 | pub fn set_click_force(force: ClickForce) -> Result<(), HidError> { |
| 79 | let device = |
| 80 | open_haptic_touchpad().ok_or_else(|| hid_err("Could not find a haptic touchpad"))?; |
| 81 | // Field is 2 bits at the bottom of the report payload |
| 82 | let buf = [CLICK_FORCE_REPORT_ID, force as u8]; |
| 83 | debug!(" send_feature_report (click force) {:X?}", buf); |
| 84 | device.send_feature_report(&buf) |
| 85 | } |
| 86 | |
| 87 | fn read_byte(device: &HidDevice, report_id: u8, addr: u8) -> Result<u8, HidError> { |
| 88 | device.send_feature_report(&[report_id, addr, 0x10, 0])?; |
no test coverage detected