support configuring the modem P25 sync correlation countdown from the host;

pull/1/head
Bryan Biedenkapp 5 years ago
parent 0c8f2583bc
commit 6535049765

@ -110,6 +110,7 @@ system:
cosLockout: false cosLockout: false
fdmaPreamble: 80 fdmaPreamble: 80
dmrRxDelay: 7 dmrRxDelay: 7
p25CorrCount: 8
rxDCOffset: 0 rxDCOffset: 0
txDCOffset: 0 txDCOffset: 0
rxLevel: 50 rxLevel: 50

@ -1241,6 +1241,7 @@ bool Host::createModem()
bool cosLockout = modemConf["cosLockout"].as<bool>(false); bool cosLockout = modemConf["cosLockout"].as<bool>(false);
uint8_t fdmaPreamble = (uint8_t)modemConf["fdmaPreamble"].as<uint32_t>(80U); uint8_t fdmaPreamble = (uint8_t)modemConf["fdmaPreamble"].as<uint32_t>(80U);
uint8_t dmrRxDelay = (uint8_t)modemConf["dmrRxDelay"].as<uint32_t>(7U); uint8_t dmrRxDelay = (uint8_t)modemConf["dmrRxDelay"].as<uint32_t>(7U);
uint8_t p25CorrCount = (uint8_t)modemConf["p25CorrCount"].as<uint32_t>(4U);
int rxDCOffset = modemConf["rxDCOffset"].as<int>(0); int rxDCOffset = modemConf["rxDCOffset"].as<int>(0);
int txDCOffset = modemConf["txDCOffset"].as<int>(0); int txDCOffset = modemConf["txDCOffset"].as<int>(0);
int dmrSymLevel3Adj = modemConf["dmrSymLvl3Adj"].as<int>(0); int dmrSymLevel3Adj = modemConf["dmrSymLvl3Adj"].as<int>(0);
@ -1272,6 +1273,7 @@ bool Host::createModem()
LogInfo(" COS Lockout: %s", cosLockout ? "yes" : "no"); LogInfo(" COS Lockout: %s", cosLockout ? "yes" : "no");
LogInfo(" FDMA Preambles: %u (%.1fms)", fdmaPreamble, float(fdmaPreamble) * 0.2083F); LogInfo(" FDMA Preambles: %u (%.1fms)", fdmaPreamble, float(fdmaPreamble) * 0.2083F);
LogInfo(" DMR RX Delay: %u (%.1fms)", dmrRxDelay, float(dmrRxDelay) * 0.0416666F); LogInfo(" DMR RX Delay: %u (%.1fms)", dmrRxDelay, float(dmrRxDelay) * 0.0416666F);
LogInfo(" P25 Corr. Count: %u (%.1fms)", p25CorrCount, float(p25CorrCount) * 0.667F);
LogInfo(" RX DC Offset: %d", rxDCOffset); LogInfo(" RX DC Offset: %d", rxDCOffset);
LogInfo(" TX DC Offset: %d", txDCOffset); LogInfo(" TX DC Offset: %d", txDCOffset);
LogInfo(" RX Level: %.1f%%", rxLevel); LogInfo(" RX Level: %.1f%%", rxLevel);
@ -1285,7 +1287,7 @@ bool Host::createModem()
LogInfo(" Debug: yes"); LogInfo(" Debug: yes");
} }
m_modem = Modem::createModem(port, m_duplex, rxInvert, txInvert, pttInvert, dcBlocker, cosLockout, fdmaPreamble, dmrRxDelay, packetPlayoutTime, disableOFlowReset, trace, debug); m_modem = Modem::createModem(port, m_duplex, rxInvert, txInvert, pttInvert, dcBlocker, cosLockout, fdmaPreamble, dmrRxDelay, p25CorrCount, packetPlayoutTime, disableOFlowReset, trace, debug);
m_modem->setModeParams(m_dmrEnabled, m_p25Enabled); m_modem->setModeParams(m_dmrEnabled, m_p25Enabled);
m_modem->setLevels(rxLevel, cwIdTXLevel, dmrTXLevel, p25TXLevel); m_modem->setLevels(rxLevel, cwIdTXLevel, dmrTXLevel, p25TXLevel);
m_modem->setSymbolAdjust(dmrSymLevel3Adj, dmrSymLevel1Adj, p25SymLevel3Adj, p25SymLevel1Adj); m_modem->setSymbolAdjust(dmrSymLevel3Adj, dmrSymLevel1Adj, p25SymLevel3Adj, p25SymLevel1Adj);

