On Aug 17, 2006, at 2:56 PM, Jay Taneja wrote:
Hi,
I have developed an application for T2 along with simple Java tools
that output formatted message contents. For the single-hop case
(just broadcasting messages), the Java tools work fine - they
identify that messages are of my defined type (called RadioMsg, in
this case) and the messageReceived function is called.
When I switched to the multihop case (using Collection, included
with beta 2), I modified BaseStation to be a root of the Collection
tree. I expected to have to modify the Java tools (as was the case
with MintRoute/MultiHopLQI in tinyos-1.x) to remove the routing
protocol headers from the received packets. However, looking at the
Java tools for Oscilloscope and MultihopOscilloscope, they are
identical - no change is made from the single hop to multihop case.
Correct. A MultihopOscilloscope base station takes the payload out of
a multihop message and puts it into a packet that it sends over the
UART. It does not send the multihop headers. Receive.receive is
signaled in Collection when a base station receives a packet.
event message_t*
Receive.receive(message_t* msg, void *payload, uint8_t len) {
if (uartbusy == FALSE) {
oscilloscope_t* in = (oscilloscope_t*)payload;
oscilloscope_t* out = (oscilloscope_t*)call
SerialSend.getPayload(&uartbuf
);
if (len != sizeof(oscilloscope_t)) {
return msg;
}
else {
memcpy(out, in, sizeof(oscilloscope_t));
}
uartbusy = TRUE;
uartlen = sizeof(oscilloscope_t);
post uartSendTask();
}
return msg;
}
The two packets have different AM types. Collection packets have AM
type 0x14 (tos/lib/net/collection/Collection.h), while
MultihopOscilloscope packets (which come over the serial port) have
type 0x93.
Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help