mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-22 16:25:45 +08:00
Regenerate the PI Header.
This commit is contained in:
@@ -70,6 +70,7 @@ const unsigned char PAYLOAD_RIGHT_MASK[] = {0x0FU, 0xFFU, 0xFFU, 0xFFU, 0xF
|
|||||||
|
|
||||||
const unsigned char VOICE_LC_HEADER_CRC_MASK[] = {0x96U, 0x96U, 0x96U};
|
const unsigned char VOICE_LC_HEADER_CRC_MASK[] = {0x96U, 0x96U, 0x96U};
|
||||||
const unsigned char TERMINATOR_WITH_LC_CRC_MASK[] = {0x99U, 0x99U, 0x99U};
|
const unsigned char TERMINATOR_WITH_LC_CRC_MASK[] = {0x99U, 0x99U, 0x99U};
|
||||||
|
const unsigned char PI_HEADER_CRC_MASK[] = {0x69U, 0x69U};
|
||||||
const unsigned char DATA_HEADER_CRC_MASK[] = {0xCCU, 0xCCU};
|
const unsigned char DATA_HEADER_CRC_MASK[] = {0xCCU, 0xCCU};
|
||||||
const unsigned char CSBK_CRC_MASK[] = {0xA5U, 0xA5U};
|
const unsigned char CSBK_CRC_MASK[] = {0xA5U, 0xA5U};
|
||||||
|
|
||||||
|
|||||||
12
DMRSlot.cpp
12
DMRSlot.cpp
@@ -162,6 +162,12 @@ void CDMRSlot::writeModem(unsigned char *data)
|
|||||||
// Convert the Data Sync to be from the BS
|
// Convert the Data Sync to be from the BS
|
||||||
CSync::addDMRDataSync(data + 2U);
|
CSync::addDMRDataSync(data + 2U);
|
||||||
|
|
||||||
|
// Regenerate the payload
|
||||||
|
CBPTC19696 bptc;
|
||||||
|
unsigned char payload[12U];
|
||||||
|
bptc.decode(data + 2U, payload);
|
||||||
|
bptc.encode(payload, data + 2U);
|
||||||
|
|
||||||
data[0U] = TAG_DATA;
|
data[0U] = TAG_DATA;
|
||||||
data[1U] = 0x00U;
|
data[1U] = 0x00U;
|
||||||
|
|
||||||
@@ -667,6 +673,12 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
|
|||||||
// Convert the Data Sync to be from the BS
|
// Convert the Data Sync to be from the BS
|
||||||
CSync::addDMRDataSync(data + 2U);
|
CSync::addDMRDataSync(data + 2U);
|
||||||
|
|
||||||
|
// Regenerate the payload
|
||||||
|
CBPTC19696 bptc;
|
||||||
|
unsigned char payload[12U];
|
||||||
|
bptc.decode(data + 2U, payload);
|
||||||
|
bptc.encode(payload, data + 2U);
|
||||||
|
|
||||||
data[0U] = TAG_DATA;
|
data[0U] = TAG_DATA;
|
||||||
data[1U] = 0x00U;
|
data[1U] = 0x00U;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user