@ -154,6 +154,7 @@ HostCal::HostCal(const std::string& confFile) :
m_p25SymLevel1Adj(0), m_p25SymLevel1Adj(0),
m_fdmaPreamble(80U), m_fdmaPreamble(80U),
m_dmrRxDelay(7U), m_dmrRxDelay(7U),
m_p25CorrCount(5U),
m_debug(false), m_debug(false),
m_mode(STATE_DMR_CAL), m_mode(STATE_DMR_CAL),
m_modeStr(DMR_CAL_STR), m_modeStr(DMR_CAL_STR),
@ -246,6 +247,7 @@ int HostCal::run()
m_fdmaPreamble = (uint8_t)modemConf["fdmaPreamble"].as<uint32_t>(80U); m_fdmaPreamble = (uint8_t)modemConf["fdmaPreamble"].as<uint32_t>(80U);
m_dmrRxDelay = (uint8_t)modemConf["dmrRxDelay"].as<uint32_t>(7U); m_dmrRxDelay = (uint8_t)modemConf["dmrRxDelay"].as<uint32_t>(7U);
m_p25CorrCount = (uint8_t)modemConf["p25CorrCount"].as<uint32_t>(5U);
writeConfig(); writeConfig();
@ -1650,6 +1652,8 @@ bool HostCal::writeConfig(uint8_t modeOverride)
m_conf["system"]["modem"]["rxDCOffset"] = __INT_STR(m_rxDCOffset); m_conf["system"]["modem"]["rxDCOffset"] = __INT_STR(m_rxDCOffset);
buffer[17U] = (uint8_t)(m_rxDCOffset + 128); buffer[17U] = (uint8_t)(m_rxDCOffset + 128);
buffer[14U] = (uint8_t)m_p25CorrCount;
int ret = m_serial.write(buffer, 17U); int ret = m_serial.write(buffer, 17U);
if (ret <= 0) if (ret <= 0)
return false; return false;
@ -1781,7 +1785,8 @@ void HostCal::printStatus()
m_rxLevel, m_txLevel, m_txDCOffset, m_rxDCOffset); m_rxLevel, m_txLevel, m_txDCOffset, m_rxDCOffset);
LogMessage(LOG_CAL, " - DMR Symbol +/- 3 Level Adj.: %d, DMR Symbol +/- 1 Level Adj.: %d, P25 Symbol +/- 3 Level Adj.: %d, P25 Symbol +/- 1 Level Adj.: %d", LogMessage(LOG_CAL, " - DMR Symbol +/- 3 Level Adj.: %d, DMR Symbol +/- 1 Level Adj.: %d, P25 Symbol +/- 3 Level Adj.: %d, P25 Symbol +/- 1 Level Adj.: %d",
m_dmrSymLevel3Adj, m_dmrSymLevel1Adj, m_p25SymLevel3Adj, m_p25SymLevel1Adj); m_dmrSymLevel3Adj, m_dmrSymLevel1Adj, m_p25SymLevel3Adj, m_p25SymLevel1Adj);
LogMessage(LOG_CAL, " - FDMA Preambles: %u (%.1fms), DMR Rx Delay: %u (%.1fms)", m_fdmaPreamble, float(m_fdmaPreamble) * 0.2083F, m_dmrRxDelay, float(m_dmrRxDelay) * 0.0416666F); LogMessage(LOG_CAL, " - FDMA Preambles: %u (%.1fms), DMR Rx Delay: %u (%.1fms), P25 Corr. Count: %u (%.1fms)", m_fdmaPreamble, float(m_fdmaPreamble) * 0.2083F, m_dmrRxDelay, float(m_dmrRxDelay) * 0.0416666F,
m_p25CorrCount, float(m_p25CorrCount) * 0.667F);
LogMessage(LOG_CAL, " - Operating Mode: %s", m_modeStr.c_str()); LogMessage(LOG_CAL, " - Operating Mode: %s", m_modeStr.c_str());
uint8_t buffer[50U]; uint8_t buffer[50U];

