On May 30, 2010, at 9:07 AM, Pedro Nunes wrote: > Hello all. > > I'm using TOSSIM under TinyOS 2.1.1 and I would like to ask you all two > questions: > > ### First > > I noticed that inside TossimActiveMessageC.nc in command AMSend.send we can > find this piece of code: > > "err = call Model.send((int)addr, amsg, len + sizeof(tossim_header_t));" > > But the documentation on this function (command error_t send(int node, > message_t* msg, uint8_t len)) says that this command sends a packet with a > data payload of length "len". > Therefore, I found it a little awkward that we're adding the size of the > header since the command only requests the length of the DATA PAYLOAD.
A header at layer N is a payload at layer N-1. To the link layer, the TOSSIM header is a header; to the physical layer (which Model represents), it's payload. > I proceed to the next call on the next component (TossimPacketModelC). Within > this component, it will be created an event to fulfill our request of sending > a message and that event will be inserted on a queue. Later, the event will > eventually be popped from that queue and the operation of sending the message > will take place, calling the "send_transmit(sim_event_t* evt)" function. > Inside that function we can find the following line: > > "duration = 8 * (sendingLength + sim_packet_header_length());" being > sendingLength the len parameter previously defined inside AMSend.send. > > My question is: why are we adding the length of the header again? This way, > the header's length will be added twice! And why isn't the footer being added > too? Those both look like bugs. The footer should be included in the Model.send call, though. Phil _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
