[wlan][cmd] fixed a duplicate issue with the wifi scan command #8666
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
在执行
wifi scan
命令时,扫描出来的结果会重复打印,我测试在lts-v4.1.x
是不存在这个问题的。重复打印的问题如下:
msh />wifi scan SSID MAC security rssi chn Mbps ------------------------------- ----------------- -------------- ---- --- ---- EvlerHome c8:ea:f8:eb:cd:6e WPA2_AES_PSK -48 5 300 EvlerHome c8:ea:f8:eb:cd:6e WPA2_AES_PSK -47 5 300 ES-650733 58:48:49:05:84:5d WPA2_AES_PSK -86 9 72 TP-LINK_403 b8:f8:83:af:4c:61 WPA2_AES_PSK -67 11 450 TP-LINK_403 b8:f8:83:af:4c:61 WPA2_AES_PSK -69 11 450 312 20:6b:e7:81:fc:1b WPA2_AES_PSK -62 11 450 EvlerHome c8:ea:f8:eb:cd:6e WPA2_AES_PSK -46 5 300 EvlerHome c8:ea:f8:eb:cd:6e WPA2_AES_PSK -46 5 300 YXKJ 48:5f:08:b2:f6:1d WPA2_AES_PSK -76 6 300 f8:9a:78:73:73:4d WPA2_AES_PSK -91 6 300 Xiaomi_404 5c:02:14:63:62:5a WPA2_MIXED_PSK -90 9 144 312 20:6b:e7:81:fc:1b WPA2_AES_PSK -62 11 450 TP-LINK_403 b8:f8:83:af:4c:61 WPA2_AES_PSK -67 11 450 111111 ec:26:ca:eb:c0:84 WPA2_AES_PSK -70 1 450 111111 ec:26:ca:eb:c0:84 WPA2_AES_PSK -70 1 450 ChinaNet-5sD3 bc:5d:a3:8c:84:56 WPA2_MIXED_PSK -76 4 144
你的解决方案是什么 (what is your solution)
在将扫描结果保存到
cached (wifi_scan_result_cache)
之前,先读取扫描结果的数量,然后再存入cached
,利用cached
的查重机制检查数量是否增加新的ap。在
wifi_scan_result_cache
函数完成后,如果scan_result.num
有增加,说明该ap属于新扫描到的ap,此时再将该ap信息
打印出来。以下是修复后的效果:
msh />wifi scan SSID MAC security rssi chn Mbps ------------------------------- ----------------- -------------- ---- --- ---- EvlerHome c8:ea:f8:eb:cd:6e WPA2_AES_PSK -46 5 300 ES-650733 58:48:49:05:84:5d WPA2_AES_PSK -84 9 72 TP-LINK_403 b8:f8:83:af:4c:61 WPA2_AES_PSK -66 11 450 312 20:6b:e7:81:fc:1b WPA2_AES_PSK -60 11 450 YXKJ 48:5f:08:b2:f6:1d WPA2_AES_PSK -73 6 300 Xiaomi_404 5c:02:14:63:62:5a WPA2_MIXED_PSK -71 9 144 406 6c:b1:58:f7:3b:3b WPA2_AES_PSK -91 12 300 ChinaNet-5sD3 bc:5d:a3:8c:84:56 WPA2_MIXED_PSK -85 1 144 111111 ec:26:ca:eb:c0:84 WPA2_AES_PSK -67 1 450 405 ec:26:ca:fa:c0:d2 WPA2_AES_PSK -76 1 450 110-2 3c:cd:57:75:c3:bc WPA2_MIXED_PSK -85 1 300 Xiaomi_301 c8:bf:4c:db:9e:2a WPA2_MIXED_PSK -78 4 300
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up