duplicate protection bug

pull/32/head
Piotr Wilkon 2023-08-31 20:58:59 +02:00
rodzic 5bdc61f3bc
commit 1d923864fb
2 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -25,6 +25,7 @@ along with VP-Digi. If not, see <http://www.gnu.org/licenses/>.
#include <stdbool.h>
#include <string.h>
#include "drivers/systick.h"
#include "digipeater.h"
struct Ax25ProtoConfig Ax25Config;
@ -197,7 +198,7 @@ void Ax25TxKiss(uint8_t *buf, uint16_t len)
if(end == len) //no frame end marker found
return;
Ax25WriteTxFrame(&buf[i + 2], end - (i + 2)); //skip modem number and send frame
//DigiStoreDeDupe(&buf[i + 2], end - (i + 2));
DigiStoreDeDupe(&buf[i + 2], end - (i + 2));
i = end; //move pointer to the next byte if there are more consecutive frames
}
}

Wyświetl plik

@ -322,7 +322,7 @@ void DigiDigipeat(uint8_t *frame, uint16_t len)
//calculate frame "hash"
uint32_t hash = Crc32(CRC32_INIT, frame, 14); //use destination and source address, skip path
hash = Crc32(hash, &frame[t + 1], len - t); //continue through all remaining data
hash = Crc32(hash, &frame[t + 1], len - t - 1); //continue through all remaining data
if(DigiConfig.viscous) //viscous-delay enabled on any slot
{
@ -461,7 +461,7 @@ void DigiStoreDeDupe(uint8_t *buf, uint16_t size)
deDupeCount %= DEDUPE_SIZE;
deDupe[deDupeCount].hash = hash;
deDupe[deDupeCount].timeLimit = SysTickGet() + (DigiConfig.dupeTime * 10 / SYSTICK_INTERVAL);
deDupe[deDupeCount].timeLimit = SysTickGet() + (DigiConfig.dupeTime * 1000 / SYSTICK_INTERVAL);
deDupeCount++;
}