]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/tests/deluge/Blink/burn-net
Merge of the latest Deluge T2.
[tinyos-2.x.git] / apps / tests / deluge / Blink / burn-net
index 0d94b40c9634dbcd14a855343f9b2d6e1310cb5f..cc14666103f45bec4c182d6d0994cfee0e61a281 100755 (executable)
@@ -7,7 +7,7 @@ fi
 
 if [ $# -ne 2 ]; then
   echo "Usage: $0 <platform> <number of motes>"
-  echo "  <platform>         micaz or telosb"
+  echo "  <platform>         micaz, telosb or iris"
   echo "  <number of motes>  how many motes will be used in the test"
   exit 2
 fi
@@ -15,7 +15,7 @@ fi
 PLATFORM=$1
 NO_MOTES=$2
 
-if [ ${PLATFORM} != 'micaz' -a ${PLATFORM} != 'telosb' ]; then
+if [ ${PLATFORM} != 'micaz' -a ${PLATFORM} != 'telosb' -a ${PLATFORM} != 'iris' ]; then
   echo "\"${PLAFTORM}\" is not a supported platform"
   exit 2
 fi
@@ -28,29 +28,35 @@ fi
 
 echo ================================ Compile Blink =================================
 make clean
-CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM}
 ID=0
 
 function burn_one() {
     ID=`expr $ID + 1`
-    echo -n ">>> Please plug mote $ID and type the port to continue: "
+    echo -n ">>> Please plug mote $ID and type the programming port to continue: "
     read PORT
 
     if [ ${PLATFORM} == 'micaz' ]
     then
-       CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} reinstall,$ID mib510,${PORT}
+       CFLAGS=$1 make ${PLATFORM} install,$ID mib510,${PORT}
     elif [ ${PLATFORM} == 'telosb' ]
     then
-       CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} reinstall,$ID bsl,${PORT}
+       CFLAGS=$1 make ${PLATFORM} install,$ID bsl,${PORT}
+    elif [ ${PLATFORM} == 'iris' ]
+    then
+       CFLAGS=$1 make ${PLATFORM} install,$ID mib510,${PORT}
     fi
-    
 }
 
-while [[ ${NO_MOTES} > 0 ]]
+while [[ ${NO_MOTES} > 1 ]]
 do
-  burn_one
+  burn_one -DDELUGE_LIGHT_BASESTATION
   NO_MOTES=`expr ${NO_MOTES} - 1`
 done
+echo ">>> Note: this last mote will be the basestation! <<<"
+burn_one -DDELUGE_BASESTATION
+echo -n ">>> Please plug mote $ID and type the communication port to continue: "
+read PORT
+BASESTATION_PORT=$PORT
 
 echo '   +------------------------------------------------------------------------+'
 echo '   |                                                                        |'
@@ -62,10 +68,10 @@ echo '   +----------------------------------------------------------------------
 read
 
 echo ============================= Compile a new Blink ==============================
-CFLAGS=-DBLINK_REVERSE\ -DDELUGE_BASESTATION make ${PLATFORM} 
+CFLAGS=-DBLINK_REVERSE\ -DDELUGE_LIGHT_BASESTATION make ${PLATFORM} 
 
 echo ========= Upload the new image to the external flash of the last mote ==========
-${TOS_DELUGE} ${PORT} ${PLATFORM} -i 1 build/${PLATFORM}/tos_image.xml
+${TOS_DELUGE} ${BASESTATION_PORT} ${PLATFORM} -i 1 build/${PLATFORM}/tos_image.xml
 
 echo '            +-----------------------------------------------------+'
 echo '            |                                                     |'
@@ -76,11 +82,10 @@ echo '            |                                                     |'
 echo '            |              Press ENTER to continue...             |'
 echo '            |                                                     |'
 echo '            +-----------------------------------------------------+'
-
 read
 
 echo ============================= Start dissemination ==============================
-${TOS_DELUGE} ${PORT} ${PLATFORM} -dr 1
+${TOS_DELUGE} ${BASESTATION_PORT} ${PLATFORM} -dr 1
 
 echo '         +------------------------------------------------------------+'
 echo '         |                                                            |'