hi, all

i met a question when i make a simulation with tossim(tinyos 2.x), the
follow code is my user defined packet.

typedef nx_struct usrNet_Msg{
nx_uint8_t usr_type;
nx_uint16_t usr_source;
nx_uint16_t usr_destination;
nx_uint8_t usr_length;
nx_uint8_t usr_payload[payload_length];
}usrNet_Msg;
payload_length is defined as 3.
and in my packet.py file, i add the follow code to generate new packet.

msg.set_usr_type(0);
msg.set_usr_source(2);
msg.set_usr_destination(1);
msg.set_usr_length(3);
msg.setElement_usr_payload(0,0);
msg.setElement_usr_payload(1,2);
msg.setElement_usr_payload(2,0);
pkt = t.newPacket()
pkt.setData(msg.data)
pkt.setType(msg.get_amType())
pkt.setDestination(1)
print "Delivering " + str(msg) + " to 1 at " + str(t.time() + 3)

but it seemed that when the packet generated, and my receive event can not
receive the packet,  anybody can tell me some clues, thanks in advance.

wansheng
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to