pub fn update_from_flags(&mut self, flags: Vec<Option<bool>>) {
        for (idx, flag) in flags.into_iter().enumerate() {
            // The indicator indices are "1-indexed".
            let index = idx + 1;
            let toggle = if let Some(b) = flag { b } else { continue };
            // See HFP v1.8 Section 4.35 for the flags that cannot be toggled.
            // Any indicators beyond the 7 supported in this implementation can be safely ignored.
            match index {
                SERVICE_INDICATOR_INDEX => self.service = toggle,
                CALL_INDICATOR_INDEX | CALL_SETUP_INDICATOR_INDEX | CALL_HELD_INDICATOR_INDEX => (),
                SIGNAL_INDICATOR_INDEX => self.signal = toggle,
                ROAM_INDICATOR_INDEX => self.roam = toggle,
                BATT_CHG_INDICATOR_INDEX => self.batt_chg = toggle,
                _ => break,
            }
        }
    }
/// Updates the indicators with any indicators specified in `flags`.
Updates the indicators with any indicators specified in `flags`.
Updates the indicators with any indicators specified in ` flags ` .
pub fn update_from_flags(&mut self, flags: Vec<Option<bool>>) {
        for (idx, flag) in flags.into_iter().enumerate() {
            // The indicator indices are "1-indexed".
            let index = idx + 1;
            let toggle = if let Some(b) = flag { b } else { continue };
            // See HFP v1.8 Section 4.35 for the flags that cannot be toggled.
            // Any indicators beyond the 7 supported in this implementation can be safely ignored.
            match index {
                SERVICE_INDICATOR_INDEX => self.service = toggle,
                CALL_INDICATOR_INDEX | CALL_SETUP_INDICATOR_INDEX | CALL_HELD_INDICATOR_INDEX => (),
                SIGNAL_INDICATOR_INDEX => self.signal = toggle,
                ROAM_INDICATOR_INDEX => self.roam = toggle,
                BATT_CHG_INDICATOR_INDEX => self.batt_chg = toggle,
                _ => break,
            }
        }
    }
pub fn update_from_flags ( & mut self , flags : Vec < Option < bool > > ) { for ( idx , flag ) in flags . into_iter ( ) . enumerate ( ) { // The indicator indices are "1-indexed". let index = idx + 1 ; let toggle = if let Some ( b ) = flag { b } else { continue } ; // See HFP v1.8 Section 4.35 for the flags that cannot be toggled. // Any indicators beyond the 7 supported in this implementation can be safely ignored. match index { SERVICE_INDICATOR_INDEX => self . service = toggle , CALL_INDICATOR_INDEX | CALL_SETUP_INDICATOR_INDEX | CALL_HELD_INDICATOR_INDEX => ( ) , SIGNAL_INDICATOR_INDEX => self . signal = toggle , ROAM_INDICATOR_INDEX => self . roam = toggle , BATT_CHG_INDICATOR_INDEX => self . batt_chg = toggle , _ => break , } } }
Updates the indicators with any indicators specified in `flags`.
Updates the indicators with any indicators specified in ` flags ` .
&mut self
flags
Vec<Option<bool>>
&mut self
flags
Vec<Option<bool>>