@ -93,6 +93,7 @@ private:
uint8_t m_fdmaPreamble; uint8_t m_fdmaPreamble;
uint8_t m_dmrRxDelay; uint8_t m_dmrRxDelay;
uint8_t m_p25CorrCount;
bool m_debug; bool m_debug;

@ -66,12 +66,13 @@ using namespace modem;
/// <param name="cosLockout">Flag indicating whether the COS signal should be used to lockout the modem.</param> /// <param name="cosLockout">Flag indicating whether the COS signal should be used to lockout the modem.</param>
/// <param name="fdmaPreamble">Count of FDMA preambles to transmit before data. (P25/DMR DMO)</param> /// <param name="fdmaPreamble">Count of FDMA preambles to transmit before data. (P25/DMR DMO)</param>
/// <param name="dmrRxDelay">Compensate for delay in receiver audio chain in ms. Usually DSP based.</param> /// <param name="dmrRxDelay">Compensate for delay in receiver audio chain in ms. Usually DSP based.</param>
/// <param name="p25CorrCount">P25 Correlation Countdown.</param>
/// <param name="disableOFlowReset">Flag indicating whether the ADC/DAC overflow reset logic is disabled.</param> /// <param name="disableOFlowReset">Flag indicating whether the ADC/DAC overflow reset logic is disabled.</param>
/// <param name="packetPlayoutTime">Length of time in MS between packets to send to modem.</param> /// <param name="packetPlayoutTime">Length of time in MS between packets to send to modem.</param>
/// <param name="trace">Flag indicating whether modem DSP trace is enabled.</param> /// <param name="trace">Flag indicating whether modem DSP trace is enabled.</param>
/// <param name="debug">Flag indicating whether modem DSP debug is enabled.</param> /// <param name="debug">Flag indicating whether modem DSP debug is enabled.</param>
Modem::Modem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker, Modem::Modem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker,
bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug) : bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t p25CorrCount, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug) :
m_port(port), m_port(port),
m_dmrColorCode(0U), m_dmrColorCode(0U),
m_p25NAC(0x293U), m_p25NAC(0x293U),
@ -83,6 +84,7 @@ Modem::Modem(const std::string& port, bool duplex, bool rxInvert, bool txInvert,
m_cosLockout(cosLockout), m_cosLockout(cosLockout),
m_fdmaPreamble(fdmaPreamble), m_fdmaPreamble(fdmaPreamble),
m_dmrRxDelay(dmrRxDelay), m_dmrRxDelay(dmrRxDelay),
m_p25CorrCount(p25CorrCount),
m_rxLevel(0U), m_rxLevel(0U),
m_cwIdTXLevel(0U), m_cwIdTXLevel(0U),
m_dmrTXLevel(0U), m_dmrTXLevel(0U),
@ -1083,18 +1085,19 @@ bool Modem::sendCWId(const std::string& callsign)
/// <param name="cosLockout">Flag indicating whether the COS signal should be used to lockout the modem.</param> /// <param name="cosLockout">Flag indicating whether the COS signal should be used to lockout the modem.</param>
/// <param name="fdmaPreamble">Count of FDMA preambles to transmit before data. (P25/DMR DMO)</param> /// <param name="fdmaPreamble">Count of FDMA preambles to transmit before data. (P25/DMR DMO)</param>
/// <param name="dmrRxDelay">Compensate for delay in receiver audio chain in ms. Usually DSP based.</param> /// <param name="dmrRxDelay">Compensate for delay in receiver audio chain in ms. Usually DSP based.</param>
/// <param name="p25CorrCount">P25 Correlation Countdown.</param>
/// <param name="packetPlayoutTime">Length of time in MS between packets to send to modem.</param> /// <param name="packetPlayoutTime">Length of time in MS between packets to send to modem.</param>
/// <param name="disableOFlowReset">Flag indicating whether the ADC/DAC overflow reset logic is disabled.</param> /// <param name="disableOFlowReset">Flag indicating whether the ADC/DAC overflow reset logic is disabled.</param>
/// <param name="trace">Flag indicating whether modem DSP trace is enabled.</param> /// <param name="trace">Flag indicating whether modem DSP trace is enabled.</param>
/// <param name="debug">Flag indicating whether modem DSP debug is enabled.</param> /// <param name="debug">Flag indicating whether modem DSP debug is enabled.</param>
Modem* Modem::createModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker, Modem* Modem::createModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker,
bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug) bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t p25CorrCount, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug)
{ {
if (port == NULL_MODEM) { if (port == NULL_MODEM) {
return new NullModem(port, duplex, rxInvert, txInvert, pttInvert, dcBlocker, cosLockout, fdmaPreamble, dmrRxDelay, packetPlayoutTime, disableOFlowReset, trace, debug); return new NullModem(port, duplex, rxInvert, txInvert, pttInvert, dcBlocker, cosLockout, fdmaPreamble, dmrRxDelay, p25CorrCount, packetPlayoutTime, disableOFlowReset, trace, debug);
} }
else { else {
return new Modem(port, duplex, rxInvert, txInvert, pttInvert, dcBlocker, cosLockout, fdmaPreamble, dmrRxDelay, packetPlayoutTime, disableOFlowReset, trace, debug); return new Modem(port, duplex, rxInvert, txInvert, pttInvert, dcBlocker, cosLockout, fdmaPreamble, dmrRxDelay, p25CorrCount, packetPlayoutTime, disableOFlowReset, trace, debug);
} }
} }
@ -1240,6 +1243,8 @@ bool Modem::writeConfig()
buffer[16U] = (uint8_t)(m_txDCOffset + 128); buffer[16U] = (uint8_t)(m_txDCOffset + 128);
buffer[17U] = (uint8_t)(m_rxDCOffset + 128); buffer[17U] = (uint8_t)(m_rxDCOffset + 128);
buffer[14U] = m_p25CorrCount;
// Utils::dump(1U, "Written", buffer, 17U); // Utils::dump(1U, "Written", buffer, 17U);
int ret = m_serial.write(buffer, 17U); int ret = m_serial.write(buffer, 17U);

