Struct RemoteIo

Source
pub struct RemoteIo { /* private fields */ }
Expand description

Implements the Firmata protocol within an IoProtocol.

Implementations§

Source§

impl RemoteIo

Source

pub fn new<P: Into<String>>(port: P) -> Self

Source§

impl RemoteIo

Source

pub fn start_polling(&self)

Manually attaches the board value change listener. This is only used for input events. This should never be needed unless you manually detach() the sensor first for some reason and want it to start being reactive to events again.

Source

pub fn stop_polling(&self)

Detaches the interval associated with the button. This means the button won’t react anymore to value changes.

Trait Implementations§

Source§

impl Clone for RemoteIo

Source§

fn clone(&self) -> RemoteIo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RemoteIo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RemoteIo

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for RemoteIo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: IoTransport + 'static> From<T> for RemoteIo

Source§

fn from(transport: T) -> Self

Converts to this type from the input type.
Source§

impl IO for RemoteIo

Source§

fn get_io(&self) -> &Arc<RwLock<IoData>>

Returns a protected arc to the inner IoData.
Source§

fn is_connected(&self) -> bool

Checks if the communication is opened using the underlying protocol.
Source§

fn set_pin_mode(&mut self, pin: u8, mode: PinModeId) -> Result<(), Error>

Sets the mode of the specified pin. Read more
Source§

fn digital_write(&mut self, pin: u8, level: bool) -> Result<(), Error>

Writes level to the digital pin. Read more
Source§

fn analog_write(&mut self, pin: u8, level: u16) -> Result<(), Error>

Writes level to the analog pin. Read more
Source§

fn digital_read(&mut self, _: u8) -> Result<bool, Error>

Reads the digital pin value.
Source§

fn analog_read(&mut self, _: u8) -> Result<u16, Error>

Reads the analog pin value.
Source§

fn servo_config(&mut self, pin: u8, pwm_range: Range<u16>) -> Result<(), Error>

Sends a SERVO_CONFIG command (0x70 - configure servo) https://github.com/firmata/protocol/blob/master/servos.md
Source§

fn i2c_config(&mut self, delay: u16) -> Result<(), Error>

Configures the delay in microseconds for I2C devices that require a delay between when the register is written to and the data in that register can be read.
Source§

fn i2c_read(&mut self, address: u8, size: u16) -> Result<(), Error>

Reads size bytes from I2C device at the specified address.
Source§

fn i2c_write(&mut self, address: u8, data: &[u16]) -> Result<(), Error>

Writes data to the I2C device at the specified address.
Source§

impl IoProtocol for RemoteIo

Source§

fn open(&mut self) -> Result<(), Error>

Opens the communication using the underlying protocol.
Source§

fn close(&mut self) -> Result<(), Error>

Gracefully shuts down the communication.
Source§

fn report_analog(&mut self, channel: u8, state: bool) -> Result<(), Error>

Sets the analog reporting state of the specified analog pin. Read more
Source§

fn report_digital(&mut self, pin: u8, state: bool) -> Result<(), Error>

Sets the digital reporting state of the specified digital pin. Read more
Source§

fn sampling_interval(&mut self, interval: u16) -> Result<(), Error>

Set the sampling interval (in ms). Read more
Source§

fn get_name(&self) -> &'static str

Returns the protocol name.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.