async fn update(&mut self) -> Result<bool, AsyncMavlinkError> {
        let mut processed_a_message = false;

        match self.all_synced() {
            true => {
                if let Some(msg) = self.new_params.next().now_or_never().flatten() {
                    processed_a_message = true;
                    self.process_message(msg).await?
                }
            } // TODO handle error
            false => {
                match future::select(
                    (self.timeout_fn)(Duration::from_millis(100)),
                    self.new_params.next(),
                )
                .await
                {
                    Either::Left((_, _)) if self.missing_indexes.is_empty() => {
                        // we are still missing indexes and quite some time passed since we receive the last PARAM_VALUE message
                        if let Some(index) = self.missing_indexes.iter().next() {
                            self.conn
                                .send_default(&self.mav_param_read("", *index as i16))
                                .await?;
                        }
                    }
                    Either::Right((Some(msg), _)) => {
                        self.process_message(msg).await?;
                        processed_a_message = true;
                    }
                    _ => {}
                }
            }
        }

        Ok(processed_a_message)
    }
/// refresh the repo
///
/// The bool tells us, if something happened
refresh the repo
The bool tells us, if something happened
refresh the repo The bool tells us if something happened
async fn update(&mut self) -> Result<bool, AsyncMavlinkError> {
        let mut processed_a_message = false;
        match self.all_synced() {
            true => {
                if let Some(msg) = self.new_params.next().now_or_never().flatten() {
                    processed_a_message = true;
                    self.process_message(msg).await?
                }
            } // TODO handle error
            false => {
                match future::select(
                    (self.timeout_fn)(Duration::from_millis(100)),
                    self.new_params.next(),
                )
                .await
                {
                    Either::Left((_, _)) if self.missing_indexes.is_empty() => {
                        // we are still missing indexes and quite some time passed since we receive the last PARAM_VALUE message
                        if let Some(index) = self.missing_indexes.iter().next() {
                            self.conn
                                .send_default(&self.mav_param_read("", *index as i16))
                                .await?;
                        }
                    }
                    Either::Right((Some(msg), _)) => {
                        self.process_message(msg).await?;
                        processed_a_message = true;
                    }
                    _ => {}
                }
            }
        }
        Ok(processed_a_message)
    }
async fn update ( & mut self ) -> Result < bool , AsyncMavlinkError > { let mut processed_a_message = false ; match self . all_synced ( ) { true => { if let Some ( msg ) = self . new_params . next ( ) . now_or_never ( ) . flatten ( ) { processed_a_message = true ; self . process_message ( msg ) . await ? } } // TODO handle error false => { match future :: select ( ( self . timeout_fn ) ( Duration :: from_millis ( 100 ) ) , self . new_params . next ( ) , ) . await { Either :: Left ( ( _ , _ ) ) if self . missing_indexes . is_empty ( ) => { // we are still missing indexes and quite some time passed since we receive the last PARAM_VALUE message if let Some ( index ) = self . missing_indexes . iter ( ) . next ( ) { self . conn . send_default ( & self . mav_param_read ( " " , * index as i16 ) ) . await ? ; } } Either :: Right ( ( Some ( msg ) , _ ) ) => { self . process_message ( msg ) . await ? ; processed_a_message = true ; } _ => { } } } } Ok ( processed_a_message ) }
refresh the repo
The bool tells us, if something happened
refresh the repo The bool tells us if something happened
&mut self
&mut self