@ -142,7 +142,7 @@ namespace modem
RSN_INVALID_DMR_START = 14U, RSN_INVALID_DMR_START = 14U,
RSN_INVALID_DMR_RX_DELAY = 15U, RSN_INVALID_DMR_RX_DELAY = 15U,
RSN_INVALID_P25_NAC = 16U, RSN_INVALID_P25_CORR_COUNT = 16U,
RSN_DMR_DISABLED = 63U, RSN_DMR_DISABLED = 63U,
RSN_P25_DISABLED = 64U, RSN_P25_DISABLED = 64U,
@ -167,7 +167,7 @@ namespace modem
public: public:
/// <summary>Initializes a new instance of the Modem class.</summary> /// <summary>Initializes a new instance of the Modem class.</summary>
Modem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker, Modem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker,
bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug); bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t p25CorrCount, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug);
/// <summary>Finalizes a instance of the Modem class.</summary> /// <summary>Finalizes a instance of the Modem class.</summary>
virtual ~Modem(); virtual ~Modem();
@ -255,7 +255,7 @@ namespace modem
/// <summary>Helper to create an instance of the Modem class.</summary> /// <summary>Helper to create an instance of the Modem class.</summary>
static Modem* createModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker, static Modem* createModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker,
bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug); bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t p25CorrCount, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug);
private: private:
std::string m_port; std::string m_port;
@ -274,6 +274,7 @@ namespace modem
uint8_t m_fdmaPreamble; uint8_t m_fdmaPreamble;
uint8_t m_dmrRxDelay; uint8_t m_dmrRxDelay;
uint8_t m_p25CorrCount;
float m_rxLevel; float m_rxLevel;
float m_cwIdTXLevel; float m_cwIdTXLevel;

