Dear Helps,
As I know, the Snoop.Receive event in CTP is used for receiving packets
from neighbor nodes and forwarding to root.
In my case, I would like to modify some information in these passing by
packet. Therefore, I write some lines inside this event. However, the
received packets are not modified!
Suppose the packet structure include 3 fields: origin (the node ID), seq (the
sequence number of packet), pnid (the intermediate node ID which the packet
pass by).
For ex, in the code below, I want to modify the field pnid of the passing
by packet with the intermediate node ID (local.origin), but I receive pnid
= 0!!!
Could you please tell me how to modify the passing by packets so that I can
receive them correctly!
The code:
event message_t* Snoop.receive(message_t* msg, void* payload, uint8_t len)
{
uint8_t i;
mviz_msg_t *omsg = payload;
report_received();
// If we receive a newer version, update our interval.
if (omsg->version > local.version) {
local.version = omsg->version;
local.interval = omsg->interval;
startTimer();
}
// If we hear from a future count, jump ahead but suppress our own
// change.
if (omsg->count > local.count) {
local.count = omsg->count;
suppress_count_change = TRUE;
}
local.seq = omsg->count;//modified, it runs!
omsg->pnid = local.origin; //modified, nothing happen with the receive
packet field pnid
return msg;
}
Best regards,
Huy Do.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help