[Tinyos-help] How to Send Msgs fromTOSBase to a Mote
Using GenricComm
Michael Schippling
schip at santafe.edu
Thu Aug 2 09:47:30 PDT 2007
That code looks correct to me. Start by sending to BCAST addr
just in case you have a moteID mismatch. Also check that you
have the right xmit frequency and power defines. Have you
even gotten a radio message to work, like with one of the
demo apps? The apps/MicaHWVerify program tests radio connectivity.
MS
antonio gonga wrote:
> Hey all,
> I'm trying to send messages from the TOSBase to a Mote... I receive the
> packet correctly in TOSBase.. but the Mote is not receiving...
> I need your suggestions...
> configuration Receiver {
> }
> implementation {
> components Main, ReceiverM;
> components GenericComm as Comm;
> components IntToLeds;
>
> Main.StdControl -> ReceiverM.StdControl;
> Main.StdControl ->IntToLeds.StdControl;
> Main.StdControl -> Comm;
>
> ReceiverM.RadioControl ->Comm.Control;
> ReceiverM.RadioReceive ->Comm.ReceiveMsg[0xa];
> //ReceiverM.RadioSend ->Comm;
> IntToLeds.IntOutput <-ReceiverM.IntOutput;
> }
> ___________________________
> includes AM;
> includes queryMsg;
> module ReceiverM {
> provides {
> interface StdControl;
> }uses{
> interface StdControl as RadioControl;
> interface IntOutput;
> //interface Receive as Bcast;
>
> interface ReceiveMsg as RadioReceive;
> //interface BareSendMsg as RadioSend;
> }
> }
> implementation {
>
> command result_t StdControl.init() {
> call RadioControl.init();
> return SUCCESS;
> }
> command result_t StdControl.start() {
> call RadioControl.start();
> return SUCCESS;
> }
>
> command result_t StdControl.stop() {
> call RadioControl.stop();
> return SUCCESS;
> }
> event TOS_MsgPtr RadioReceive.receive(TOS_MsgPtr Msg) {
> TOS_MsgPtr pBuf = Msg;
> queryMsg *p =(queryMsg*)Msg->data;
> call IntOutput.output(0x7);
> return pBuf;
> }
> event result_t IntOutput.outputComplete(result_t success){
> return SUCCESS;
> }
> }
> I think that the code is OK..
>
>
> ------------------------------------------------------------------------
> Missed the show? Watch videos of the Live Earth Concert on MSN. See
> them now! <http://liveearth.msn.com>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
More information about the Tinyos-help
mailing list