@ -49,13 +49,14 @@ using namespace modem;
/// <param name="cosLockout">Flag indicating whether the COS signal should be used to lockout the modem.</param> /// <param name="cosLockout">Flag indicating whether the COS signal should be used to lockout the modem.</param>
/// <param name="fdmaPreamble">Count of FDMA preambles to transmit before data. (P25/DMR DMO)</param> /// <param name="fdmaPreamble">Count of FDMA preambles to transmit before data. (P25/DMR DMO)</param>
/// <param name="dmrRxDelay">Compensate for delay in receiver audio chain in ms. Usually DSP based.</param> /// <param name="dmrRxDelay">Compensate for delay in receiver audio chain in ms. Usually DSP based.</param>
/// <param name="p25CorrCount">P25 Correlation Countdown.</param>
/// <param name="packetPlayoutTime">Length of time in MS between packets to send to modem.</param> /// <param name="packetPlayoutTime">Length of time in MS between packets to send to modem.</param>
/// <param name="disableOFlowReset">Flag indicating whether the ADC/DAC overflow reset logic is disabled.</param> /// <param name="disableOFlowReset">Flag indicating whether the ADC/DAC overflow reset logic is disabled.</param>
/// <param name="trace">Flag indicating whether modem DSP trace is enabled.</param> /// <param name="trace">Flag indicating whether modem DSP trace is enabled.</param>
/// <param name="debug">Flag indicating whether modem DSP debug is enabled.</param> /// <param name="debug">Flag indicating whether modem DSP debug is enabled.</param>
NullModem::NullModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker, NullModem::NullModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker,
bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug) : bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t p25CorrCount, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug) :
Modem(port, duplex, rxInvert, txInvert, pttInvert, dcBlocker, cosLockout, fdmaPreamble, dmrRxDelay, packetPlayoutTime, disableOFlowReset, trace, debug) Modem(port, duplex, rxInvert, txInvert, pttInvert, dcBlocker, cosLockout, fdmaPreamble, dmrRxDelay, p25CorrCount, packetPlayoutTime, disableOFlowReset, trace, debug)
{ {
/* stub */ /* stub */
} }

@ -45,7 +45,7 @@ namespace modem
public: public:
/// <summary>Initializes a new instance of the NullModem class.</summary> /// <summary>Initializes a new instance of the NullModem class.</summary>
NullModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker, NullModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker,
bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug); bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t p25CorrCount, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug);
/// <summary>Finalizes a instance of the NullModem class.</summary> /// <summary>Finalizes a instance of the NullModem class.</summary>
~NullModem(); ~NullModem();

@ -1847,7 +1847,7 @@ void TrunkPacket::queueRF_TSBK_Ctrl_MBF(uint8_t lco)
else { else {
SiteData site = it->second; SiteData site = it->second;
uint8_t cfva = P25_CFVA_CONV | P25_CFVA_NETWORK; uint8_t cfva = P25_CFVA_NETWORK;
if (m_adjSiteUpdateCnt[site.siteId()] == 0U) { if (m_adjSiteUpdateCnt[site.siteId()] == 0U) {
cfva |= P25_CFVA_FAILURE; cfva |= P25_CFVA_FAILURE;
} }
@ -1855,6 +1855,11 @@ void TrunkPacket::queueRF_TSBK_Ctrl_MBF(uint8_t lco)
cfva |= P25_CFVA_VALID; cfva |= P25_CFVA_VALID;
} }
uint8_t serviceClass = site.serviceClass();
if ((serviceClass & P25_SVC_CLS_COMPOSITE) == P25_SVC_CLS_COMPOSITE) {
cfva |= P25_CFVA_CONV;
}
// transmit adjacent site broadcast // transmit adjacent site broadcast
m_rfTSBK.setLCO(TSBK_OSP_ADJ_STS_BCAST); m_rfTSBK.setLCO(TSBK_OSP_ADJ_STS_BCAST);
m_rfTSBK.setAdjSiteCFVA(cfva); m_rfTSBK.setAdjSiteCFVA(cfva);

Loading…
Cancel
Save

Powered by TurnKey Linux.