pub struct DeviceImpl<'a> { /* private fields */ }Implementations§
Source§impl<'a> DeviceImpl<'a>
impl<'a> DeviceImpl<'a>
pub fn new(config: DeviceConfig) -> Self
Sourcepub fn update_input(&mut self, input: InputState)
pub fn update_input(&mut self, input: InputState)
Called by the GUI to set input from UI and keyboard.
pub fn alloc_psram(&self, size: usize) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl<'a> Device for DeviceImpl<'a>
impl<'a> Device for DeviceImpl<'a>
type Dir = DirImpl
Source§fn read_input(&mut self) -> Option<InputState>
fn read_input(&mut self) -> Option<InputState>
Read gamepad input.
Source§fn log_debug<D: Display>(&mut self, src: &str, msg: D)
fn log_debug<D: Display>(&mut self, src: &str, msg: D)
Log a debug message into console. Read more
fn open_dir(&mut self, path: &[&str]) -> Result<Self::Dir, FSError>
Source§fn has_headphones(&mut self) -> bool
fn has_headphones(&mut self) -> bool
Returns true if headphones are connected.
Source§fn get_audio_buffer(&mut self) -> &mut [i16]
fn get_audio_buffer(&mut self) -> &mut [i16]
Get a writable slice of free audio buffer region.
fn get_battery_status(&mut self) -> Option<BatteryStatus>
Source§impl<'a> Network for DeviceImpl<'a>
impl<'a> Network for DeviceImpl<'a>
Source§type Addr = SocketAddr
type Addr = SocketAddr
The type representing the network address. Must be unique. Read more
Source§fn net_local_addr(&self) -> SocketAddr
fn net_local_addr(&self) -> SocketAddr
Network address of the current device as visible to the other peers. Read more
Source§fn net_start(&mut self) -> Result<(), NetworkError>
fn net_start(&mut self) -> Result<(), NetworkError>
Start accepting incoming network connections from other peers.
Source§fn net_stop(&mut self) -> Result<(), NetworkError>
fn net_stop(&mut self) -> Result<(), NetworkError>
Stop accepting incoming network connections from other peers.
Source§fn net_advertise(&mut self) -> Result<(), NetworkError>
fn net_advertise(&mut self) -> Result<(), NetworkError>
Broadcast device presence to all other devices nearby.
Source§fn net_recv(&mut self) -> Result<Option<(Self::Addr, Box<[u8]>)>, NetworkError>
fn net_recv(&mut self) -> Result<Option<(Self::Addr, Box<[u8]>)>, NetworkError>
Get a pending message, if any. Non-blocking.
Source§fn net_send(
&mut self,
addr: Self::Addr,
data: &[u8],
) -> Result<(), NetworkError>
fn net_send( &mut self, addr: Self::Addr, data: &[u8], ) -> Result<(), NetworkError>
Send a raw message to the given device. Non-blocking.
Source§fn net_send_status(&mut self, _: Self::Addr) -> Result<SendStatus, NetworkError>
fn net_send_status(&mut self, _: Self::Addr) -> Result<SendStatus, NetworkError>
Send a raw message to the given device. Non-blocking.
Source§impl Serial for DeviceImpl<'_>
impl Serial for DeviceImpl<'_>
fn serial_start(&mut self) -> Result<(), NetworkError>
fn serial_stop(&mut self) -> Result<(), NetworkError>
fn serial_recv(&mut self) -> Result<Option<Box<[u8]>>, NetworkError>
fn serial_send(&mut self, data: &[u8]) -> Result<(), NetworkError>
Source§impl Wifi for DeviceImpl<'_>
impl Wifi for DeviceImpl<'_>
fn wifi_scan(&mut self) -> Result<[String; 6], NetworkError>
fn wifi_connect(&mut self, ssid: &str, pass: &str) -> Result<(), NetworkError>
fn wifi_status(&mut self) -> Result<u8, NetworkError>
fn wifi_disconnect(&mut self) -> Result<(), NetworkError>
fn tcp_connect(&mut self, ip: u32, port: u16) -> Result<(), NetworkError>
fn tcp_status(&mut self) -> Result<u8, NetworkError>
fn tcp_send(&mut self, data: &[u8]) -> Result<(), NetworkError>
fn tcp_recv(&mut self) -> Result<Box<[u8]>, NetworkError>
fn tcp_close(&mut self) -> Result<(), NetworkError>
Auto Trait Implementations§
impl<'a> !Freeze for DeviceImpl<'a>
impl<'a> !RefUnwindSafe for DeviceImpl<'a>
impl<'a> Send for DeviceImpl<'a>
impl<'a> !Sync for DeviceImpl<'a>
impl<'a> Unpin for DeviceImpl<'a>
impl<'a> UnsafeUnpin for DeviceImpl<'a>
impl<'a> !UnwindSafe for DeviceImpl<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more