Hi,
I have written simple code for communication between 2  tmote sky.  Turns
out that sendDone() is never called.

==================================================================
configuration Sender
{}
implementation
{
  components SenderC as App, LedsC, MainC;
  components new TimerMilliC();
  components new  Msp430Uart0C() ;
  App.Boot -> MainC.Boot;
    App.Leds -> LedsC;
  App.MilliTimer -> TimerMilliC;
 App.UartStream-> Msp430Uart0C ;
}
==================================================================
module SenderC {
  uses {

    interface Leds;
    interface Boot;
    interface Timer<TMilli> as MilliTimer;
   interface  UartStream;
  }
}
implementation {

  bool locked = FALSE;
  uint8_t counter = 0;
  event void Boot.booted() {
    call UartStream.enableReceiveInterrupt();
     call MilliTimer.startPeriodic(1000);
  }

// async command error_t send( uint8_t* buf, uint16_t len );

  async event void UartStream.receivedByte( uint8_t byte )
{
call  Leds.set(byte);

}
 async event void UartStream.sendDone( uint8_t* buf, uint16_t len, error_t
error ){   bool locked = FALSE;}
  async event void UartStream.receiveDone( uint8_t* buf, uint16_t len,
error_t error ){}
event void MilliTimer.fired() {
    counter++;
    if (locked) {
      return;
    }
    else {
      call UartStream.send( &counter, 1 );
    call    Leds.set(counter);
    locked=TRUE;
    }
  }
}
======================================================================

For receiver i got same code except      call
MilliTimer.startPeriodic(1000); have been commented.
Do anybody have suggestion.
Thanks in advance.

-Sagar
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to