diff --git a/src/cwprotocol.h b/src/cwprotocol.h index c39f452..70afae9 100644 --- a/src/cwprotocol.h +++ b/src/cwprotocol.h @@ -9,6 +9,7 @@ #define SIZE_COMMAND_PACKET 4 #define SIZE_DATA_PACKET 496 #define SIZE_DATA_PACKET_PAYLOAD 492 // = SIZE_DATA_PACKET - SIZE_COMMAND_PACKET +#define TX_RETRIES 3 // how often will the udp packet be sent? #define SIZE_ID 128 #define SIZE_STATUS 128 diff --git a/src/irmc.c b/src/irmc.c index 93c2518..2b01636 100644 --- a/src/irmc.c +++ b/src/irmc.c @@ -334,7 +334,8 @@ int main(int argc, char *argv[]) if(tx_data_packet.n > 1 ){ tx_sequence++; tx_data_packet.sequence = tx_sequence; - for(i = 0; i < 5; i++) send(fd_socket, &tx_data_packet, SIZE_DATA_PACKET, 0); + for(i = 0; i < TX_RETRIES; i++) + send(fd_socket, &tx_data_packet, SIZE_DATA_PACKET, 0); #if DEBUG printf("irmc: sent data packet.\n"); #endif @@ -350,7 +351,7 @@ int main(int argc, char *argv[]) #endif #ifdef RASPI - if(digitalRead(5)==1){ + if(digitalRead(TX_RASPI_PIN)==1){ txloop(); tx_timer = TX_WAIT; message(1);