X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=apps%2Ftests%2Fdeluge%2FBlink%2Fburn;h=fa4a3b1e00e2ec128d919e3d25c425ac38ee765d;hp=1e82f5d3b23859ce8d8440fff2b1bf7f5985b89d;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hpb=adf1de6c009d13b7b52e68535c63b28f59c97400 diff --git a/apps/tests/deluge/Blink/burn b/apps/tests/deluge/Blink/burn index 1e82f5d3..fa4a3b1e 100755 --- a/apps/tests/deluge/Blink/burn +++ b/apps/tests/deluge/Blink/burn @@ -1,41 +1,37 @@ #!/bin/bash -python -c ' -import sys -try: - import serial -except ImportError, e: - sys.exit(1)' - -if [[ $? != 0 ]] -then - echo "Please install PySerial first." - exit 2 -fi - TOS_DELUGE=`type -p tos-deluge` if [[ ! -x ${TOS_DELUGE} ]] ; then TOS_DELUGE=../../../../tools/tinyos/misc/tos-deluge fi -if [[ $# -ne 2 && $# -ne 3 ]]; then - echo "Usage: $0 [] " - echo " /dev/ttyUSB0" - echo " /dev/ttyUSB1" - echo " micaz, telosb or iris" +$TOS_DELUGE > /dev/null + +if [[ $? != 0 ]] +then + echo "Unable to locate tos-deluge." exit 2 fi -PPORT=$1 -CPORT=$1 -PLATFORM=$2 - -if [ $# -eq 3 ]; then - CPORT=$2 - PLATFORM=$3 +if [[ $# -ne 3 ]]; then + echo "Usage: $0 " + echo " bsl,PORT | mib510,PORT | eprb,HOST" + echo " serial@PORT:SPEED | network@HOST:PORT" + echo " micaz | telosb | iris | epic | mulle" + exit 2 fi -if [ ${PLATFORM} != 'micaz' -a ${PLATFORM} != 'telosb' -a ${PLATFORM} != 'iris' ]; then +PPORT=$1 +CPORT=$2 +PLATFORM=$3 + +if [ ${PLATFORM} != 'micaz' -a \ + ${PLATFORM} != 'telosb' -a \ + ${PLATFORM} != 'iris' -a \ + ${PLATFORM} != 'mulle' -a \ + ${PLATFORM} != 'tinynode' -a \ + ${PLATFORM} != 'epic' ] +then echo "\"${PLATFORM}\" is not a supported platform" exit 2 fi @@ -49,16 +45,7 @@ fi make clean echo ============================ Compile and load Blink ============================ -if [ $PLATFORM == 'micaz' ] -then - CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install mib510,${PPORT} -elif [ $PLATFORM == 'telosb' ] -then - CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install bsl,${PPORT} -elif [ $PLATFORM == 'iris' ] -then - CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install mib510,${PPORT} -fi +CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} install ${PPORT} echo ' +-------------------------------------------------------+' @@ -74,7 +61,7 @@ echo ============================= Compile a new Blink ======================== CFLAGS=-DBLINK_REVERSE\ -DDELUGE_BASESTATION make ${PLATFORM} echo =============================== Upload the image =============================== -${TOS_DELUGE} ${CPORT} ${PLATFORM} -i 1 build/${PLATFORM}/tos_image.xml +${TOS_DELUGE} ${CPORT} -i 1 build/${PLATFORM}/tos_image.xml echo ' +----------------------------------------------------------------+' echo ' | |' @@ -91,4 +78,4 @@ echo ' +----------------------------------------------------------------+' read echo =========================== Reboot the base station ============================ -${TOS_DELUGE} ${CPORT} ${PLATFORM} -r 1 +${TOS_DELUGE} ${CPORT} -r 1