1mod common;
2#[cfg(target_os = "linux")]
3mod linux;
4#[cfg(not(any(target_os = "linux", target_os = "windows")))]
5mod null;
6#[cfg(target_os = "windows")]
7mod windows;
8
9#[cfg(target_os = "linux")]
10pub use linux::{wiimotes_scan, wiimotes_scan_cleanup, LinuxNativeWiimote as NativeWiimoteDevice};
11
12#[cfg(not(any(target_os = "linux", target_os = "windows")))]
13pub use null::{wiimotes_scan, wiimotes_scan_cleanup, NullNativeWiimote as NativeWiimoteDevice};
14
15#[cfg(target_os = "windows")]
16pub use windows::{
17 wiimotes_scan, wiimotes_scan_cleanup, WindowsNativeWiimote as NativeWiimoteDevice,
18};
19
20pub trait NativeWiimote {
21 fn read(&mut self, buffer: &mut [u8]) -> Option<usize>;
22 fn read_timeout(&mut self, buffer: &mut [u8], timeout_millis: usize) -> Option<usize>;
23 fn write(&mut self, buffer: &[u8]) -> Option<usize>;
24 fn identifier(&self) -> String;
25}