Hi 
I wrote this piece of code that is the sum of two integers and now I want to 
display packets sent and received ... I used the Send and Receive interface but 
I have nothing like this is the result ....I work on the mote Telosb.... 
there's someone who can help me ...

Thank you in advance.
Here is the code:
#include "Timer.h"

module SomC{
uses interface Boot;
uses interface AMSend ;
uses interface Receive;
uses interface Timer<TMilli> as MilliTimer;
        uses interface SplitControl as Control;

}
implementation{
 message_t  packet;
 uint32_t s;
uint32_t somme(uint32_t a,uint32_t b)
{ return (a+b);
}
event void Control..startDone(error_t err) {
    if (err == SUCCESS) {
      call MilliTimer.startPeriodic(1000);
    }
  }
  
  event void Control.stopDone(error_t err) {}
  
 event void MilliTimer.fired() {
 call AMSend.send(AM_BROADCAST_ADDR, &packet,1 );
 }
event message_t* Receive.receive(message_t* bufPtr, 
   void* payload, uint8_t len) 
{
return bufPtr;
}   
  
 event void AMSend.sendDone(message_t* bufPtr, error_t error) {
      }


event void Boot.booted(){

dbg("SomC", "we are in boot \n");
s=somme(1,2);
packet.data[0]=(nx_uint8_t)s;
dbg("SomC", "after som \n");
dbg("SomC", "la somme est %i \n", packet.data);
}
}



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

Reply via email to