Hi,I wanna apply XOR on this program can any one tell me where and what
commands I used to apply XOR in this program.I want program that covert all the
recieved data into XOR and show it to my computer PLz guys help me .Here is my
program ...reply please
implementation{ bool busy = FALSE; enum { UART_QUEUE_LEN = 12, };
message_t uartQueueBufs[UART_QUEUE_LEN]; message_t * ONE_NOK
uartQueue[UART_QUEUE_LEN]; uint8_t uartIn, uartOut; bool uartBusy,
uartFull;
event void Boot.booted() { uint8_t i;
for (i = 0; i < UART_QUEUE_LEN; i++) uartQueue[i] = &uartQueueBufs[i];
uartIn = uartOut = 0; uartBusy = FALSE; uartFull = TRUE;
call RadioControl.start(); call SerialControl.start(); }
event void RadioControl.startDone(error_t error) { if (error == SUCCESS) {
busy = FALSE;}}
event void SerialControl.startDone(error_t error) { if (error == SUCCESS) {
uartFull = FALSE;}}
event void SerialControl.stopDone(error_t error) {}event void
RadioControl.stopDone(error_t error) {}
task void uartSendTask(); event message_t *RadioReceive.receive[am_id_t
id](message_t *msg,void *payload,uint8_t len) { message_t *ret = msg;
atomic { if (!uartFull) { ret = uartQueue[uartIn];
uartQueue[uartIn] = msg; uartIn = (uartIn + 1) % UART_QUEUE_LEN;
if (uartIn == uartOut) uartFull = TRUE; if (!uartBusy)
{ post uartSendTask(); uartBusy = TRUE; } }
else busy = FALSE; } return ret; } uint8_t tmpLen;
task void uartSendTask() { uint8_t len; am_id_t id; am_addr_t addr,
src; message_t* msg; atomic if (uartIn == uartOut && !uartFull)
{ uartBusy = FALSE;
return; } msg = uartQueue[uartOut]; tmpLen = len = call
RadioPacket.payloadLength(msg); id = call RadioAMPacket.type(msg); addr =
call RadioAMPacket.destination(msg); src = call RadioAMPacket.source(msg);
call UartPacket.clear(msg); call UartAMPacket.setSource(msg, src);
if (call UartSend.send[id](addr, uartQueue[uartOut], len) == SUCCESS)
call Leds.led1Toggle(); else { busy = FALSE; } } event void
UartSend.sendDone[am_id_t id](message_t* msg, error_t error){ if (error !=
SUCCESS) busy = FALSE; else atomic if (msg ==
uartQueue[uartOut]) { if (++uartOut >= UART_QUEUE_LEN)
uartOut = 0; if (uartFull) uartFull = FALSE; }
post uartSendTask(); }}
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
http://clk.atdmt.com/GBL/go/201469228/direct/01/_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help