[Tinyos-devel] TossimActiveMessageP.nc payload pointer correct?

Omprakash Gnawali gnawali at usc.edu
Wed May 17 11:38:42 PDT 2006


While Rodrigo and I were working on one of our bugs today, we stumbled
on to these lines in TossimActiveMessageP.nc:

event void Model.receive(message_t* msg) {
    uint8_t len;
    void* payload = call Packet.getPayload(msg, &len);

    memcpy(bufferPointer, msg, sizeof(message_t));

    ....

        bufferPointer = signal Receive.receive[call AMPacket.type(bufferPointer)]
               (bufferPointer, payload, len);

   ...
}

Should "payload" on Receive.receive call be obtained from
bufferPointer instead of msg? In the above code, payload points to
data on the incoming message instead of data on bufferPointer.

- om_p



More information about the Tinyos-devel mailing list