Hello,

I'm doing a programa that receive and send a packet. I have the following
errors and I can't finde the solution...
Could anyone help me please?
Thank you very much!!!

/opt/moteiv/tos/lib/CC2420Radio/RadioCRCPacket.nc:49:2: warning: #warning
Using
old communication interfaces; recommend switch to SP
/opt/moteiv/tos/lib/CC2420Radio/TranslateBareSendMsgC.nc:29:2: warning:
#warning
 Using old communication interfaces; recommend switch to SP
In component `FramerP':
/opt/moteiv/tos/platform/tmote/FramerP.nc: In function `StdControl.init':
/opt/moteiv/tos/platform/tmote/FramerP.nc:309: ByteControl.init not
connected
In component `CountReceptorM':
CountReceptorM.nc: In function `comando_response.runTask':
CountReceptorM.nc:88: Localizar.get not connected
In component `FramerP':
/opt/moteiv/tos/platform/tmote/FramerP.nc: In function `StartTx':
/opt/moteiv/tos/platform/tmote/FramerP.nc:195: ByteComm.txByte not connected
make: *** [exe0] Error 1
        

// @author Cory Sharp <[email protected]>

module CountReceptorM
{
  provides interface StdControl;
  uses interface Leds;
  uses interface StdControl as RadioControl;
  uses interface StdControl as RetraControl;
  uses interface BareSendMsg as RetraSend;
  uses interface ReceiveMsg as RadioReceive;
  uses interface Counter<TMicro, uint32_t> as Localizar; //configura el timer 
con precisión de microsegundos
}

implementation
{

  enum{ //variables que no varían en el tiempo (constantes)

      RADIO_QUEUE_LEN = 20,
      RETRA_QUEUE_LEN = 20,
      };

//definiremos un buffer para emitir y transmitir

 TOS_Msg   retraQueueBufs [RETRA_QUEUE_LEN];
 uint8_t   retraIn, retraOut, retraCount;
 bool      retraBusy;

 TOS_Msg   radioQueueBufs [RADIO_QUEUE_LEN];
 uint8_t   radioIn, radioOut, radioCount;
 bool      radioBusy; 

  
  uint32_t tiempo1; // definición variables auxiliares
  uint32_t tiempo2;
  uint32_t tiempo3;
  uint8_t tiempo1A; // réplicas para pasarlo a hexadecimal
  uint8_t tiempo1B;
  uint8_t tiempo1C;
  uint8_t tiempo1D;
  uint32_t delta1aa;
  
  task void comando_response();
  task void comando_send();
  
  uint8_t Addr_node;
  uint8_t comando_tipo;
  uint8_t packet_ID_count;
  uint8_t secuence_Number;

  command result_t StdControl.init() //inicializamos Leds (no se inicializa la 
radio??)
  {
   
    retraIn = retraOut = retraCount = 0;
    retraBusy = FALSE;
    radioIn = radioOut = radioCount = 0;
    radioBusy = FALSE;

    call RetraControl.init();
    call RadioControl.init();
    call Leds.init();
    return SUCCESS;
  }

  command result_t StdControl.start() 
  {
   call RadioControl.start();
   call Leds.yellowOff();
   call Leds.redOff(); 
   call Leds.greenOff();

   return SUCCESS; 
  }

  command result_t StdControl.stop()
  {
    return call RadioControl.stop();
  }
  
  async event void Localizar.overflow(){
  }

 task void comando_response(){

  atomic{
  tiempo1 = call Localizar.get(); // recogemos t1 (aquí no es necesario???)
  }

  tiempo2 = tiempo1;
  tiempo1A = tiempo1 & 0xFF000000; // pasamos a hexadecimal
  tiempo1A = tiempo1A / 0xFFFFFF;
  tiempo1 = tiempo2;
  tiempo1B = tiempo1 & 0xFF0000;
  tiempo1B = tiempo1B / 0xFF00;

  tiempo1 = tiempo2;

  tiempo1C = tiempo1 & 0xFF00;
  tiempo1C = tiempo1C / 0xFF;
  tiempo1 = tiempo2;
  tiempo1D = tiempo1 & 0xFF;
  

  //post tarea(); buscar tarea para enviar los tiempos obtenidos al emisor
  }

  event TOS_MsgPtr RadioReceive.receive( TOS_MsgPtr Msg )
  {
    //Call Localizar.start (); //ya lo hemos puesto arriba???
    //tiempo2 = call Localizar.get() //guardar t2

    if (Msg -> group!=0x7D)
       return Msg;

   Addr_node          = Msg -> data[18];
   comando_tipo       = Msg -> data[19];
   packet_ID_count    = Msg -> data[20];
   secuence_Number    = Msg -> data[21];
    
   if (retraCount < RETRA_QUEUE_LEN){
    memcpy(&retraQueueBufs[retraIn], Msg, sizeof(TOS_Msg));
    retraCount++;
   }
    post comando_send(); 
    return Msg;
    
  }


     task void comando_send(){

     // tiempo3 = call localizador.get // recojo dato del timer
     // delta_t = tiempo3 - tiempo2; 
     // delta_t = CountMsg -> data; //se mete en el contenedor y de allí se 
envía

     if( retraCount == 0 )
       {
        retraBusy = FALSE;
       }     
     else
       {
        retraQueueBufs[retraOut].data[18] = 0x00;
        retraQueueBufs[retraOut].data[19] = 0x00;
        retraQueueBufs[retraOut].data[20] = 0x00;
        retraQueueBufs[retraOut].data[21] = 0x00;
       }
     
     if( call RetraSend.send(&retraQueueBufs [retraOut]) == SUCCESS)
      {
        call Leds.greenToggle();
            }
     else{
        //post llamar SendDone
        }
  }

  event result_t RetraSend.sendDone( TOS_MsgPtr msg, result_t success ) 
//evento q dispara cuando ls datos dl nodo sensor an sido trnsmitids via FR ok
  {
  if (!success)
   {
     call Leds.redToggle();
   }
  else
   {
      retraCount--;
      if( ++retraOut >= RETRA_QUEUE_LEN ) retraOut = 0;
      call Leds.yellowToggle();
   }
//post arrancar contador;

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

Reply via email to