pub fn on_mlme_scan_end(
        &mut self,
        msg: fidl_mlme::ScanEnd,
        sme_inspect: &Arc<inspect::SmeTree>,
    ) -> (ScanResult<D, J>, Option<ScanRequest>) {
        if !self.matching_mlme_txn_id(msg.txn_id) {
            return (ScanResult::None, None);
        }
        let old_state = mem::replace(&mut self.current, ScanState::NotScanning);
        let result = match old_state {
            ScanState::NotScanning | ScanState::StaleJoinScan { .. } => ScanResult::None,
            ScanState::ScanningToJoin { cmd, bss_map, .. } => {
                let result = match msg.code {
                    ScanResultCode::Success => {
                        Ok(convert_bss_map(bss_map, Some(cmd.ssid), sme_inspect))
                    }
                    other => Err(other),
                };
                ScanResult::JoinScanFinished { token: cmd.token, result }
            }
            ScanState::ScanningToDiscover { cmd, bss_map, .. } => ScanResult::DiscoveryFinished {
                tokens: cmd.tokens,
                result: match msg.code {
                    ScanResultCode::Success => Ok(convert_bss_map(bss_map, None, sme_inspect)),
                    other => Err(other),
                },
            },
        };
        let request = self.start_next_scan();
        (result, request)
    }
// Should be called for every OnScanEnd event received from MLME.
// The caller is expected to take action based on the returned ScanResult.
// If a ScanRequest is returned, the caller is responsible for forwarding it to MLME.
Should be called for every OnScanEnd event received from MLME.
The caller is expected to take action based on the returned ScanResult.
If a ScanRequest is returned, the caller is responsible for forwarding it to MLME.
Should be called for every OnScanEnd event received from MLME . The caller is expected to take action based on the returned ScanResult . If a ScanRequest is returned the caller is responsible for forwarding it to MLME .
pub fn on_mlme_scan_end(
        &mut self,
        msg: fidl_mlme::ScanEnd,
        sme_inspect: &Arc<inspect::SmeTree>,
    ) -> (ScanResult<D, J>, Option<ScanRequest>) {
        if !self.matching_mlme_txn_id(msg.txn_id) {
            return (ScanResult::None, None);
        }
        let old_state = mem::replace(&mut self.current, ScanState::NotScanning);
        let result = match old_state {
            ScanState::NotScanning | ScanState::StaleJoinScan { .. } => ScanResult::None,
            ScanState::ScanningToJoin { cmd, bss_map, .. } => {
                let result = match msg.code {
                    ScanResultCode::Success => {
                        Ok(convert_bss_map(bss_map, Some(cmd.ssid), sme_inspect))
                    }
                    other => Err(other),
                };
                ScanResult::JoinScanFinished { token: cmd.token, result }
            }
            ScanState::ScanningToDiscover { cmd, bss_map, .. } => ScanResult::DiscoveryFinished {
                tokens: cmd.tokens,
                result: match msg.code {
                    ScanResultCode::Success => Ok(convert_bss_map(bss_map, None, sme_inspect)),
                    other => Err(other),
                },
            },
        };
        let request = self.start_next_scan();
        (result, request)
    }
pub fn on_mlme_scan_end ( & mut self , msg : fidl_mlme :: ScanEnd , sme_inspect : & Arc < inspect :: SmeTree > , ) -> ( ScanResult < D , J > , Option < ScanRequest > ) { if ! self . matching_mlme_txn_id ( msg . txn_id ) { return ( ScanResult :: None , None ) ; } let old_state = mem :: replace ( & mut self . current , ScanState :: NotScanning ) ; let result = match old_state { ScanState :: NotScanning | ScanState :: StaleJoinScan { .. } => ScanResult :: None , ScanState :: ScanningToJoin { cmd , bss_map , .. } => { let result = match msg . code { ScanResultCode :: Success => { Ok ( convert_bss_map ( bss_map , Some ( cmd . ssid ) , sme_inspect ) ) } other => Err ( other ) , } ; ScanResult :: JoinScanFinished { token : cmd . token , result } } ScanState :: ScanningToDiscover { cmd , bss_map , .. } => ScanResult :: DiscoveryFinished { tokens : cmd . tokens , result : match msg . code { ScanResultCode :: Success => Ok ( convert_bss_map ( bss_map , None , sme_inspect ) ) , other => Err ( other ) , } , } , } ; let request = self . start_next_scan ( ) ; ( result , request ) }
Should be called for every OnScanEnd event received from MLME.
Should be called for every OnScanEnd event received from MLME .
&mut self
msg
fidl_mlme::ScanEnd
sme_inspect
&Arc<inspect::SmeTree>
&mut self
msg
fidl_mlme::ScanEnd
sme_inspect
&Arc<inspect::SmeTree>