Krisakorn,

Thanks for the pointer.  I had been using the Crossbow examples, but I found
the Oscilloscope much more useful and now I have a working sample program.
I have seen the Oscilloscope program before in the tutorials but had
forgotten about it until you mentioned it.  

The problem lay with incorrect wiring of components.  Naively I assumed that
the compiler would complain if components were wired incorrectly - now that
I know this not to be the case, I'll be more careful in future.

Thanks again,

Alex.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Krisakorn
Rerkrai
Sent: 17 November 2005 13:50
To: [EMAIL PROTECTED]
Cc: [email protected]
Subject: Re: [Tinyos-help] Receive event

Hi,

I can't tell you much by reading only a few lines of code.
You should have a look in /apps/OscilloscopeRF.
That explains how to use SendMsg/ReceiveMsg interface.
Or you could show me how you wire components in
the configuration file.

Krisakorn

On 11/17/05, Alex Mason <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I tried using the ReceiveMsg interface before using Receive... neither
seem
> to produce a positive result (i.e. - for simple testing, toggling the
green
> LED).  If I choose to use something like:
>
>     event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr m)  {
>
>       // msg should have been received - toggle LED
>       call Leds.greenToggle();
>
>       return m;
>       }
>
> That should work?  But... it doesn't :(
>
> Cheers,
>
> Alex.
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
Krisakorn
> Rerkrai
> Sent: 17 November 2005 12:29
> To: [EMAIL PROTECTED]
> Cc: [email protected]
> Subject: Re: [Tinyos-help] Receive event
>
> Hi,
>
> Who is using this Receive interface?
> The Receive interface should be called above layer2 (AMStandard).
> If you are talking about using a simple send/receive application,
> what you need is ReceiveMsg/SendMsg interface.
>
> If you really want to use Receive interface, you have to signal
> Receive.receive somewhere.
> For example,
>
> event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr msg) {
>
>     signal Receive.receive(msg, msg->data, msg->length);
>     return msg;
> }
>
> Regards,
> Krisakorn
>
>
> On 11/17/05, Alex Mason <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I am trying to perform some action on the receive event.  Nothing was
> > working, so I tried writing a small program that just sends a message
> every
> > second.  So I thought, I'll light the green LED to signify when a
message
> > has been received.  So, the relevant code for this that I have:
> >
> >
> > USES:  interface Receive;
> >
> >
> > event TOS_MsgPtr Receive.receive(TOS_MsgPtr msg, void* payload, uint16_t
> > payloadLen)  {
> >       TOS_MsgPtr pMsg;
> >
> >       // msg should have been received - toggle LED
> >       call Leds.greenToggle();
> >
> >       return pMsg;
> >       }
> >
> > To me that looks simple and should work, but hopefully someone can
> enlighten
> > me!
> >
> > TIA,
> >
> > ----------
> > Alex Mason
> > Postgraduate Research
> > RFID & Wireless Sensor Networks
> > Liverpool John Moores University
> >
> > Email: [EMAIL PROTECTED]
> > Phone: +447886389484
> >
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> >
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>

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

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

Reply via email to