You should use MultiHopLQI. See /opt/moteiv/apps/Delta for an example.
-Joe On 12/29/06, YIP Chi Chung <[EMAIL PROTECTED]> wrote:
Hi, I am new to tinyos and I got some problems in using MultiHopRouter. I need to implement a testing program which a node will send an integer to other nodes, and other nodes will increase the number by 1 and then send to other nodes again and again. A node will connect to the PC and display the integer, the node address and also the hop count. However, I don't know how to use MultiHopRouter, I got error during compilation. I am using tmote. My code is like this: includes IntMsg; includes MultiHop; configuration AddNum2 { } implementation { components Main, AddNum2M, SingleTimer, LedsC, GenericComm as Comm, Bcast, MultiHopRouter as multihopM, QueuedSend; Main.StdControl -> AddNum2M.StdControl; Main.StdControl -> Comm; Main.StdControl -> Bcast.StdControl; Main.StdControl -> multihopM.StdControl; Main.StdControl -> QueuedSend.StdControl; Main.StdControl -> SingleTimer.StdControl; AddNum2M.Leds -> LedsC; AddNum2M.Timer -> SingleTimer.Timer; AddNum2M.SendMsg -> Comm.SendMsg[AM_INTMSG]; AddNum2M.Read -> Comm.ReceiveMsg[AM_INTMSG]; AddNum2M.Bcast -> Bcast.Receive[AM_INTMSG]; Bcast.ReceiveMsg[AM_INTMSG] -> Comm.ReceiveMsg[AM_INTMSG]; AddNum2M.RouteControl -> multihopM; AddNum2M.Send -> multihopM.Send[AM_INTMSG]; multihopM.ReceiveMsg[AM_INTMSG] -> Comm.ReceiveMsg[AM_INTMSG]; } And this is the error I have got: C:/cygwin/opt/moteiv/tos/lib/sp/GenericCommPromiscuous.nc:31:2: warning: #warning "GenericCommPromiscuous is deprecated, please use GenericComm instead" In file included from C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopRouter.nc:93, from AddNum2.nc:7: In component `MultiHopEngineM': C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopEngineM.nc: In function `Send.send': C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopEngineM.nc:136: too few arguments to function `RouteSelect.selectRoute' C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopEngineM.nc: In function `mForward': C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopEngineM.nc:167: too few arguments to function `RouteSelect.selectRoute' In file included from C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopRouter.nc:93, from AddNum2.nc:7: In component `MultiHopLEPSM': C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopLEPSM.nc: In function `SendRouteTask.runTask': C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopLEPSM.nc:398: implicit declaration of function `qsort' C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopLEPSM.nc: At top level: C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopLEPSM.nc:507: conflicting types for `RouteSelect.selectRoute' C:/cygwin/opt/moteiv/tos/lib/MultiHopLQI/RouteSelect.nc:71: previous declaration of `RouteSelect.selectRoute' C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopLEPSM.nc:56: `RouteSelect.isDuplicate' not implemented In component `MultiHopRouter': C:/cygwin/opt/moteiv/tinyos-1.x/tos/lib/Route/MultiHopRouter.nc:112: no match make: *** [exe0] Error 1 I really have no idea on how to do it. Can anyone give me some hints? Thank you very much Phoenix _______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help