Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

poll_on

Function poll_on 

Source
pub fn poll_on<T: Transport>(port: &mut T, socket: Port) -> PadState
Expand description

Poll the controller in socket once.

The returned PadState always contains active-high buttons; in analog mode it also contains the four DualShock stick bytes. A packet that cannot be completed after bounded retries reports PadMode::Unknown rather than synthetic button bytes. A consistently absent device reports PadMode::Disconnected after the bounded acquisition attempts.

port is the ControllerPort token; it stays borrowed for the length of the poll.