[Feature][T108][WIFI][task-view-1467]Adding gsw_wifi_get_interface_mac returns support for a length of 18U and adds some logs
Only Configure: No
Affected branch: GSW_V1453
Affected module: WIFI
Is it affected on IC: only ASR
Self-test: yes
Doc Update: no
Change-Id: I24a358e06538e7c5a7e134fdbbcf963b82561bd2
diff --git a/mbtk/test/libgsw_lib/gsw_wifi_test.c b/mbtk/test/libgsw_lib/gsw_wifi_test.c
index 6c653c3..e4237bc 100644
--- a/mbtk/test/libgsw_lib/gsw_wifi_test.c
+++ b/mbtk/test/libgsw_lib/gsw_wifi_test.c
@@ -153,6 +153,7 @@
int ret = 0;
gsw_wifi_ap_run_status_e ap_status;
// 加载 Wi-Fi 驱动并启动 AP 模式
+ gsw_wifi_sdk_interface_init();
if (gsw_wifi_enable() != 0)
{
printf("Failed to enable Wi-Fi driver\n");
@@ -227,6 +228,22 @@
printf("stop AP...\n");
gsw_wifi_ap_stop();
}
+ else if (strcmp(input, "ap-mac") == 0)
+ {
+ char tmpmac[18U];
+ unsigned char apmac[18U];
+ gsw_wifi_get_interface_mac(GSW_WIFI_INTERFACE_1, tmpmac);
+ sscanf(tmpmac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &apmac[0], &apmac[1], &apmac[2], &apmac[3], &apmac[4], &apmac[5]);
+ printf("connect ap mac: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n", apmac[0], apmac[1], apmac[2], apmac[3], apmac[4], apmac[5]);
+ }
+ else if (strcmp(input, "sta-mac") == 0)
+ {
+ char tmpmac[18U];
+ unsigned char sta_mac[18U];
+ gsw_wifi_get_interface_mac(GSW_WIFI_INTERFACE_0, tmpmac);
+ sscanf(tmpmac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &sta_mac[0], &sta_mac[1], &sta_mac[2], &sta_mac[3], &sta_mac[4], &sta_mac[5]);
+ printf("connect sta mac: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n", sta_mac[0], sta_mac[1], sta_mac[2], sta_mac[3], sta_mac[4], sta_mac[5]);
+ }
else if (strcmp(input, "ap-start") == 0)
{
printf("y/Y: no set ; other: reset\n");