return (uint8_t)sig;
}
-
+ async command cc2420_header_t* Packet.getHeader(message_t* msg) {
+ return NULL;
+ }
+ async command cc2420_metadata_t* Packet.getMetadata(message_t* msg) {
+ return NULL;
+ }
}
increase the message_t size. */
NREADINGS = 5,
/* Default sampling period. */
- DEFAULT_INTERVAL = 1024,
+ DEFAULT_INTERVAL = 200,
AM_OSCILLOSCOPE = 0x93
};
//
// Components for debugging collection.
//
- /* components new PoolC(message_t, 20) as DebugMessagePool,
+ components new PoolC(message_t, 20) as DebugMessagePool,
new QueueC(message_t*, 20) as DebugSendQueue,
- new SerialAMSenderC(AM_CTP_DEBUG) as DebugSerialSender,
+ new SerialAMSenderC(AM_LQI_DEBUG) as DebugSerialSender,
UARTDebugSenderP as DebugSender;
DebugSender.Boot -> MainC;
DebugSender.UARTSend -> DebugSerialSender;
DebugSender.MessagePool -> DebugMessagePool;
DebugSender.SendQueue -> DebugSendQueue;
- Collector.CollectionDebug -> DebugSender;*/
+ Collector.CollectionDebug -> DebugSender;
}
local.interval = DEFAULT_INTERVAL;
local.id = TOS_NODE_ID;
local.version = 0;
-
+ dbg("App", "Booted.");
// Beginning our initialization phases:
if (call RadioControl.start() != SUCCESS)
fatal_problem();
Receive.receive(message_t* msg, void *payload, uint8_t len) {
oscilloscope_t* in = (oscilloscope_t*)payload;
oscilloscope_t* out;
+ dbg("App", "Received a packet.\n\t");
+ {
+ int i;
+ for (i = 0; i < len; i++) {
+ dbg_clear("App", "[%hhx] ", ((uint8_t*)payload)[i]);
+ }
+ dbg_clear("App", "\n");
+ }
if (uartbusy == FALSE) {
out = (oscilloscope_t*)call SerialSend.getPayload(&uartbuf);
if (len != sizeof(oscilloscope_t)) {
if (!sendbusy) {
oscilloscope_t *o = (oscilloscope_t *)call Send.getPayload(&sendbuf);
memcpy(o, &local, sizeof(local));
- if (call Send.send(&sendbuf, sizeof(local)) == SUCCESS)
+ if (call Send.send(&sendbuf, sizeof(local)) == SUCCESS) {
+ dbg("App", "Sending a packet.\n");
sendbusy = TRUE;
+ }
else
report_problem();
}
#t.addChannel("RadioCountToLedsC", sys.stdout)
#t.addChannel("CpmModelC", sys.stdout)
#t.addChannel("Gain", sys.stdout)
-#t.addChannel("AM", sys.stdout)
+t.addChannel("AM", sys.stdout)
+t.addChannel("App", sys.stdout)
#t.addChannel("LQI", sys.stdout)
-t.addChannel("LQIRoute", sys.stdout)
-t.addChannel("LQIDeliver", sys.stdout)
#t.addChannel("LQIRoute", sys.stdout)
+#t.addChannel("LQIDeliver", sys.stdout)
+#t.addChannel("LQIRoute", sys.stdout)
+#t.addChannel("PointerBug", sys.stdout)
start = time.time();
noise = open("meyer-short.txt", "r")
start = time.time();
for i in range(0, 7):
t.getNode(i).createNoiseModel();
- t.getNode(i).bootAtTime(random.random() * 10000000 + 20000000);
+ t.getNode(i).bootAtTime(int(random.random() * 10000000 + 20000000));
duration = end - start;
print "time: ", duration;
#for i in range(0, 196607):
# print m1.generateNoise(i)
-for i in range(0, 1000000):
+for i in range(0, 2000):
t.runNextEvent();