Hi
I recently ran into a problem while trying to communicate between the pc and
the mote
using micaz platform.
I was using the single byte serial communication interface UartByte to
receive data
from the pc and then send back the same to the mote. The code is as below
:--

configuration newtest{
}

implementation{
components newtestC,MainC,PlatformSerialC,LedsC;
components new TimerMilliC() as delay;

newtestC.Boot -> MainC;
newtestC.UartControl -> PlatformSerialC;
newtestC.UartByte -> PlatformSerialC;
newtestC.delay -> delay;
newtestC.Leds -> LedsC;
}

module newtestC
{
uses interface Boot;
uses interface StdControl as UartControl;
 uses interface UartByte;
uses interface Timer<TMilli> as delay;
uses interface Leds;
 }

implementation
{
uint8_t* p;
 event void Boot.booted()
{
call UartControl.start();
 call delay.startPeriodic(500);
}
 event void delay.fired()
{
call UartByte.receive(p,255);
 call UartByte.send(*p);
call Leds.led1Toggle();
}
}

I tried sending a character say 'i' from the pc. But whatever i was
receiving was 255(the
value in UartByte.receive).
When i changed that value (byte times according to UartByte interface file)
to 200, i
received 200. Could someone tell where i have went wrong and why?

Thanking you all in advance,
Anil.V.Anand
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to