---------- Forwarded message ----------
From: Rubenalia <[email protected]>
Date: 2009/2/15
Subject: Use of MultihopRouter in my app
To: [email protected]


`Hi all,

I'm doing an application that sense a temp value and send it throught the
WSN using MultihopRouter (tinyos 1), but I have some doubts about how it
works.

If I wire the configuration file like Surge in TinyOS, the receive() event
is never signaled in my app, so If I want to do something when a message is
received by any mote, I can't do it.

i discovered that if I want to do something inside the receive event() in
my application, I must change the configuration file like this:

configuration MiAplicacion2 {
}
implementation {
  components Main, MiAplicacion2M, TimerC, LedsC, PhotoTemp, RandomLFSR,
    GenericCommPromiscuous as Comm, QueuedSend, Sounder, MultiHopRouter as
multihopM;
  Main.StdControl -> MiAplicacion2M.StdControl;
  Main.StdControl -> multihopM.StdControl;
  Main.StdControl -> QueuedSend.StdControl;
  Main.StdControl -> TimerC;
  Main.StdControl -> Comm;

  MiAplicacion2M.TempControl -> PhotoTemp.TempStdControl;
  MiAplicacion2M.Temperature -> PhotoTemp.ExternalTempADC;

  MiAplicacion2M.Timer -> TimerC.Timer[unique("Timer")];
  MiAplicacion2M.Leds  -> LedsC;
  MiAplicacion2M.Sounder -> Sounder;

  MiAplicacion2M.RouteControl -> multihopM;
  MiAplicacion2M.MultihopSend -> multihopM.Send[AM_DATAMSG];
  multihopM.ReceiveMsg[AM_DATAMSG] -> Comm.ReceiveMsg[AM_DATAMSG];
  MiAplicacion2M.ReceiveMsg -> Comm.ReceiveMsg[AM_DATAMSG];
And in my module file I have the following:
module MiAplicacion2M {
  provides {
    interface StdControl;
  }
  uses {
 //Temp
 interface StdControl as TempControl;
 interface ADC as Temperature;

 interface Timer;
    interface Leds;
    interface StdControl as Sounder;
    interface Send as MultihopSend;
    interface ReceiveMsg;
    interface RouteControl;
  }


But I don't know if I do this, ¿am i losing the multihop funcionallity? or
¿is it ok?. If so, ¿how can I do to be sure that it's working ok?

Thanks a lot.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to