You can only do one send() at a time using GenericComm
so call the second from the sendDone() of the first.
I just referenced my code for another of your questions
and it has an example of doing the above...

Also on the micaz/mica2 problem vis [EMAIL PROTECTED]:mica2 --

It's confusing...but the message format on the host side
is that of tos/types/AM.h, which is the "serial" format
and shared with the mica2 radio. So you need to use ":mica2"
for both platforms. The Inject problem may be because you
need to change the MOTECOM to point to serial forwarder
rather than the [EMAIL PROTECTED]:mica2. There should be an
example of the correct setting in the S.F. doc.

MS


Heo Heo wrote:
I wrote a simple program (based on Blink, Oscilloscope & OscilloscopeRF) in which the timer fires every 1000ms. On each timer event, the mote (micaz) sends a packet to both the UART and the wireless link (one after another). It seems like a simple program, but I don't know why I can only send the packet to one of them. I copied the code snippet below: TOS_Msg msg; task void SendMsgToUART()
{
  call DataMsgUart.send(TOS_UART_ADDR, sizeof(struct OscopeMsg), &msg);
}
task void SendMsgToWirelessChannel()
{
  call DataMsg.send(TOS_BCAST_ADDR , sizeof(struct OscopeMsg), &msg);
}
event result_t timer.fired()
{
  post SendMsgToWirelessChannel();
  post SendMsgToUART();
  return SUCCESS;
}
The components are wired as follows: MyModuleM.communication -> GenericComm;
MyModuleM.DataMsg -> GenericComm.SendMsg[AM_OSCOPEMSG];
MyModuleM.communicationUART -> UARTComm;
MyModuleM.DataMsgUart -> UARTComm.SendMsg[AM_OSCOPEMSG];
The one I can send the packet to is the first one I call in timer.fired(). In my example, I can only send to the Wireless channel. All packets to the UART port are not received. If anyone can give me a hint, I would really apppreciate it. Thanks
Heo
Sucker-punch spam < http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html> with award-winning protection. Try the free Yahoo! Mail Beta. < http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html>


------------------------------------------------------------------------

_______________________________________________
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