[Tinyos-help] programming logic

Muhammad Azhar leo_az_83 at hotmail.com
Sat Feb 10 05:09:27 PST 2007


Hi all,

   I'm thinking that my programming logic might be wrong which is why the 
compiler gave me this warning:

XxxxC.nc: In function `Receive.receive':
XxxxC.nc:117: warning: passing argument 2 of `AMSend.send' from incompatible 
pointer type

   I read through the Receive interface and was told that if I wanted to 
return the same message_t packet buffer for later use by the same signalling 
component, I can do so provided I have copied the data that I wanted.  In my 
program, I wanted selected nodes with certain IDs to modify the data that 
they received from another node and send it to another different node - 
hence, in my Receive.receive(message_t* bufPtr, void* payload, uint8_t len), 
I signalled AMSend.send after I have modified the data... This was what I 
did:

    message_t* tempBuffer;
    struct* something = (struct*)payload;
    something->data = something->value + count - something->data
    memcpy(tempBuffer, bufPtr, sizeof(message_t));
    call AMSend.send(nodeid, &tempBuffer, sizeof(struct));
    return bufPtr;

    I'm not really sure if this will actually send the modified data to the 
required nodeid, but anyway, I still don't know why the message appears.  
I'm not even sure if I need tempBuffer in the first place - can I just send 
&bufPtr?  Any help is very much appreciated.  Thank you.

Azhar




More information about the Tinyos-help mailing list