mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2025-12-06 05:32:00 +01:00
Regenerate the rate 1/2 data payload.
This commit is contained in:
parent
bf8c4b2fd2
commit
f29f48503e
25
DMRSlot.cpp
25
DMRSlot.cpp
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue