Hi all,
The slice of code works fine to Oscilloscope application, but it
doesn't work to MultihopOscilloscope application.
Running this code with Oscilloscope application, I can see the
following debug messages:
DEBUG (2): sim_packet.c: Delivering packet 0x82ca690 to 2 at 820108
DEBUG (2): Delivering packet to 2 at 0:0:0.000082010
DEBUG (2): Received active message (0xb7c4417c) of type 147 and length
28 for me @ 0:0:0.000082010.
DEBUG (2): Receive.receive (OscilloscopeC.nc) ------------------------
The last line is the debug message inserted in the OscilloscopeC.nc
(method Receive.receive).
Running the same code with MultihopOscilloscope application, the
Receive.receive and Snoop.receive methods are not called. I can see
the following debug messages:
DEBUG (3): sim_packet.c: Delivering packet 0x82d5338 to 1 at 1810009
DEBUG (1): Delivering packet to 1 at 0:0:0.000181000
DEBUG (1): Received active message (0xb798424e) of type 147 and length
18 for me @ 0:0:0.000181000.
When the node is not the destination, I can see:
DEBUG (2): Delivering packet to 2 at 0:0:0.224620375
DEBUG (2): Snooped on active message of type 147 and length 18 for 1 @
0:0:0.224620375.
DEBUG (2): sim_packet.c: Delivering packet 0x82d5338 to 2 at 2246903758
DEBUG (2): Delivering packet to 2 at 0:0:0.224690375
DEBUG (2): Snooped on active message of type 147 and length 18 for 1 @
0:0:0.224690375.
DEBUG (3): sim_packet.c: Delivering packet 0x82d5338 to 2 at 22479037
So, any idea why the methods are not called with the MultihopOscilloscope?
Thanks a lot.
Best regards
Daniel Patrick
File: test.py - Slice of code
....
# radio msg
msg = Oscilloscope()
msg.set_count(0xFF);
msg.set_version(0x01);
msg.set_interval(10);
msg.set_id(2);
msg.set_readings([1,2,3,4]);
# Packet
pkt = t.newPacket();
pkt.setSource(2);
pkt.setData(msg.data)
pkt.setType(msg.get_amType())
pkt.setDestination(2)
f = open("topo.txt", "r")
lines = f.readlines()
for line in lines:
s = line.split()
if (len(s) > 0):
print " ", s[0], " ", s[1], " ", s[2];
r.add(int(s[0]), int(s[1]), float(s[2]))
noise = open("meyer-heavy.txt", "r")
lines = noise.readlines()
for line in lines:
str = line.strip()
if (str != ""):
val = int(str)
for i in range(1, 4):
t.getNode(i).addNoiseTraceReading(val)
for i in range(1, 4):
print "Creating noise model for ",i;
t.getNode(i).createNoiseModel()
t.getNode(1).bootAtTime(100001);
t.getNode(2).bootAtTime(800008);
t.getNode(3).bootAtTime(1800009);
varTime = 10000
pkt.deliver(1, t.time()+varTime);
tt = t.time() + varTime
for i in range(0, 10000000):
t.runNextEvent()
if (t.time() > tt):
tt = t.time() + varTime;
pkt.deliver(1, tt)
time.sleep(0.5)
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help