Struct relay8x::Relay8x [−][src]
pub struct Relay8x { /* fields omitted */ }
Provides access to serial port
Methods
impl Relay8x
[src]
impl Relay8x
pub fn new(device_name: &str, address: u8) -> Result<Self, Error>
[src]
pub fn new(device_name: &str, address: u8) -> Result<Self, Error>
constructor for a new Relay Card
pub fn configure_device(&mut self) -> Result<BytesMut>
[src]
pub fn configure_device(&mut self) -> Result<BytesMut>
initialise device with correct params
sets device address, function can be used to re-set it
pub fn set_relays(
&mut self,
cards: CardIndex,
numbers: RelayIndex
) -> Result<BytesMut>
[src]
pub fn set_relays(
&mut self,
cards: CardIndex,
numbers: RelayIndex
) -> Result<BytesMut>
switch arbitrary relays on
- numbers: Vector containing all relay numbers (1..8)
- state: true for switching on, false for off
pub fn reset_relays(
&mut self,
cards: CardIndex,
numbers: RelayIndex
) -> Result<BytesMut>
[src]
pub fn reset_relays(
&mut self,
cards: CardIndex,
numbers: RelayIndex
) -> Result<BytesMut>
switch arbitrary relays off
- numbers: Vector containing all relay numbers (1..8)
- state: true for switching on, false for off
pub fn toggle_relays(
&mut self,
cards: CardIndex,
numbers: RelayIndex
) -> Result<BytesMut>
[src]
pub fn toggle_relays(
&mut self,
cards: CardIndex,
numbers: RelayIndex
) -> Result<BytesMut>
toggle aribtrary relays
numbers: vector containing all relay numbers (1..8)