start-p2p-concurrent.sh 1.1 KB

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. DIR="$( cd "$( dirname "$0" )" && pwd )"
  3. WPAS=$DIR/../../wpa_supplicant/wpa_supplicant
  4. HAPD=$DIR/../../hostapd/hostapd
  5. WLANTEST=$DIR/../../wlantest/wlantest
  6. $DIR/stop-wifi.sh
  7. sudo modprobe mac80211_hwsim radios=5
  8. sudo iw wlan0 interface add sta0 type station
  9. sudo iw wlan1 interface add sta1 type station
  10. sudo iw wlan2 interface add sta2 type station
  11. mkdir -p $DIR/logs
  12. DATE=`date +%s`
  13. sudo ifconfig hwsim0 up
  14. sudo $WLANTEST -i hwsim0 -c -d > $DIR/logs/$DATE-hwsim0 &
  15. sudo tcpdump -ni hwsim0 -s 2500 -w $DIR/logs/$DATE-hwsim0.dump &
  16. sudo $WPAS -g /tmp/wpas-wlan0 -Gadmin -Dnl80211 -iwlan0 -c $DIR/p2p0.conf -N -Dnl80211 -ista0 -c $DIR/sta-dummy.conf -ddKt > $DIR/logs/$DATE-log0 &
  17. sudo $WPAS -g /tmp/wpas-wlan1 -Gadmin -Dnl80211 -iwlan1 -c $DIR/p2p1.conf -N -Dnl80211 -ista1 -c $DIR/sta-dummy.conf -ddKt > $DIR/logs/$DATE-log1 &
  18. sudo $WPAS -g /tmp/wpas-wlan2 -Gadmin -Dnl80211 -iwlan2 -c $DIR/p2p2.conf -N -Dnl80211 -ista2 -c $DIR/sta-dummy.conf -ddKt > $DIR/logs/$DATE-log2 &
  19. sudo $HAPD -ddKt -g /var/run/hostapd-global -G admin -ddKt > $DIR/logs/$DATE-hostapd &
  20. sleep 1
  21. sudo chown $USER $DIR/logs/$DATE-hwsim0.dump