[components][drivers]wlan 1.修改wifi速率单位为bps 2.打印ap信息更加友好

This commit is contained in:
tangyuxin 2018-06-23 14:50:52 +08:00
parent fdc350b763
commit 7f4b8d2102
1 changed files with 15 additions and 6 deletions

View File

@ -426,13 +426,22 @@ int wifi(int argc, char **argv)
int index, 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 ++)
{
rt_kprintf("SSID:%-.32s, ", scan_result->ap_table[index].ssid);
rt_kprintf("rssi:%d, ", scan_result->ap_table[index].rssi);
rt_kprintf("chn:%d, ", scan_result->ap_table[index].channel);
rt_kprintf("rate:%d\n", scan_result->ap_table[index].datarate);
rt_kprintf("%-32.32s", scan_result->ap_table[index].ssid);
rt_kprintf("%02x:%02x:%02x:%02x:%02x:%02x ",
scan_result->ap_table[index].bssid[0],
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);
@ -502,7 +511,7 @@ int wifi(int argc, char **argv)
wlan->info->bssid[4],
wlan->info->bssid[5]);
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);
}
else