Hi again,

Having gotten serial communication working, I now have a problem with
execution of a command being deferred.  As a small example for this email, I
have the following code:

  event TOS_MsgPtr msgIn.receive(TOS_MsgPtr m)  {
    struct testSendMsg *r;
    TOS_MsgPtr tmp;
    tmp = pBuffer;
    pBuffer = m;
    r = (struct testSendMsg*)tmp->data;
    
    cmd = r->cmd;
    if (cmd == 1)
      call Leds.redToggle();
     
    return tmp;
    }

'cmd' is part of the message data field, and is set by the Delphi program
sending the message to a mote.  Hence, on sending a message, the red led
should toggle.  However, it doesn't the first time a packet is sent; instead
it waits until the second packet.  Why would this be?  

I have checked that the packet is being sent by analysing serial traffic -
also, if I remove the condition statement then the red led does toggle, so I
am a little confused...

Cheers,

----------
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

Reply via email to