mirror of
https://gitee.com/openharmony/communication_wifi.git
synced 2024-12-29 18:43:39 +00:00
!1505 以静态IP连接的热点,切换连接时设置列表和状态栏wifi图标有1秒左右置灰显示
Merge pull request !1505 from liuyuanyuan66/master
This commit is contained in:
commit
fc7c971818
@ -844,6 +844,11 @@ void StaStateMachine::DealSignalPollResult(InternalMessage *msg)
|
||||
MacAnonymize(linkedInfo.bssid).c_str(), signalInfo.frequency, signalInfo.signal, signalInfo.noise,
|
||||
signalInfo.chload, signalInfo.snr, signalInfo.ulDelay, signalInfo.txrate, signalInfo.rxrate, signalInfo.txBytes,
|
||||
signalInfo.rxBytes, signalInfo.txFailed, signalInfo.txPackets, signalInfo.rxPackets);
|
||||
|
||||
if (signalInfo.frequency > 0) {
|
||||
linkedInfo.frequency = signalInfo.frequency;
|
||||
}
|
||||
ConvertFreqToChannel();
|
||||
if (signalInfo.signal > INVALID_RSSI_VALUE && signalInfo.signal < MAX_RSSI_VALUE) {
|
||||
if (signalInfo.signal > 0) {
|
||||
linkedInfo.rssi = setRssi((signalInfo.signal - SIGNAL_INFO));
|
||||
@ -886,9 +891,6 @@ void StaStateMachine::DealSignalPollResult(InternalMessage *msg)
|
||||
InvokeOnStaStreamChanged(StreamDirection::STREAM_DIRECTION_DOWN);
|
||||
}
|
||||
|
||||
if (signalInfo.frequency > 0) {
|
||||
linkedInfo.frequency = signalInfo.frequency;
|
||||
}
|
||||
linkedInfo.snr = signalInfo.snr;
|
||||
if (linkedInfo.wifiStandard == WIFI_MODE_UNDEFINED) {
|
||||
WifiSettings::GetInstance().SetWifiLinkedStandardAndMaxSpeed(linkedInfo);
|
||||
@ -897,7 +899,6 @@ void StaStateMachine::DealSignalPollResult(InternalMessage *msg)
|
||||
linkedInfo.wifiStandard, MacAnonymize(linkedInfo.bssid).c_str(), linkedInfo.maxSupportedRxLinkSpeed,
|
||||
linkedInfo.maxSupportedTxLinkSpeed);
|
||||
WifiSettings::GetInstance().SaveLinkedInfo(linkedInfo, m_instId);
|
||||
ConvertFreqToChannel();
|
||||
DealSignalPacketChanged(signalInfo.txPackets, signalInfo.rxPackets);
|
||||
StartTimer(static_cast<int>(CMD_SIGNAL_POLL), STA_SIGNAL_POLL_DELAY);
|
||||
}
|
||||
|
@ -1389,24 +1389,6 @@ int WifiSettings::GetSignalLevel(const int &rssi, const int &band, int instId)
|
||||
auto iter = mWifiConfig.find(instId);
|
||||
if (iter != mWifiConfig.end()) {
|
||||
do {
|
||||
if (band == static_cast<int>(BandType::BAND_2GHZ)) {
|
||||
if (rssi < iter->second.firstRssiLevel2G) {
|
||||
break;
|
||||
}
|
||||
++level;
|
||||
if (rssi < iter->second.secondRssiLevel2G) {
|
||||
break;
|
||||
}
|
||||
++level;
|
||||
if (rssi < iter->second.thirdRssiLevel2G) {
|
||||
break;
|
||||
}
|
||||
++level;
|
||||
if (rssi < iter->second.fourthRssiLevel2G) {
|
||||
break;
|
||||
}
|
||||
++level;
|
||||
}
|
||||
if (band == static_cast<int>(BandType::BAND_5GHZ)) {
|
||||
if (rssi < iter->second.firstRssiLevel5G) {
|
||||
break;
|
||||
@ -1424,6 +1406,23 @@ int WifiSettings::GetSignalLevel(const int &rssi, const int &band, int instId)
|
||||
break;
|
||||
}
|
||||
++level;
|
||||
} else {
|
||||
if (rssi < iter->second.firstRssiLevel2G) {
|
||||
break;
|
||||
}
|
||||
++level;
|
||||
if (rssi < iter->second.secondRssiLevel2G) {
|
||||
break;
|
||||
}
|
||||
++level;
|
||||
if (rssi < iter->second.thirdRssiLevel2G) {
|
||||
break;
|
||||
}
|
||||
++level;
|
||||
if (rssi < iter->second.fourthRssiLevel2G) {
|
||||
break;
|
||||
}
|
||||
++level;
|
||||
}
|
||||
} while (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user