Skip to content

Commit

Permalink
simwifi:change script path from absolute path to soft link
Browse files Browse the repository at this point in the history
Signed-off-by: wangchen <[email protected]>
  • Loading branch information
wangchen61698 committed Apr 17, 2024
1 parent 58137a2 commit 91e8a9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arch/sim/src/sim/sim_wifidriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

#define HOSTAPD_CTRL_PATH " -p /var/run/simwifi/hostapd "
#define HOSTAPD_CLI "/usr/bin/sudo /usr/sbin/hostapd_cli "
#define SIMWIFI_FILE "tools/simwifi/sim_wifi.sh "
#define SIMWIFI_FILE "/usr/bin/sim_wifi.sh "

#define WPA_SET_NETWORK(wifidev, fmt, args...) \
set_cmd(wifidev,"set_network %d "fmt, (wifidev)->network_id, ##args)
Expand Down Expand Up @@ -1360,8 +1360,8 @@ static int wifidriver_set_mode(struct sim_netdev_s *wifidev,
/* Start the sta config, including wpa_supplicant and udhcpc. */

ret = host_system(NULL, 0,
"/usr/bin/sudo %s/"SIMWIFI_FILE" start_sta %s",
TOPDIR, wifidev->host_ifname);
"/usr/bin/sudo "SIMWIFI_FILE" start_sta %s",
wifidev->host_ifname);
if (ret == 0)
{
/* Check the network number, if no network, should add new network.
Expand Down Expand Up @@ -1389,8 +1389,8 @@ static int wifidriver_set_mode(struct sim_netdev_s *wifidev,
/* Start the hostapd. */

ret = host_system(NULL, 0,
"/usr/bin/sudo %s/"SIMWIFI_FILE" start_ap %s",
TOPDIR, wifidev->host_ifname);
"/usr/bin/sudo "SIMWIFI_FILE" start_ap %s",
wifidev->host_ifname);

break;
default:
Expand Down
5 changes: 5 additions & 0 deletions tools/simwifi/sim_wifi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

NUTTX_BR_IF="nuttx0"
RUN_DIR="/var/run/simwifi"
LINK_DIR="/usr/bin"
CUR_DIR=""
DBG_LEVEL=1

Expand Down Expand Up @@ -509,6 +510,8 @@ init()

init_env

ln -s $CUR_DIR/sim_wifi.sh $LINK_DIR/sim_wifi.sh

echo "defwan:$1" > $DEFCONF_FILE
[ -n "$1" -a -n "$(ifconfig | grep $1)" ] && start_bridge $1

Expand All @@ -527,6 +530,8 @@ clean()

recovery_to_init

rm $LINK_DIR/sim_wifi.sh

cur_mode=$(get_var mode $DEFCONF_FILE)
[ "$cur_mode" = "hwsim" ] && modprobe -r mac80211_hwsim

Expand Down

0 comments on commit 91e8a9f

Please sign in to comment.