This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new c7d0b32e4f simwifi: Support that get the connected Chinese essid.
c7d0b32e4f is described below
commit c7d0b32e4f022eaa6071d6cc16983768e183bb4c
Author: liqinhui <[email protected]>
AuthorDate: Tue Oct 24 18:51:08 2023 +0800
simwifi: Support that get the connected Chinese essid.
The Chinese essid obtained by wpa_cli is encoded. So, we directly use
the essid saved in wifidev.
Signed-off-by: liqinhui <[email protected]>
---
arch/sim/src/sim/sim_wifidriver.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/arch/sim/src/sim/sim_wifidriver.c
b/arch/sim/src/sim/sim_wifidriver.c
index 1f68755eed..87841d8946 100644
--- a/arch/sim/src/sim/sim_wifidriver.c
+++ b/arch/sim/src/sim/sim_wifidriver.c
@@ -643,21 +643,11 @@ static bool get_wpa_state(struct sim_netdev_s *wifidev)
return false;
}
-static int get_wpa_ssid(struct sim_netdev_s *wifidev, struct iw_point *essid)
+static void get_wpa_ssid(struct sim_netdev_s *wifidev,
+ struct iw_point *essid)
{
- int ret;
- char rbuf[BUF_LEN];
-
- ret = get_cmd(wifidev, rbuf, BUF_LEN, "%s",
- "status | grep ^ssid | awk -F'=' '{print $2}'");
-
- if (ret > 0 && ret <= essid->length)
- {
- strlcpy(essid->pointer, rbuf, ret);
- essid->length = ret - 1;
- }
-
- return ret;
+ essid->length = strlen(wifidev->ssid);
+ strlcpy(essid->pointer, wifidev->ssid, essid->length + 1);
}
static int get_wpa_freq(struct sim_netdev_s *wifidev)