I haven't looked at the code either, but if you are using the same AM
message type for both messages, keep in mind that the second call is
guaranteed to FAIL unless you call if after the sendDone event fo the
first has been signaled.  The AM stack keeps a queue of depth 1 for
each pending AM message type.

Kevin

On Nov 21, 2007 8:52 AM, Michael Schippling <[EMAIL PROTECTED]> wrote:
> Without looking at your code...
>
> Check that each real send() returns SUCCESS, if you try to stack
> them up too fast they will refuse to post the message. The usual
> way to deal with that is to have a state variable that indicates
> when sendDone() has been called.
>
> MS
>
>
>
> Chan kenniel wrote:
> > Dear all,
> >
> > I rewrote the Oscilloscpe application as a component, in order that my
> > own application can send data to the TOSSIM.
> > I also wrote an interface called SendTestData.nc, there's one function
> > SendData(char *) in it. and this interface is provided by
> > the OscilloscopeM.nc. This component works fine on many cases, but if I
> > try to call the send function ( SendData(string str)) too often, for
> > example, if I call the SendData(string str) immediately one after
> > another, like:
> >
> > ...
> > SendData("one");
> > SendData("two");
> > ...
> >
> > then the second time the string "two" cannot be received, but I print it
> > out my application did call the senddata("two"),
> > dont know why the receiver side can not receive it. So because the
> > SendData function is wrote in the Timer.fired() part,
> > so everytime, Timer.fired() is invoked, all I get is
> > ...
> > one
> > one
> > one
> > one
> > ...
> >
> > I don't know why. Can anybody help me out with this. Those are my
> > attached files... Should be easy to read because I didn't change
> > too much. Thanks in advanced.
> >
> >
> >
> >
> > --
> > Best wishes,
> > Kenneth Chan
> >
> > ------------------------
> > Wish you have a good day!
> >
> >
> > ------------------------------------------------------------------------
> >
> > // $Id: OscopeMsg.h,v 1.2 2003/10/07 21:44:58 idgay Exp $
> >
> > /*                                                                    tab:4
> >  * "Copyright (c) 2000-2003 The Regents of the University  of California.
> >  * All rights reserved.
> >  *
> >  * Permission to use, copy, modify, and distribute this software and its
> >  * documentation for any purpose, without fee, and without written 
> > agreement is
> >  * hereby granted, provided that the above copyright notice, the following
> >  * two paragraphs and the author appear in all copies of this software.
> >  *
> >  * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
> >  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING 
> > OUT
> >  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE 
> > UNIVERSITY OF
> >  * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> >  *
> >  * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
> >  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
> >  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
> >  * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION 
> > TO
> >  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
> >  *
> >  * Copyright (c) 2002-2003 Intel Corporation
> >  * All rights reserved.
> >  *
> >  * This file is distributed under the terms in the attached INTEL-LICENSE
> >  * file. If you do not find these files, copies can be found by writing to
> >  * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
> >  * 94704.  Attention:  Intel License Inquiry.
> >  */
> > /*
> >  * Authors:           Nelson Lee
> >  * Date last modified:  6/27/02
> >  *
> >  */
> >
> > /* Message types used by Oscope. */
> >
> > /**
> >  * @author Nelson Lee
> >  */
> >
> > enum {
> >   BUFFER_SIZE = 40
> > };
> >
> > struct OscopeMsg
> > {
> >     uint16_t sourceMoteID;
> >     uint16_t lastSampleNumber;
> >     uint16_t channel;
> >     char data[1][BUFFER_SIZE];
> >     uint8_t datalength;
> > };
> >
> > struct OscopeResetMsg
> > {
> >     /* Empty payload! */
> > };
> >
> > enum {
> >   AM_OSCOPEMSG = 40,
> >   AM_OSCOPERESETMSG = 32
> > };
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > 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
>



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

Reply via email to