From 9fcf506d88308af6757747992399fab982ede9d9 Mon Sep 17 00:00:00 2001 From: kaisenl Date: Tue, 15 Dec 2009 01:12:47 +0000 Subject: [PATCH] Application must enable radio --- apps/tests/TestDip/Makefile | 7 +++++++ apps/tests/TestDip/README | 7 ++++--- apps/tests/TestDip/TestDipC-Master.nc | 3 +++ apps/tests/TestDip/TestDipP-Master.nc | 21 +++++++++++++++++---- tos/lib/net/dip/AMDipC.nc | 4 ---- tos/lib/net/dip/AMDipP.nc | 16 ---------------- 6 files changed, 31 insertions(+), 27 deletions(-) diff --git a/apps/tests/TestDip/Makefile b/apps/tests/TestDip/Makefile index ed0305ab..1576ee72 100644 --- a/apps/tests/TestDip/Makefile +++ b/apps/tests/TestDip/Makefile @@ -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: diff --git a/apps/tests/TestDip/README b/apps/tests/TestDip/README index b216bbfc..7930653a 100644 --- a/apps/tests/TestDip/README +++ b/apps/tests/TestDip/README @@ -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 diff --git a/apps/tests/TestDip/TestDipC-Master.nc b/apps/tests/TestDip/TestDipC-Master.nc index 447e3e95..45119ee7 100644 --- a/apps/tests/TestDip/TestDipC-Master.nc +++ b/apps/tests/TestDip/TestDipC-Master.nc @@ -26,4 +26,7 @@ implementation { components new SerialAMSenderC(AM_TESTDIP); TestDipP.SerialSend -> SerialAMSenderC; TestDipP.SerialControl -> SerialActiveMessageC; + + components ActiveMessageC; + TestDipP.AMControl -> ActiveMessageC; } diff --git a/apps/tests/TestDip/TestDipP-Master.nc b/apps/tests/TestDip/TestDipP-Master.nc index 786c95b9..ec3d7beb 100644 --- a/apps/tests/TestDip/TestDipP-Master.nc +++ b/apps/tests/TestDip/TestDipP-Master.nc @@ -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(); diff --git a/tos/lib/net/dip/AMDipC.nc b/tos/lib/net/dip/AMDipC.nc index 2935a1f4..edac8b17 100644 --- a/tos/lib/net/dip/AMDipC.nc +++ b/tos/lib/net/dip/AMDipC.nc @@ -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; diff --git a/tos/lib/net/dip/AMDipP.nc b/tos/lib/net/dip/AMDipP.nc index 48e3c677..a3be418f 100644 --- a/tos/lib/net/dip/AMDipP.nc +++ b/tos/lib/net/dip/AMDipP.nc @@ -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; -- 2.39.2