Browse Source

duplicate protection bug

pull/32/head
Piotr Wilkon 2 years ago
parent
commit
1d923864fb
2 changed files with 4 additions and 3 deletions
  1. +2
    -1
      Src/ax25.c
  2. +2
    -2
      Src/digipeater.c

+ 2
- 1
Src/ax25.c View File

@ -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
}
}


+ 2
- 2
Src/digipeater.c View File

@ -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++;
}

Loading…
Cancel
Save