Regenerate the rate 1/2 data payload.

This commit is contained in:
Jonathan Naylor 2016-02-24 07:37:58 +00:00
parent bf8c4b2fd2
commit f29f48503e

View file

@ -15,6 +15,7 @@
#include "DMRSlotType.h"
#include "DMRShortLC.h"
#include "DMRFullLC.h"
#include "BPTC19696.h"
#include "DMRSlot.h"
#include "DMRCSBK.h"
#include "Utils.h"
@ -298,6 +299,14 @@ void CDMRSlot::writeModem(unsigned char *data)
if (m_state != RS_RELAYING_RF_DATA)
return;
// Regenerate the payload if possible
if (dataType == DT_RATE_12_DATA) {
CBPTC19696 bptc;
unsigned char payload[12U];
bptc.decode(data + 2U, payload);
bptc.encode(payload, data + 2U);
}
// Regenerate the Slot Type
slotType.getData(data + 2U);
@ -356,6 +365,14 @@ void CDMRSlot::writeModem(unsigned char *data)
unsigned char dataType = slotType.getDataType();
if (dataType == DT_RATE_12_DATA || dataType == DT_RATE_34_DATA || dataType == DT_RATE_1_DATA) {
// Regenerate the payload if possible
if (dataType == DT_RATE_12_DATA) {
CBPTC19696 bptc;
unsigned char payload[12U];
bptc.decode(data + 2U, payload);
bptc.encode(payload, data + 2U);
}
// Regenerate the Slot Type
slotType.getData(data + 2U);
@ -875,6 +892,14 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
if (m_state != RS_RELAYING_NETWORK_DATA)
return;
// Regenerate the payload if possible
if (dataType == DT_RATE_12_DATA) {
CBPTC19696 bptc;
unsigned char payload[12U];
bptc.decode(data + 2U, payload);
bptc.encode(payload, data + 2U);
}
// Regenerate the Slot Type
CDMRSlotType slotType;
slotType.putData(data + 2U);