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

Reply via email to