Merge remote-tracking branch 'g4klx/master'

This commit is contained in:
Andy CA6JAU 2016-12-20 20:27:27 -03:00
commit d447899fb6
6 changed files with 2264 additions and 149 deletions

View file

@ -31,7 +31,9 @@ m_FID(0x00U),
m_GI(false),
m_bsId(0U),
m_srcId(0U),
m_dstId(0U)
m_dstId(0U),
m_dataContent(false),
m_CBF(0U)
{
m_data = new unsigned char[12U];
}
@ -64,40 +66,57 @@ bool CDMRCSBK::put(const unsigned char* bytes)
switch (m_CSBKO) {
case CSBKO_BSDWNACT:
m_GI = false;
m_bsId = m_data[4U] << 16 | m_data[5U] << 8 | m_data[6U];
m_srcId = m_data[7U] << 16 | m_data[8U] << 8 | m_data[9U];
// CUtils::dump(1U, "Downlink Activate CSBK", m_data, 12U);
m_dataContent = false;
m_CBF = 0U;
CUtils::dump(1U, "Downlink Activate CSBK", m_data, 12U);
break;
case CSBKO_UUVREQ:
m_GI = false;
m_dstId = m_data[4U] << 16 | m_data[5U] << 8 | m_data[6U];
m_srcId = m_data[7U] << 16 | m_data[8U] << 8 | m_data[9U];
// CUtils::dump(1U, "Unit to Unit Service Request CSBK", m_data, 12U);
m_dataContent = false;
m_CBF = 0U;
CUtils::dump(1U, "Unit to Unit Service Request CSBK", m_data, 12U);
break;
case CSBKO_UUANSRSP:
m_GI = false;
m_dstId = m_data[4U] << 16 | m_data[5U] << 8 | m_data[6U];
m_srcId = m_data[7U] << 16 | m_data[8U] << 8 | m_data[9U];
// CUtils::dump(1U, "Unit to Unit Service Answer Response CSBK", m_data, 12U);
m_dataContent = false;
m_CBF = 0U;
CUtils::dump(1U, "Unit to Unit Service Answer Response CSBK", m_data, 12U);
break;
case CSBKO_PRECCSBK:
m_GI = (m_data[2U] & 0x40U) == 0x40U;
m_dstId = m_data[4U] << 16 | m_data[5U] << 8 | m_data[6U];
m_srcId = m_data[7U] << 16 | m_data[8U] << 8 | m_data[9U];
// CUtils::dump(1U, "Preamble CSBK", m_data, 12U);
m_dataContent = (m_data[2U] & 0x80U) == 0x80U;
m_CBF = m_data[3U];
CUtils::dump(1U, "Preamble CSBK", m_data, 12U);
break;
case CSBKO_NACKRSP:
m_GI = false;
m_srcId = m_data[4U] << 16 | m_data[5U] << 8 | m_data[6U];
m_dstId = m_data[7U] << 16 | m_data[8U] << 8 | m_data[9U];
// CUtils::dump(1U, "Negative Acknowledge Response CSBK", m_data, 12U);
m_dataContent = false;
m_CBF = 0U;
CUtils::dump(1U, "Negative Acknowledge Response CSBK", m_data, 12U);
break;
default:
CUtils::dump("Unhandled CSBK type", m_data, 12U);
m_GI = false;
m_srcId = 0U;
m_dstId = 0U;
m_dataContent = false;
m_CBF = 0U;
CUtils::dump("Unhandled CSBK type", m_data, 12U);
return true;
}
@ -141,3 +160,13 @@ unsigned int CDMRCSBK::getDstId() const
{
return m_dstId;
}
bool CDMRCSBK::getDataContent() const
{
return m_dataContent;
}
unsigned char CDMRCSBK::getCBF() const
{
return m_CBF;
}

View file

@ -54,6 +54,9 @@ public:
unsigned int getSrcId() const;
unsigned int getDstId() const;
bool getDataContent() const;
unsigned char getCBF() const;
private:
unsigned char* m_data;
CSBKO m_CSBKO;
@ -62,6 +65,8 @@ private:
unsigned int m_bsId;
unsigned int m_srcId;
unsigned int m_dstId;
bool m_dataContent;
unsigned char m_CBF;
};
#endif

2295
DMRIds.dat

File diff suppressed because it is too large Load diff

View file

