fn handle_serial_request(&mut self, sub_id: &String, msg: SerialRequest) {
    let response = match msg {
      SerialRequest::Open { port } => self.handle_open_port(sub_id, port),
      SerialRequest::WriteLock { port } => self.handle_write_lock(sub_id, port),
      SerialRequest::ReleaseWriteLock { port } => self.handle_release_write_lock(sub_id, port),
      SerialRequest::Write { port, data, base64 } => {
        self.handle_write_port(sub_id, port, data, base64.unwrap_or(false))
      }
      SerialRequest::Close { port } => self.handle_close_port(sub_id, port),
      SerialRequest::List {} => self.handle_list_ports(sub_id),
    };
    if let Err(e) = response {
      warn!("Error '{}' occured handling serial request message", e);
      // Send error?
      self.send_message(&sub_id, to_serial_response_error(e));
    }
  }
/// Handles and dispatches SerialRequest sent by
/// the channel
Handles and dispatches SerialRequest sent by
the channel
Handles and dispatches SerialRequest sent by the channel
fn handle_serial_request(&mut self, sub_id: &String, msg: SerialRequest) {
    let response = match msg {
      SerialRequest::Open { port } => self.handle_open_port(sub_id, port),
      SerialRequest::WriteLock { port } => self.handle_write_lock(sub_id, port),
      SerialRequest::ReleaseWriteLock { port } => self.handle_release_write_lock(sub_id, port),
      SerialRequest::Write { port, data, base64 } => {
        self.handle_write_port(sub_id, port, data, base64.unwrap_or(false))
      }
      SerialRequest::Close { port } => self.handle_close_port(sub_id, port),
      SerialRequest::List {} => self.handle_list_ports(sub_id),
    };
    if let Err(e) = response {
      warn!("Error '{}' occured handling serial request message", e);
      // Send error?
      self.send_message(&sub_id, to_serial_response_error(e));
    }
  }
fn handle_serial_request ( & mut self , sub_id : & String , msg : SerialRequest ) { let response = match msg { SerialRequest :: Open { port } => self . handle_open_port ( sub_id , port ) , SerialRequest :: WriteLock { port } => self . handle_write_lock ( sub_id , port ) , SerialRequest :: ReleaseWriteLock { port } => self . handle_release_write_lock ( sub_id , port ) , SerialRequest :: Write { port , data , base64 } => { self . handle_write_port ( sub_id , port , data , base64 . unwrap_or ( false ) ) } SerialRequest :: Close { port } => self . handle_close_port ( sub_id , port ) , SerialRequest :: List { } => self . handle_list_ports ( sub_id ) , } ; if let Err ( e ) = response { warn ! ( " " e ) ; // Send error? self . send_message ( & sub_id , to_serial_response_error ( e ) ) ; } }
Handles and dispatches SerialRequest sent by
the channel
Handles and dispatches SerialRequest sent by the channel
&mut self
sub_id
&String
msg
SerialRequest
&mut self
sub_id
&String
msg
SerialRequest