Hello,

I am working with TinyOS 2.0.2 and payload of 29 bytes. Two remotes nodes send 
messages to node with BaseStation application.

I changed BaseStation program to work with 29 bytes of payload and 
acknowledgements. I compiled with address 0. In BaseStationP:

#include "AM.h"

#include "Serial.h"

#define TOSH_DATA_LENGTH 29    //Added line

The Makefile:

COMPONENT=BaseStationC

#CFLAGS += -DCC2420_NO_ACKNOWLEDGEMENTS

CFLAGS += -DCC2420_NO_ADDRESS_RECOGNITION

include $(MAKERULES)

The remote node requests an ack before to send the  message:

call ACK.requestAck(&PaqueteDatos);

if (call EnviarDatos.send(0, &PaqueteDatos, sizeof(MensajeDatos)) == SUCCESS)

And finally the code at sendDone event:

event void EnviarDatos.sendDone(message_t* msg, error_t error) 
{ 
    if (&PaqueteDatos == msg) 
    { 
        enviarDatosBusy = FALSE;
        enviados = enviados + 1;

        if (!call ACK.wasAcked(msg) && intentos < REINTENTOS)
        {
                intentos = intentos + 1;
                FuncionEnviarDatos();
        }
        else
        {
                //New iteration with the sensors
                intentos = 0;
                ...        
        }
        ... 
    } 
}

If the ack failed the program tries to send the message 5 times. At the 
computer sometimes I get the same message twice. Can the program requiere a 
delay between sendDone is signaled and check the acknowledgement?

Thanks, Juan Antonio.
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to