Hi, in Wifi module, postAttemptScan is used to retry for the scanning.
Below is the section of code. Here
SCAN_MAX_RETRY is 5, if it retry it for 4 times ( as he is doing
below ), then it will display "Unable to scan Network" and immediately
displays the Scan AP. if it retry it for 5 times, then it will not
display the message and displays the Scan AP.
Whey is this behavior?
mScanRetryCoun = 0;
private void postAttemptScan() {
//onScanningStarted();
if (++mScanRetryCount < SCAN_MAX_RETRY) {
// Just in case, remove previous ones first
removeFutureScans();
mHandler.sendEmptyMessageDelayed(MESSAGE_ATTEMPT_SCAN,
SCAN_RETRY_DELAY_MS);
} else {
// Show an error once we run out of attempts
error(R.string.error_scanning);
onScanningEnded();
}
}
Attached log
1> With 5 retry
V/SettingsWifiLayer( 1483): --->postAttemptScan IN
V/SettingsWifiLayer( 1483): --->mScanRetryCount 4
D/wpa_supplicant( 1578): WPA_SUPP: enter into wpa_supplicant_scan
I/wpa_supplicant( 1578): [WPA_SPCNT] wpa_supplicant_scan => enabled=0
wpa_s->scan_req=0
D/wpa_supplicant( 1578): No enabled networks - do not scan
D/wpa_supplicant( 1578): WPA_SUPP: enter into wpa_supplicant_set_state
D/wpa_supplicant( 1578): WPA_SUPP: enter into wpa_supplicant_state_txt
D/wpa_supplicant( 1578): WPA_SUPP: enter into wpa_supplicant_state_txt
D/wpa_supplicant( 1578): State: SCANNING -> INACTIVE
I/wpa_supplicant( 1578): CTRL-EVENT-STATE-CHANGE id=-1 state=1
D/wpa_supplicant( 1578): WPA_SUPP: enter into
wpa_supplicant_ctrl_iface_msg_cb
D/wpa_supplicant( 1578): WPA_SUPP: enter into
wpa_supplicant_ctrl_iface_send
D/wpa_supplicant( 1578): WPA_SUPP: leave from
wpa_supplicant_ctrl_iface_msg_cb
D/wpa_supplicant( 1578): WPA_SUPP: leave from wpa_supplicant_set_state
W/WifiHW ( 1238): [HAL] wifi_command=AP_SCAN 1
E/WifiHW ( 1238): [HAL] Not connected to wpa_supplicant - "AP_SCAN 1"
command dropped.
W/WifiHW ( 1238): [HAL] wifi_command=SCAN
E/WifiHW ( 1238): [HAL] Not connected to wpa_supplicant - "SCAN"
command dropped.
V/SettingsWifiLayer( 1483): --->postAttemptScan IN
V/SettingsWifiLayer( 1483): --->mScanRetryCount 5
I/WifiMonitor( 1238): WifiMoniotr will launch
WifiNative.conectToSupplicant()
/WifiMonitor( 1232): WifiMoniotr will launch
WifiNative.conectToSupplicant()
E/WifiHW ( 1232): wifi_connect_to_supplicant
2. with 4 retry
V/SettingsWifiLayer( 1483): --->postAttemptScan IN
/SettingsWifiLayer( 1411): --->mScanRetryCount 4
D/wpa_supplicant( 1507): WPA_SUPP: enter into wpa_supplicant_scan
I/wpa_supplicant( 1507): [WPA_SPCNT] wpa_supplicant_scan => enabled=0
wpa_s->scan_req=0
D/wpa_supplicant( 1507): No enabled networks - do not scan
D/wpa_supplicant( 1507): WPA_SUPP: enter into wpa_supplicant_set_state
D/wpa_supplicant( 1507): WPA_SUPP: enter into wpa_supplicant_state_txt
D/wpa_supplicant( 1507): WPA_SUPP: enter into wpa_supplicant_state_txt
D/wpa_supplicant( 1507): State: SCANNING -> INACTIVE
I/wpa_supplicant( 1507): CTRL-EVENT-STATE-CHANGE id=-1 state=1
D/wpa_supplicant( 1507): WPA_SUPP: enter into
wpa_supplicant_ctrl_iface_msg_cb
D/wpa_supplicant( 1507): WPA_SUPP: enter into
wpa_supplicant_ctrl_iface_send
D/wpa_supplicant( 1507): WPA_SUPP: leave from
wpa_supplicant_ctrl_iface_msg_cb
D/wpa_supplicant( 1507): WPA_SUPP: leave from wpa_supplicant_set_state
W/WifiHW ( 1232): [HAL] wifi_command=AP_SCAN 1
E/WifiHW ( 1232): [HAL] Not connected to wpa_supplicant - "AP_SCAN 1"
command dropped.
W/WifiHW ( 1232): [HAL] wifi_command=SCAN
E/WifiHW ( 1232): [HAL] Not connected to wpa_supplicant - "SCAN"
command dropped.
V/SettingsWifiLayer( 1411): --->run out of attempts: error
E/SettingsWifiLayer( 1411): Unable to scan for networks
Behavior of both is same, but only thing is displaying of "Unable to
scan for networks" extra message.
Please let me know why is this difference when scanned for 4 or 5
times.
Regards
Gururaja B O
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en