Phil,
Thank you so much. It works fine now!
Jerry
On 10/16/07, Philip Levis <[EMAIL PROTECTED]> wrote:
> On Oct 15, 2007, at 7:52 PM, Yang Bofu wrote:
>
> > Hi guys,
> >
> > In my implementation, I need to get the head of my SendQueue and
> > transmit it. The SendQueue has the format NewDataMsg. So can I send
> > the packet like this?
> >
> > module NewSenseC {
> > uses {
> > ...
> > interface Queue<NewDataMsg*> as SendQueue;
> > ...
> > }
> > }
> >
> > implementation {
> > ...
> > if (!call SendQueue.empty()) {
> > NewDataMsg* rsm = call SendQueue.head();
> > call AMSend.send(AM_BROADCAST_ADDR, &rsm, sizeof(NewDataMsg))
> > ...
> > }
> >
> > the code can be compiled through, but the packet it sent is not what I
> > asked. and also the compiler give me warning like this
> >
> > NewSenseC.nc: 113 : warning: passing argument 2 of 'AMSend.send' from
> > incompatible pointer type.
> >
> > I know there is sth wrong but I can't figure it out.
> > Need Help! Thanks in advance!
>
> NewDataMsg* is not a message_t*. Allocate a message_t in the
> component frame, copy the NewDataMsg* into it using the getPayload
> command, and then send the message_t*. Take a look at tutorial 3.
>
> Phil
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help