[Tinyos-help] about CTP

jiwen zhang zhangjiwen029 at gmail.com
Wed Jul 9 20:15:11 PDT 2008


Hello Omprakash  :

    I have a question about the code in the file CtpForwardingEngineP.nc

    In the implementation of Send.send , you use "hdr = getHeader(msg)" to
make hdr point to the payload field of the msg in order to inset the ctp
header before the "user's data"  , and then you give the values to the
fields of the  data structure of ctp_data_header_t . does these operations
will destroy the "user's data" ?
becase the CTP works well , so i think the "user's data" is not destroied ,
i don't know why .
because the function of getHeader is :
  ctp_data_header_t* getHeader(message_t* m) {
    return (ctp_data_header_t*)call SubPacket.getPayload(m,
sizeof(ctp_data_header_t));
  }
so the returned pointer points to the user's data , so when you evaluate to
the fields , it shoud destroy the original datas according to my
understanding to the pointer . why ? can you give me an explain ?

thank you !!


-- 
zhang jiwen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20080710/afa85bdb/attachment-0001.htm 


More information about the Tinyos-help mailing list