#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:
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
components new SerialAMSenderC(AM_TESTDIP);
TestDipP.SerialSend -> SerialAMSenderC;
TestDipP.SerialControl -> SerialActiveMessageC;
+
+ components ActiveMessageC;
+ TestDipP.AMControl -> ActiveMessageC;
}
uses interface Boot;
uses interface AMSend as SerialSend;
uses interface SplitControl as SerialControl;
+ uses interface SplitControl as AMControl;
}
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");
/*
}
}
- 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();
components MainC;
MainC.SoftwareInit -> AMDipP.Init;
- AMDipP.Boot -> MainC;
-
- components ActiveMessageC;
- AMDipP.AMSplitControl -> ActiveMessageC;
DipSend = AMDipP.DipSend;
DataReceive = AMDipP.DipDataReceive;
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;