MCPcopy Create free account
hub / github.com/emberian/evdev / upload_ff_effect

Method upload_ff_effect

src/raw_stream.rs:682–692  ·  view source on GitHub ↗

Uploads a force feedback effect to the device.

(&mut self, data: FFEffectData)

Source from the content-addressed store, hash-verified

680
681 /// Uploads a force feedback effect to the device.
682 pub fn upload_ff_effect(&mut self, data: FFEffectData) -> io::Result<FFEffect> {
683 let mut effect: sys::ff_effect = data.into();
684 effect.id = -1;
685
686 unsafe { sys::eviocsff(self.fd.as_raw_fd(), &effect)? };
687
688 let fd = self.fd.try_clone()?;
689 let id = effect.id as u16;
690
691 Ok(FFEffect { fd, id })
692 }
693
694 /// Sets the force feedback gain, i.e. how strong the force feedback effects should be for the
695 /// device. A gain of 0 means no gain, whereas `u16::MAX` is the maximum gain.

Callers 1

mainFunction · 0.45

Calls 1

as_raw_fdMethod · 0.45

Tested by

no test coverage detected