pub struct RawPoll {
pub id_low: u8,
pub id_high: u8,
pub buttons_low: u8,
pub buttons_high: u8,
pub sticks: AnalogSticks,
pub mode: PadMode,
pub ack_seen: u16,
pub exchanges: u8,
}Expand description
Raw wire result of one poll, before active-low button inversion. Carries the
per-byte /ACK observations so a diagnostic can show whether the controller
acknowledges each byte, and which pacing produced a clean handshake.
Fields§
§id_low: u8ID low byte: 0x41 digital, 0x73 analog, 0xF3 config, 0xFF none.
id_high: u8ID high byte; 0x5A on a valid controller, anything else is a desync.
First button byte, raw active-low wire value.
Second button byte, raw active-low wire value.
sticks: AnalogSticksRaw stick bytes (centre 0x80) when the controller reports them.
mode: PadModeMode inferred from the ID bytes (Unknown when the 0x5A magic is wrong).
ack_seen: u16Bit i set if exchange i observed an /ACK pulse (bit 0 = select byte).
exchanges: u8Number of exchanges performed (select byte + payload bytes).
Implementations§
Source§impl RawPoll
impl RawPoll
Sourcepub fn is_fully_acknowledged(self) -> bool
pub fn is_fully_acknowledged(self) -> bool
true when every payload exchange that should have been acknowledged
was. The select byte (bit 0) and all bytes up to (but not including) the
final, never-acknowledged byte must each show an /ACK.
Trait Implementations§
impl Copy for RawPoll
impl Eq for RawPoll
impl StructuralPartialEq for RawPoll
Auto Trait Implementations§
impl Freeze for RawPoll
impl RefUnwindSafe for RawPoll
impl Send for RawPoll
impl Sync for RawPoll
impl Unpin for RawPoll
impl UnsafeUnpin for RawPoll
impl UnwindSafe for RawPoll
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)