Merge pull request #1556 from enkiller/dev

[components][drivers]wlan打印ap信息更加友好
This commit is contained in:
aozima 2018-06-23 19:20:59 +08:00 committed by GitHub
commit 7da376280a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 6 deletions

View File

@ -426,13 +426,22 @@ int wifi(int argc, char **argv)
int index, num; int index, num;
num = scan_result->ap_num; num = scan_result->ap_num;
rt_kprintf("----Wi-Fi APInformation----\n"); rt_kprintf(" SSID MAC rssi chn Mbps\n");
rt_kprintf("------------------------------- ----------------- ---- --- ----\n");
for (index = 0; index < num; index ++) for (index = 0; index < num; index ++)
{ {
rt_kprintf("SSID:%-.32s, ", scan_result->ap_table[index].ssid); rt_kprintf("%-32.32s", scan_result->ap_table[index].ssid);
rt_kprintf("rssi:%d, ", scan_result->ap_table[index].rssi); rt_kprintf("%02x:%02x:%02x:%02x:%02x:%02x ",
rt_kprintf("chn:%d, ", scan_result->ap_table[index].channel); scan_result->ap_table[index].bssid[0],
rt_kprintf("rate:%d\n", scan_result->ap_table[index].datarate); scan_result->ap_table[index].bssid[1],
scan_result->ap_table[index].bssid[2],
scan_result->ap_table[index].bssid[3],
scan_result->ap_table[index].bssid[4],
scan_result->ap_table[index].bssid[5]
);
rt_kprintf("%4d ", scan_result->ap_table[index].rssi);
rt_kprintf("%2d ", scan_result->ap_table[index].channel);
rt_kprintf("%d\n", scan_result->ap_table[index].datarate / 1000000);
} }
} }
rt_wlan_release_scan_result(&scan_result); rt_wlan_release_scan_result(&scan_result);
@ -502,7 +511,7 @@ int wifi(int argc, char **argv)
wlan->info->bssid[4], wlan->info->bssid[4],
wlan->info->bssid[5]); wlan->info->bssid[5]);
rt_kprintf(" Channel: %d\n", wlan->info->channel); rt_kprintf(" Channel: %d\n", wlan->info->channel);
rt_kprintf("DataRate: %dMbps\n", wlan->info->datarate / 1000); rt_kprintf("DataRate: %dMbps\n", wlan->info->datarate / 1000000);
rt_kprintf(" RSSI: %d\n", rssi); rt_kprintf(" RSSI: %d\n", rssi);
} }
else else