> I would like to manipulate the data at the basestation node
> before I send it over to the UART.
> Node1----connectedTo----->node2---connecteTo----->node3(BaseStation
> program). ( I use tinyos2&tmote sky)
> Any suggestion or any example would be really helpful.
> Thanks
> Sara
apps/MultihopOscilloscope and apps/tests/TestNetwork are good examples
to look at. Both the applications use collection protocol - the
messages get forwarded over multiple hops to the base station. When
the base station receives a message, it puts the message in a
queue. Later, it sends the messages that are in the queue over the
UART.
If you want to manipulate the packet, you can do it some time between
receiving the message and send it over the UART.
Here are two possible places to manipulate the received
packet in TestNetworkC.nc:
event message_t*
Receive.receive(message_t* msg, void* payload, uint8_t len) {
....
if (!call Pool.empty() && call Queue.size() < call Queue.maxSize()) {
message_t* tmp = call Pool.get();
/***** manipulate msg here ********/
call Queue.enqueue(msg);
if (!uartbusy) {
post uartEchoTask();
...
}
task void uartEchoTask() {
...
else if (!uartbusy) {
message_t* msg = call Queue.dequeue();
/***** manipulate msg here ********/
if (call UARTSend.send(0xffff, recvPtr, call Receive.payloadLength(msg) +
4) == SUCCESS) {
uartbusy = TRUE;
}
...
}
- om_p
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help