]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Application must enable radio
authorkaisenl <kaisenl>
Tue, 15 Dec 2009 01:12:47 +0000 (01:12 +0000)
committerkaisenl <kaisenl>
Tue, 15 Dec 2009 01:12:47 +0000 (01:12 +0000)
apps/tests/TestDip/Makefile
apps/tests/TestDip/README
apps/tests/TestDip/TestDipC-Master.nc
apps/tests/TestDip/TestDipP-Master.nc
tos/lib/net/dip/AMDipC.nc
tos/lib/net/dip/AMDipP.nc

index ed0305abba9929829147c8f2cd8a4b222e85e405..1576ee72f6d94db238fcb9b6418ebf12648fd448 100644 (file)
@@ -5,8 +5,15 @@ CFLAGS += -I$(TOSDIR)/lib/net/dip -I$(TOSDIR)/lib/net/dip/interfaces
 #CFLAGS += -I$(TOSDIR)/lib/net/drip
 
 CONSTANTS += -DTOSH_DATA_LENGTH=32
+#CONSTANTS += -DDIP_JOINTEST
 CFLAGS += $(CONSTANTS)
 
+# LPL FLAGS
+#CFLAGS += -DLOW_POWER_LISTENING
+#CFLAGS += -DLPL_DEF_LOCAL_WAKEUP=512
+#CFLAGS += -DLPL_DEF_REMOTE_WAKEUP=512
+#CFLAGS += -DDELAY_AFTER_RECEIVE=20
+
 CLEAN_EXTRA += DipMsg.py DipDataMsg.py DipData.py DipMsg.java DipDataMsg.java DipData.java DipMsg.class DipDataMsg.class DipData.class DipInject.class
 
 DipMsg.py:
index b216bbfcc174faa0bc65be7182c2dcd9135949bb..7930653ab44b00fd0b9fff3cb1f6b6ef74fdaf62 100644 (file)
@@ -75,7 +75,8 @@ With 128 items or more, MicaZ nodes don't receive anything. Memory limitation?
 
 If you are using the Basestation application to sniff what packets are
 being sent in the air, you will need to adjust the packet size to match
-the test application. For this specific application, you will need to
-add the following to your Makefile:
+the test application. You can add the following to your Makefile:
 
-CFLAGS += -DTOSH_DATA_LENGTH=32
\ No newline at end of file
+CFLAGS += -DTOSH_DATA_LENGTH=XX
+
+where XX is your payload size
index 447e3e95b7ef1ac5e76e3ddd7c96982947785158..45119ee7500cc5ffd183cba23f6374afc8b18164 100644 (file)
@@ -26,4 +26,7 @@ implementation {
   components new SerialAMSenderC(AM_TESTDIP);
   TestDipP.SerialSend -> SerialAMSenderC;
   TestDipP.SerialControl -> SerialActiveMessageC;
+
+  components ActiveMessageC;
+  TestDipP.AMControl -> ActiveMessageC;
 }
index 786c95b9e6c79b487725be873515976dcb38424d..ec3d7bebb860ae185c88245fd2488ab8c3675dd1 100644 (file)
@@ -13,6 +13,7 @@ module TestDipP {
   uses interface Boot;
   uses interface AMSend as SerialSend;
   uses interface SplitControl as SerialControl;
+  uses interface SplitControl as AMControl;
 }
 
 implementation {
@@ -35,8 +36,20 @@ implementation {
   void bookkeep();
 
   event void SerialControl.startDone(error_t err) {
+    if(err != SUCCESS) {
+      call SerialControl.start();
+      return;
+    }
+    call AMControl.start();
+  }
+
+  event void AMControl.startDone(error_t err) {
+    if(err != SUCCESS) {
+      call AMControl.start();
+      return;
+    }
     call StdControl.start();
-    if(TOS_NODE_ID == 0) {
+    if(TOS_NODE_ID == 1) {
       data = 0xBEEF;
       dbg("TestDipP","Updating data items\n");
       /*
@@ -46,14 +59,14 @@ implementation {
     }
   }
   
-  event void SerialControl.stopDone(error_t err) {
-    
-  }
+  event void SerialControl.stopDone(error_t err) { }
+  event void AMControl.stopDone(error_t err) { }
 
   event void Boot.booted() {
     call SerialControl.start();
     dbg("TestDipP", "Booted at %s\n", sim_time_string());
   }
+
   /*
   event void DisseminationValue1.changed() {
     uint16_t val = *(uint16_t*) call DisseminationValue1.get();
index 2935a1f4d4e16630d75e19a689c84dde093f6463..edac8b17102a8caf9a2428361588f80faa62f77e 100644 (file)
@@ -17,10 +17,6 @@ implementation {
 
   components MainC;
   MainC.SoftwareInit -> AMDipP.Init;
-  AMDipP.Boot -> MainC;
-
-  components ActiveMessageC;
-  AMDipP.AMSplitControl -> ActiveMessageC;
 
   DipSend = AMDipP.DipSend;
   DataReceive = AMDipP.DipDataReceive;
index 48e3c677101112eae15d329b046b5e2d121cd951..a3be418f552ffd96e725b3be4268f4212f7e99dc 100644 (file)
@@ -10,28 +10,12 @@ module AMDipP {
   uses interface AMSend as NetAMSend;
   uses interface Receive as NetReceive;
 
-  uses interface SplitControl as AMSplitControl;
-  uses interface Boot;
 }
 
 implementation {
   message_t am_msg;
   bool busy;
 
-  event void Boot.booted() {
-    call AMSplitControl.start();
-  }
-
-  event void AMSplitControl.startDone(error_t err) {
-    if(err != SUCCESS) {
-      call AMSplitControl.start();
-      return;
-    }
-    dbg("AMDipP", "ActiveMessageC started!\n");
-  }
-
-  event void AMSplitControl.stopDone(error_t err) { }
-
   command error_t Init.init() {
     busy = FALSE;
     return SUCCESS;