Add mode 4 (force off) for the DMR OVCM flag.

This commit is contained in:
Jonathan Naylor 2021-03-07 17:42:55 +00:00
parent 5537ebbb65
commit 5d8d1a3fb9
10 changed files with 61 additions and 11 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2020 by Jonathan Naylor G4KLX
* Copyright (C) 2015-2021 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
@ -668,6 +668,9 @@ bool CConf::read()
case 3:
m_dmrOVCM = DMR_OVCM_ON;
break;
case 4:
m_dmrOVCM = DMR_OVCM_FORCE_OFF;
break;
default:
m_dmrOVCM = DMR_OVCM_OFF;
break;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2020,2021 by Jonathan Naylor G4KLX
* Copyright (C) 2019 by Patrick Maier DK5MP
*
* This program is free software; you can redistribute it and/or modify
@ -189,6 +189,12 @@ void CDMRCSBK::setOVCM(bool ovcm)
}
}
void CDMRCSBK::clearOVCM()
{
if (getOVCM())
m_data[2U] ^= 0x04U;
}
bool CDMRCSBK::getGI() const
{
return m_GI;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2020,2021 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
@ -50,6 +50,7 @@ public:
// Set/Get the OVCM bit in the supported CSBKs
bool getOVCM() const;
void setOVCM(bool ovcm);
void clearOVCM();
// For BS Dwn Act
unsigned int getBSId() const;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016,2019 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2019,2021 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
@ -195,6 +195,12 @@ void CDMRLC::setOVCM(bool ovcm)
m_options |= 0x04U;
}
void CDMRLC::clearOVCM()
{
if (getOVCM())
m_options ^= 0x04U;
}
unsigned int CDMRLC::getSrcId() const
{
return m_srcId;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016,2019 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2019,2021 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,7 @@ public:
bool getOVCM() const;
void setOVCM(bool ovcm);
void clearOVCM();
unsigned char getFID() const;
void setFID(unsigned char fid);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2020 Jonathan Naylor, G4KLX
* Copyright (C) 2015-2021 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
@ -236,6 +236,11 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len)
lc->setOVCM(m_ovcm == DMR_OVCM_TX_ON || m_ovcm == DMR_OVCM_ON);
m_rfLC = lc;
if (m_ovcm == DMR_OVCM_FORCE_OFF) {
lc->clearOVCM();
m_rfLC = lc;
}
// The standby LC data
m_rfEmbeddedLC.setLC(*m_rfLC);
m_rfEmbeddedData[0U].setLC(*m_rfLC);
@ -439,6 +444,9 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len)
// set the OVCM bit for the supported csbk
csbk.setOVCM(m_ovcm == DMR_OVCM_TX_ON || m_ovcm == DMR_OVCM_ON);
if (m_ovcm == DMR_OVCM_FORCE_OFF)
csbk.clearOVCM();
bool gi = csbk.getGI();
unsigned int srcId = csbk.getSrcId();
unsigned int dstId = csbk.getDstId();
@ -797,6 +805,11 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len)
lc->setOVCM(m_ovcm == DMR_OVCM_TX_ON || m_ovcm == DMR_OVCM_ON);
m_rfLC = lc;
if (m_ovcm == DMR_OVCM_FORCE_OFF) {
lc->clearOVCM();
m_rfLC = lc;
}
// The standby LC data
m_rfEmbeddedLC.setLC(*m_rfLC);
m_rfEmbeddedData[0U].setLC(*m_rfLC);
@ -1053,6 +1066,11 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
lc->setOVCM(m_ovcm == DMR_OVCM_RX_ON || m_ovcm == DMR_OVCM_ON);
m_netLC = lc;
if (m_ovcm == DMR_OVCM_FORCE_OFF) {
lc->clearOVCM();
m_netLC = lc;
}
// The standby LC data
m_netEmbeddedLC.setLC(*m_netLC);
m_netEmbeddedData[0U].setLC(*m_netLC);
@ -1128,6 +1146,11 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
lc->setOVCM(m_ovcm == DMR_OVCM_RX_ON || m_ovcm == DMR_OVCM_ON);
m_netLC = lc;
if (m_ovcm == DMR_OVCM_FORCE_OFF) {
lc->clearOVCM();
m_netLC = lc;
}
m_lastFrameValid = false;
m_netTimeoutTimer.start();
@ -1315,6 +1338,11 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
lc->setOVCM(m_ovcm == DMR_OVCM_RX_ON || m_ovcm == DMR_OVCM_ON);
m_netLC = lc;
if (m_ovcm == DMR_OVCM_FORCE_OFF) {
lc->clearOVCM();
m_netLC = lc;
}
// The standby LC data
m_netEmbeddedLC.setLC(*m_netLC);
m_netEmbeddedData[0U].setLC(*m_netLC);
@ -1586,6 +1614,9 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
// set the OVCM bit for the supported csbk
csbk.setOVCM(m_ovcm == DMR_OVCM_RX_ON || m_ovcm == DMR_OVCM_ON);
if (m_ovcm == DMR_OVCM_FORCE_OFF)
csbk.clearOVCM();
bool gi = csbk.getGI();
unsigned int srcId = csbk.getSrcId();
unsigned int dstId = csbk.getDstId();

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2017,2018,2021 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
@ -81,7 +81,8 @@ enum DMR_OVCM_TYPES {
DMR_OVCM_OFF,
DMR_OVCM_RX_ON,
DMR_OVCM_TX_ON,
DMR_OVCM_ON
DMR_OVCM_ON,
DMR_OVCM_FORCE_OFF
};
#endif

View File

@ -112,7 +112,7 @@ DumpTAData=1
CallHang=3
TXHang=4
# ModeHang=10
# OVCM Values, 0=off, 1=rx_on, 2=tx_on, 3=both_on
# OVCM Values, 0=off, 1=rx_on, 2=tx_on, 3=both_on, 4=force off
# OVCM=0
[System Fusion]

View File

@ -507,7 +507,8 @@ int CMMDVMHost::run()
LogInfo(" OVCM: on(tx only)");
else if (ovcm == DMR_OVCM_ON)
LogInfo(" OVCM: on");
else if (ovcm == DMR_OVCM_FORCE_OFF)
LogInfo(" OVCM: off (forced)");
switch (dmrBeacons) {
case DMR_BEACONS_NETWORK: {

View File

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