kopia lustrzana https://github.com/sq8vps/vp-digi
duplicate protection bug
rodzic
5bdc61f3bc
commit
1d923864fb
|
@ -25,6 +25,7 @@ along with VP-Digi. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "drivers/systick.h"
|
#include "drivers/systick.h"
|
||||||
|
#include "digipeater.h"
|
||||||
|
|
||||||
struct Ax25ProtoConfig Ax25Config;
|
struct Ax25ProtoConfig Ax25Config;
|
||||||
|
|
||||||
|
@ -197,7 +198,7 @@ void Ax25TxKiss(uint8_t *buf, uint16_t len)
|
||||||
if(end == len) //no frame end marker found
|
if(end == len) //no frame end marker found
|
||||||
return;
|
return;
|
||||||
Ax25WriteTxFrame(&buf[i + 2], end - (i + 2)); //skip modem number and send frame
|
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
|
i = end; //move pointer to the next byte if there are more consecutive frames
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -322,7 +322,7 @@ void DigiDigipeat(uint8_t *frame, uint16_t len)
|
||||||
|
|
||||||
//calculate frame "hash"
|
//calculate frame "hash"
|
||||||
uint32_t hash = Crc32(CRC32_INIT, frame, 14); //use destination and source address, skip path
|
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
|
if(DigiConfig.viscous) //viscous-delay enabled on any slot
|
||||||
{
|
{
|
||||||
|
@ -461,7 +461,7 @@ void DigiStoreDeDupe(uint8_t *buf, uint16_t size)
|
||||||
deDupeCount %= DEDUPE_SIZE;
|
deDupeCount %= DEDUPE_SIZE;
|
||||||
|
|
||||||
deDupe[deDupeCount].hash = hash;
|
deDupe[deDupeCount].hash = hash;
|
||||||
deDupe[deDupeCount].timeLimit = SysTickGet() + (DigiConfig.dupeTime * 10 / SYSTICK_INTERVAL);
|
deDupe[deDupeCount].timeLimit = SysTickGet() + (DigiConfig.dupeTime * 1000 / SYSTICK_INTERVAL);
|
||||||
|
|
||||||
deDupeCount++;
|
deDupeCount++;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue