pub fn read(sender: &Sender<Message>) -> Self {
            let (message, receiver) = Message::new(0x0001, vec![]);
            sender.send(message).unwrap();
            let masks = receiver
                .recv_timeout(Duration::from_secs(10))
                .expect("LED mask not received from Arduino");

            if masks.len() != 1 {
                panic!("Expected 1 byte with LED mask, got {} bytes.", masks.len());
            }

            Self(masks[0])
        }
/// Obtain current LED setup from Arduino.
///
/// # Arguments
///
/// * `sender` - message sender channel
///
/// # Panics
///
/// This method panics if command response is not retrieved from
/// Arduino within 10 seconds or if the retrieved data are incorrect.
Obtain current LED setup from Arduino.
Obtain current LED setup from Arduino .
pub fn read(sender: &Sender<Message>) -> Self {
            let (message, receiver) = Message::new(0x0001, vec![]);
            sender.send(message).unwrap();
            let masks = receiver
                .recv_timeout(Duration::from_secs(10))
                .expect("LED mask not received from Arduino");
            if masks.len() != 1 {
                panic!("Expected 1 byte with LED mask, got {} bytes.", masks.len());
            }
            Self(masks[0])
        }
pub fn read ( sender : & Sender < Message > ) -> Self { let ( message , receiver ) = Message :: new ( 0x0001 , vec ! [ ] ) ; sender . send ( message ) . unwrap ( ) ; let masks = receiver . recv_timeout ( Duration :: from_secs ( 10 ) ) . expect ( " " ) ; if masks . len ( ) != 1 { panic ! ( " " masks len ( ) ) ; } Self ( masks [ 0 ] ) }
Obtain current LED setup from Arduino.
Obtain current LED setup from Arduino .
sender
&Sender<Message>
sender
&Sender<Message>
panics
This method panics if command response is not retrieved from
Arduino within 10 seconds or if the retrieved data are incorrect.
This method panics if command response is not retrieved from Arduino within 10 seconds or if the retrieved data are incorrect .