[Tinyos-help] Buffering message_t structures
sapojnik at gmail.com
Mon Apr 12 06:13:05 PDT 2010
How about using a Pool like this:
And wire it like this:
components new PoolC(message_t, POOL_SIZE);
App.Pool -> PoolC;
On Mon, Apr 12, 2010 at 15:08, David Piotrowski <tinyos at zeroflag.eu> wrote:
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tinyos-help