I would just use some sort of Queue and shove things into it. It just seems like a more general case. Otherwise, double-the-buffers and double-the-individual-logic (definitely use tasks!). (IIRC, isn't there already such a component? At least in one of the support....)
HTH, Paul On Thu, Jul 24, 2008 at 8:59 AM, Michael Schippling <[EMAIL PROTECTED]> wrote: > Like I said. Call the second sendReport (or better post a task) > from the sendDone of the first. What might be happening is your > busy-waiting while(flag) loop will hog the processor and block > other tasks which may be needed to do the sending. > > MS > > Miky Mike wrote: >> I have created two functions that send different messages using the same >> interface. I then call consecutively the two fucntions, like this: >> >> sendReport1(...); >> sendReport2(...); >> >> Both this functions call Send.send(...) but only the second message >> seems to be transmitted. I used a flag that is set to TRUE if "call >> Send.send() == SUCCESS " and set to FALSE when sendDone() is fired. >> >> How can i send the second message only when the flag is TRUE? I tried to >> do a while loop inside the functions using the flag but that didn't work. >> >> Michael >> >> On Thu, Jul 24, 2008 at 1:27 AM, Michael Schippling <[EMAIL PROTECTED] >> <mailto:[EMAIL PROTECTED]>> wrote: >> >> Fire off the second send from the sendDone() of the first. >> I'd more expect to loose the second message because it's >> send() should return an error if the first hasn't completed, >> but who knows... >> >> MS >> >> Miky Mike wrote: >> >> Hello all. >> >> I'm trying to send two consecutive messages with Send.send() >> from CollectionSenderC. The problem i get is that only the >> second message is actually sent. >> Is there any way of doing a non blocking loop that sends the >> message only when the radio is free? >> Does anyone know how to do this? >> >> Thanks, >> Michael >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Tinyos-help mailing list >> [email protected] >> <mailto:[email protected]> >> >> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >> >> > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
