From c7d0b32e4f022eaa6071d6cc16983768e183bb4c Mon Sep 17 00:00:00 2001 From: liqinhui Date: Tue, 24 Oct 2023 18:51:08 +0800 Subject: [PATCH] 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 --- 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)