Hello,
we are simulating a sensor network with TinyDB (using TOSSIM and tinyViz for showing simulated radio packets and for turning on/off the motes) and we thought to use the StatusMsg class to check if motes are all alive:
Status msg = new StatusMsg();
msg.set_fromBase((byte)Base);
TinyDBMain.mif.send(moteID, (Message)msg);
.
.
.
.
public void messageReceived(int addr, Message m)
{
if(m istanceof StatusMsg)
{
StatusMsg msg = (StatusMsg)m;
System.out.println(addr +" "+ msg.get_fromBase() +" "+ msg.getElement_queries(0));
}
}
If we set Base = 0, messageReceived is never called.
For any other value of Base>0, messageReceived is called and we get correct value of the ID of the query running in the network (SELECT nodeid).
What's wrong is that if we set moteID with a sense or no sense value, it doesn't matter and we get a message with always msg.get_fromBase()=0. The only other way to not get messages is to turn off mote 0 from tinyViz.
In this scenario we can't use these routines to check if motes are alive, or we are not using them in the correct way.... Any one can help?
-- Ing. Marco Maniezzo Politecnico di Torino Dip. Automatica e Informatica C.so Duca degli Abruzzi 24, I-10129 Torino (ITALY) Phone: +39 011 564 7068 mail: [EMAIL PROTECTED]
_______________________________________________ Tinyos-users mailing list [EMAIL PROTECTED] http://mail.Millennium.Berkeley.EDU/mailman/listinfo/tinyos-users
