#!/bin/sh name="tiWlanApp.elf" WLAN_IF="tiwlan0" WLAN_PATH=/opt/ti-wireless/WL6.1.6.0.3/ WLAN_FCC_PATH=$WLAN_PATH/fcc-test WLAN_FCC_CONFIG=/home/tool/config/fcc.json WLAN_SUPPL_PATH=/home/tool/config/wlan/suppl POWERMODE_SCRIPT=$WLAN_FCC_PATH/power-mode.sh CHANNETUNE_SCRIPT=$WLAN_FCC_PATH/channel-tune.sh START_TX=$WLAN_FCC_PATH/start-tx.sh STOP_TX=$WLAN_FCC_PATH/stop-tx.sh WLAN_INI="tiwlan.ini" WL1273_ETSI_INI="TIWI5-LSR-ETSI.ini" WL1273_FCC_INI="TIWI5-LSR-FCC.ini" WLAN_DIAG_PATH=/var/run/diag/tiwlan/ WLAN_DIAG_INTERFACE=$WLAN_DIAG_PATH/interface WLAN_DIAG_FCC=$WLAN_DIAG_PATH/fccmode echo true > $WLAN_DIAG_FCC &> /dev/null fcc_start(){ PID=`ps | grep "[t]iWlanApp.elf" | awk '{print $1}'` kill -9 $PID > /dev/null 2>&1 PID=`ps | grep "[t]iWlanApp.elf" | awk '{print $1}'` kill -9 $PID > /dev/null 2>&1 PID=`ps | grep "[w]pa_supplicant" | awk '{print $1}'` kill -9 $PID > /dev/null 2>&1 PID=`ps | grep "[u]dhcpc" | awk '{print $1}'` kill -9 $PID > /dev/null 2>&1 rmmod tiwlan_drv rmmod sdio rm /var/run/tiwlan/* rm /var/run/cli.log cd $WLAN_PATH # ETSI oder FCC Ini File RegDom=`cat $WLAN_FCC_CONFIG | grep "regulatory-domain" | awk '{print $2}' | sed 's/"//g' | sed 's/,//' ` case "$RegDom" in ETSI) # ETSI - European Telecommunications Standards Institute echo "Regulatory Domain ETSI" rm tiwlan.ini ln -s $WL1273_ETSI_INI $WLAN_INI INI=$WL1273_ETSI_INI ;; FCC) # FCC - Federal Communication Commission echo "Regulatory Domain FCC" rm tiwlan.ini ln -s $WL1273_FCC_INI $WLAN_INI INI=$WL1273_FCC_INI ;; TI) # Texas Instruments File echo "Texas Instruments tiwlan-dual.ini" rm tiwlan.ini ln -s $WL1273_INI $WLAN_INI INI=$WL1273_INI ;; esac lsmod | grep 'sdio' if [ "$?" -ne "0" ]; then /usr/local/bin/python nvsmap.py if [ "$?" -eq "0" ]; then echo "read nvs_map Success" else echo "read nvs_map Failed" fi insmod sdio.ko if [ "$?" -eq "0" ]; then echo "sdio.ko Success" else echo "sdio.ko Failed" if [ "$?" -ne 0 ]; then rmmod sdio fi fi sleep 1 insmod tiwlan_drv.ko if [ "$?" -eq "0" ]; then echo "tiwlan_drv.ko Success" else echo "tiwlan_drv.ko Failed" if [ "$?" -ne 0 ]; then rmmod tiwlan_drv fi fi sleep 1 ./tiwlan_loader if [ "$?" -eq "0" ]; then echo "loading firmware Success" else echo "loading firmware Failed" if [ "$?" -ne 0 ]; then rmmod tiwlan_drv #rmmod bmtrace rmmod sdio fi fi sleep 1 fi ifconfig $WLAN_IF 192.168.0.254 netmask 255.255.255.0 up ./wpa_supplicant -Dwext -itiwlan0 -c $WLAN_SUPPL_PATH/wpa_supplicant.txt -d &> /var/log/wpa_supp.log & sleep 3 # Auslesen der Parameter Band=`cat $WLAN_FCC_CONFIG | grep "Band" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` Channel=`cat $WLAN_FCC_CONFIG | grep "Channel" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` Delay=`cat $WLAN_FCC_CONFIG | grep "Delay" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` Rate=`cat $WLAN_FCC_CONFIG | grep "Rate" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` Size=`cat $WLAN_FCC_CONFIG | grep "Size" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` Amount=`cat $WLAN_FCC_CONFIG | grep "Amount" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` Power=`cat $WLAN_FCC_CONFIG | grep "Power" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` Seed=`cat $WLAN_FCC_CONFIG | grep "Seed" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` PacketMode=`cat $WLAN_FCC_CONFIG | grep "PacketMode" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` DcfOnOff=`cat $WLAN_FCC_CONFIG | grep "DcfOnOff" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` GI=`cat $WLAN_FCC_CONFIG | grep "GI" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` Preamble=`cat $WLAN_FCC_CONFIG | grep "Preamble" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` Type=`cat $WLAN_FCC_CONFIG | grep "Type" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` Scrambler=`cat $WLAN_FCC_CONFIG | grep "Scrambler" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` EnableCLPC=`cat $WLAN_FCC_CONFIG | grep "EnableCLPC" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` SeqNumMode=`cat $WLAN_FCC_CONFIG | grep "SeqNumMode" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` HwAdress=`cat $WLAN_FCC_CONFIG | grep "HwAdress" | awk '{print $2}' | sed 's/"//g' | sed 's/,//'` cd $WLAN_FCC_PATH # Power Einstellung ./wlan_cu -s $POWERMODE_SCRIPT &> output.txt sleep 1 # Band und Kanal Einstellung echo "Band <$Band> Channel <$Channel>" sed -i 's/h.*/h '$Band' '$Channel'/' $CHANNETUNE_SCRIPT ./wlan_cu -s $CHANNETUNE_SCRIPT &> output.txt sleep 1 # Start Continous Tx sed -i 's/n.*/n '$Delay' '$Rate' '$Size' '$Amount' '$Power' '$Seed' '$PacketMode' '$DcfOnOff' '$GI' '$Preamble' '$Type' '$Scrambler' '$EnableCLPC' '$SeqNumMode' '$HwAdress'/' $START_TX ./wlan_cu -s $START_TX &> output.txt exit } fcc_stop(){ # Stop Continous Transmission cd $WLAN_FCC_PATH ./wlan_cu -s $STOP_TX &> output.txt exit } case "$1" in start) echo "fcc Start" fcc_start ;; stop) echo "fcc Stop" fcc_stop ;; *) echo "Invalid Command ($1)" ;; esac