As long as your messages are under the max LENGTH, and the
length field of each is correct, you should be able to send
anything. TOS transmits only "length" bytes from a given buffer.
The mote side does allocate buffers for the maximum length
no matter what, so you need to be careful how long you make them.

There may be some assumptions of fixed length in higher level
message handlers or on the PC/Java side, but they should be
fairly easy to chase down.

MS

Raffaele Gravina wrote:
> Hi,
> 
> What you define in tinyos thru the "PFLAGS += -DTOSH_DATA_LENGTH=x" in 
> the Makefile, it's just the MAX payload length accepted. If (some of) 
> your actual messages will be smaller than that, you'll transmit 
> over-the-air less than the MAX length.
> However, this flag will affect the memory consumption of the mote, 
> because the buffer is pre-allocated at compile time.
> 
> Always rebember to add that PFLAGS both on your application and 
> basestation Makefiles.
> 
> Cheers,
> Raffaele
> 
> 2009/8/20 David <[email protected]>
> 
>     Hi,
> 
>     Is there a way to create messages with an arbitrary length? Looking at
>     the tutorials it seems like one has to define a struct for the payload
>     that one wants to send and this would result in a constant message
>     size. Can I send messages where the paloads length differs among
>     individual packets? And how can that be done without dynamic memory
>     allocation?
> 
>     David.
>     _______________________________________________
>     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

Reply via email to