Merge branch 'SimpleDMR' into AX25_FM

This commit is contained in:
Jonathan Naylor 2020-10-13 10:12:58 +01:00
commit e2a4ccfc05
4 changed files with 37 additions and 4 deletions

View file

@ -19,6 +19,6 @@
#if !defined(VERSION_H)
#define VERSION_H
const char* VERSION = "20200924";
const char* VERSION = "20201013";
#endif

View file

@ -155,9 +155,28 @@ bool CYSFControl::writeModem(unsigned char *data, unsigned int len)
CYSFFICH fich;
bool valid = fich.decode(data + 2U);
if (!valid) {
unsigned char fi = m_lastFICH.getFI();
unsigned char ft = m_lastFICH.getFT();
unsigned char fn = m_lastFICH.getFN();
unsigned char bt = m_lastFICH.getBT();
unsigned char bn = m_lastFICH.getBN();
if (valid)
if (fi == YSF_FI_COMMUNICATIONS && ft > 0U) {
fn++;
if (fn > ft) {
fn = 0U;
if (bt > 0U)
bn++;
}
}
m_lastFICH.setFI(YSF_FI_COMMUNICATIONS);
m_lastFICH.setFN(fn);
m_lastFICH.setBN(bn);
} else {
m_lastFICH = fich;
}
#ifdef notdef
// Stop repeater packets coming through, unless we're acting as a remote gateway

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2017,2019 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2019,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -225,6 +225,18 @@ void CYSFFICH::setFI(unsigned char fi)
m_fich[0U] |= (fi << 6) & 0xC0U;
}
void CYSFFICH::setBN(unsigned char bn)
{
m_fich[0U] &= 0xFCU;
m_fich[0U] |= bn & 0x03U;
}
void CYSFFICH::setBT(unsigned char bt)
{
m_fich[1U] &= 0x3FU;
m_fich[1U] |= (bt << 6) & 0xC0U;
}
void CYSFFICH::setFN(unsigned char fn)
{
m_fich[1U] &= 0xC7U;

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2017,2019 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2019,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -41,6 +41,8 @@ public:
unsigned char getDGId() const;
void setFI(unsigned char fi);
void setBN(unsigned char bn);
void setBT(unsigned char bt);
void setFN(unsigned char fn);
void setFT(unsigned char ft);
void setMR(unsigned char mr);