Hi guys,
I am trying to write the send/receive application for Telosb platform.
I tried to follow up the code from this link:
http://docs.tinyos.net/index.php/Mote-mote_radio_communication
It seems my code is correct, because it compiles but I can not send any packet 
by press the REST.
This is my code for BlinkToRadioC.nc


 #include <Timer.h>#include "BlinkToRadio.h"  module BlinkToRadioC {   uses 
interface Boot;   uses interface Leds;   uses interface Timer<TMilli> as 
Timer0;   uses interface Packet;   uses interface AMPacket;   uses interface 
AMSend;   uses interface SplitControl as AMControl;   uses interface Receive;}

 implementation 
{   bool busy = FALSE;   message_t pkt;   uint16_t counter = 0;
  event void Boot.booted() {    call Timer0.startPeriodic(TIMER_PERIOD_MILLI);  
  call AMControl.start();  }
        event void Timer0.fired() {     counter++;     call Leds.set(counter);  
if (!busy) {        BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)(call           
                Packet.getPayload(&pkt, sizeof (BlinkToRadioMsg)));         
btrpkt->nodeid = TOS_NODE_ID;           btrpkt->counter = counter;      if 
(call AMSend.send(AM_BROADCAST_ADDR, &pkt, sizeof                
(BlinkToRadioMsg)) == SUCCESS) {              busy = TRUE;          }     }   }
  event void AMControl.startDone(error_t err) {    if (err == SUCCESS) {      
call Timer0.startPeriodic(TIMER_PERIOD_MILLI);    }    else {      call 
AMControl.start();    }  }
  event void AMControl.stopDone(error_t err) {  }
  event void AMSend.sendDone(message_t* msg, error_t error) {    if (&pkt == 
msg) {      busy = FALSE;    }  }
        event message_t* Receive.receive(message_t* msg, void* payload,         
                uint8_t len) {    if (len == sizeof(BlinkToRadioMsg)) {     
BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)payload;            call 
Leds.set(btrpkt->counter);       }       return msg;   }
}  
I made my BlinkToRadioC.nc file along with Makefile and BlinkToRadio.h and 
BlinkToRadioAppC.nc in BlinkToRadio directory.
once I execute this "make Telosb reinstall bsl,/dev/ttyUSB0
It compiles but I can not pause blinking on Mote2 by pressing REST in Mote1.

I would be appreciated if someone can help me.
Regards,
Pedrad 

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

Reply via email to