@ -60,7 +60,6 @@ m_queue(5000U, "DMR Slot"),
m_rfState(RS_RF_LISTENING),
m_netState(RS_NET_IDLE),
m_rfEmbeddedLC(),
m_netEmbeddedLC(),
m_rfLC(NULL),
m_netLC(NULL),
m_rfDataHeader(),
@ -364,7 +363,7 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
LogMessage("DMR Slot %u, received RF Negative Acknowledgment Response CSBK from %s to %s%s", m_slotNo, src.c_str(), gi ? "TG ": "", dst.c_str());
break;
case CSBKO_PRECCSBK:
LogMessage("DMR Slot %u, received RF Preamble CSBK from %s to %s%s", m_slotNo, src.c_str(), gi ? "TG ": "", dst.c_str());
LogMessage("DMR Slot %u, received RF %s Preamble CSBK (%u to follow) from %s to %s%s", m_slotNo, csbk.getDataContent() ? "Data" : "CSBK", csbk.getCBF(), src.c_str(), gi ? "TG ": "", dst.c_str());
break;
default:
LogWarning("DMR Slot %u, unhandled RF CSBK type - 0x%02X", m_slotNo, csbko);
@ -775,9 +774,6 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
dstId = rewriteId;
}
// Store the LC for the embedded LC
m_netEmbeddedLC.setData(*m_netLC);
// Regenerate the LC data
fullLC.encode(*m_netLC, data + 2U, DT_VOICE_LC_HEADER);
@ -1230,7 +1226,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
LogMessage("DMR Slot %u, received network Negative Acknowledgment Response CSBK from %s to %s%s", m_slotNo, src.c_str(), gi ? "TG ": "", dst.c_str());
break;
case CSBKO_PRECCSBK:
LogMessage("DMR Slot %u, received network Preamble CSBK from %s to %s%s", m_slotNo, src.c_str(), gi ? "TG ": "", dst.c_str());
LogMessage("DMR Slot %u, received network %s Preamble CSBK (%u to follow) from %s to %s%s", m_slotNo, csbk.getDataContent() ? "Data" : "CSBK", csbk.getCBF(), src.c_str(), gi ? "TG " : "", dst.c_str());
break;
default:
LogWarning("DMR Slot %u, unhandled network CSBK type - 0x%02X", m_slotNo, csbko);
@ -1632,10 +1628,10 @@ void CDMRSlot::insertSilence(unsigned int count)
if (n == 0U) {
CSync::addDMRAudioSync(data + 2U, m_duplex);
} else {
unsigned char lcss = m_netEmbeddedLC.getData(data + 2U, n);
::memset(data + 2U + 13U, 0x00U, 7U);
m_lastEMB.setColorCode(m_colorCode);
m_lastEMB.setLCSS(lcss);
m_lastEMB.setLCSS(0U);
m_lastEMB.getData(data + 2U);
}

View file

@ -58,7 +58,6 @@ private:
RPT_RF_STATE m_rfState;
RPT_NET_STATE m_netState;
CDMREmbeddedLC m_rfEmbeddedLC;
CDMREmbeddedLC m_netEmbeddedLC;
CDMRLC* m_rfLC;
CDMRLC* m_netLC;
CDMRDataHeader m_rfDataHeader;

View file

@ -1,57 +0,0 @@
Talk-Group Rewrite was conceived as a way of making talk-groups behave more
like the reflector system and of attempting to solve the problem of "slot
contention",where the user may be locked out of a slot by traffic on a
talk-group they know nothing about, without knowing why. This is frustrating to
users, both those new to DMR and seasoned DMR users.
TG Rewrite, when enabled for a slot, rewrites the DST ID of incoming talkgroup
traffic to TG9, alowing audio to be heard by any user monitoring TG9 on that
slot. If the user then replies on TG9, as long as they key-up during the
CallHang period, the DST ID (TG) is again rewritten on the outbound traffic,
which transparently maps back to the originating talkgroup. Rewrite is also
enabled if an outbound call is made to a talkgroup and then TG9 is activated
during the CallHang period.
To use a User Activated talk-group, either briefly key-up on that talk-group to
activate it, then switch back to TG9 and talk as normal. Alternatively, and
perhaps more usefully, you can make a private call to the talk-group ID. This
enables you to manual-dial a talkgroup that is not in your codeplug, in the same
way that you can manual dial a reflector. If the CallHang period
expires, you may need to activate the talk-group again by keying up on that
talkgroup briefly, as before. Alternatively, you can wait for inbound audio to
re-activate the rewrite, then respond during the CallHang period.
Note, proper ettiquette dictates that the user confirms the repeater is free
before activiating this feature. It is best to ensure the slot is keyed from
"cold" when activating a talkgroup for rewrite. Although not strictly
neccesary, it may be advantageous to also disconnect the repeater from the
reflector system first, if using slot 2.
Talk-group rewrite was originally intended to work with User-Activated talk
groups, although it will function with permanent talk-groups too.
It is useful to set the CallHang parameter to a generous amount. I am currently
using seven seconds.
In addition to the above, there is also the capability ro rewrite voice prompts
on link/unlink so all users can hear them on TG9.
Configuration options are as follows:
TGRewriteSlot1=[0|1]
TGRewriteSlot2=[0|1]
BMAutoRewrite=[0|1]
BMRewriteReflectorVoicePrompts=[0|1]
Note at present, Auto rewrite is the only type of rewrite that is implemented
so
to do something useful, this option must be set.
ACL's are applied before the rewrite, so still apply to rewritten traffic on
original (non-rewritten) talk-group.
73
Simon (G7RZU)