Dear all
i just want to write a program that sends 200 packets over radio every 100 
milliseconds. i got this error at the end of compiling
JSenderC.nc:61: syntax error at end of input any help will be appreciated
code :  
#include "Timer.h"#include "JSender.h"#include "message.h"#include 
"CC2420TimeSyncMessage.h" module JSenderC @safe() {  uses {    interface Leds;  
  interface Boot;    interface AMSend;    interface CC2420Packet;     interface 
Timer<TMilli> as MilliTimer;    interface SplitControl as AMControl;    
interface Packet;    }}
implementation {  message_t packet;  bool locked;  uint16_t counter = 0;  
uint16_t nb_paquets = 200;

event void Boot.booted() { call AMControl.start(); }  event void 
AMControl.startDone(error_t err) {    if (err == SUCCESS) { call 
MilliTimer.startPeriodic(100); }    else { call AMControl.start(); }  }  event 
void AMControl.stopDone(error_t err) {}
task void send_Finished() {    if (!locked) {      JAMMER_APP_MSG* rcm = 
(JAMMER_APP_MSG*)call Packet.getPayload(&packet, sizeof(JAMMER_APP_MSG));      
if (rcm == NULL) {return;}      rcm->counter = counter++;      rcm->packet_num 
= counter;      rcm->nodeid = TOS_NODE_ID;
       if (call AMSend.send(AM_BROADCAST_ADDR, &packet, sizeof(JAMMER_APP_MSG)) 
== SUCCESS) {  locked = TRUE;      } }    }  event void 
AMSend.sendDone(message_t* bufPtr, error_t error) {    if (&packet == bufPtr) 
{locked = FALSE;}  }   
  event void MilliTimer.fired() {    if (nb_paquets > 0)    {      post 
send_Finished();      call Leds.led0Toggle();      nb_paquets--;    } else      
 {      call Leds.led2Toggle();      }}   HAMZA Tayeb
PhD student


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

Reply via email to