Use the new CSBK and Data Header rewrite blocks.

This commit is contained in:
Jonathan Naylor
2017-08-01 21:59:19 +01:00
parent cd19de377e
commit b949533318
8 changed files with 204 additions and 4 deletions

View File

@@ -34,7 +34,9 @@ m_toSlot(toSlot),
m_toTGStart(toTG),
m_toTGEnd(toTG + range - 1U),
m_lc(FLCO_GROUP, 0U, toTG),
m_embeddedLC()
m_embeddedLC(),
m_dataHeader(),
m_csbk()
{
assert(fromSlot == 1U || fromSlot == 2U);
assert(toSlot == 1U || toSlot == 2U);
@@ -78,6 +80,15 @@ bool CRewriteTG::process(CDMRData& data, bool trace)
case DT_VOICE:
processVoice(data, newTG);
break;
case DT_CSBK:
processCSBK(data, newTG);
break;
case DT_DATA_HEADER:
processDataHeader(data, newTG);
break;
case DT_RATE_12_DATA:
case DT_RATE_34_DATA:
case DT_RATE_1_DATA:
case DT_VOICE_SYNC:
// Nothing to do
break;
@@ -136,3 +147,35 @@ void CRewriteTG::processVoice(CDMRData& data, unsigned int tg)
data.setData(buffer);
}
void CRewriteTG::processDataHeader(CDMRData& data, unsigned int tg)
{
unsigned char buffer[DMR_FRAME_LENGTH_BYTES];
data.getData(buffer);
bool ret = m_dataHeader.put(buffer);
if (!ret)
return;
m_dataHeader.setDstId(tg);
m_dataHeader.get(buffer);
data.setData(buffer);
}
void CRewriteTG::processCSBK(CDMRData& data, unsigned int tg)
{
unsigned char buffer[DMR_FRAME_LENGTH_BYTES];
data.getData(buffer);
bool ret = m_csbk.put(buffer);
if (!ret)
return;
m_csbk.setDstId(tg);
m_csbk.get(buffer);
data.setData(buffer);
}