[Tinyos-help] Buffering message_t structures

Arik Sapojnik sapojnik at gmail.com
Mon Apr 12 06:13:05 PDT 2010


Hi,

How about using a Pool like this:
interface Pool<message_t>

And wire it like this:
components new PoolC(message_t, POOL_SIZE);
App.Pool -> PoolC;

Arik

On Mon, Apr 12, 2010 at 15:08, David Piotrowski <tinyos at zeroflag.eu> wrote:

> Hi,
>
> I'm trying to implement a buffer for message_t structures and am having
> some trouble with it.
> Basicly what I want to do is create a component with an array of message_t
> structures. A command like "storeMessage(message_t* msg)" would memcpy the
> contents of the message pointed at by the msg-pointer to one of the
> message_t structures in the array. But after reading the buffered message_t
> structures out of the buffer again and sending them I get strange results.
> Now I wonder whether this can be done the way I expected or whether I would
> have to try an entirely different approach. Also I am not sure if message_t
> structures can be handled this way or if I have to use some special
> interfaces/components for handling these structures.
>
> Btw, using code a la
>        bufferedMessageT = *msg;
> instead of memcpy() leads to the same results.
>
> Thx, David
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Best Regards,
Arik Sapojnik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20100412/4e80a595/attachment.htm 


More information about the Tinyos-help mailing list