mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-04-21 06:13:49 +00:00
DMR trunking patches
This commit is contained in:
parent
b5b119fa8e
commit
4ff3bbf766
16 changed files with 696 additions and 55 deletions
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2012 by Ian Wraith
|
||||
* Copyright (C) 2015,2016,2017,2023,2025 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2026 by Adrian Musceac YO8RZZ
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -42,7 +43,8 @@ m_dstId(0U),
|
|||
m_blocks(0U),
|
||||
m_F(false),
|
||||
m_S(false),
|
||||
m_Ns(0U)
|
||||
m_Ns(0U),
|
||||
m_UDT(false)
|
||||
{
|
||||
m_data = new unsigned char[12U];
|
||||
}
|
||||
|
|
@ -121,6 +123,7 @@ bool CDMRDataHeader::put(const unsigned char* bytes)
|
|||
case DPF_UDT:
|
||||
CUtils::dump(1U, "DMR, Unified Data Transport Header", m_data, 12U);
|
||||
m_blocks = (m_data[8U] & 0x03U) + 1U;
|
||||
m_UDT = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -134,6 +137,17 @@ bool CDMRDataHeader::put(const unsigned char* bytes)
|
|||
void CDMRDataHeader::get(unsigned char* bytes) const
|
||||
{
|
||||
assert(bytes != nullptr);
|
||||
assert(bytes != NULL);
|
||||
if(m_UDT)
|
||||
{
|
||||
// Table B.1: CSBK/MBC/UDT Opcode List
|
||||
// Convert to Unified Data Transport outbound Header
|
||||
m_data[9U] &= 0xFE;
|
||||
}
|
||||
CCRC::addCCITT162(m_data, 12U);
|
||||
// Restore the checksum
|
||||
m_data[10U] ^= DATA_HEADER_CRC_MASK[0U];
|
||||
m_data[11U] ^= DATA_HEADER_CRC_MASK[1U];
|
||||
|
||||
CBPTC19696 bptc;
|
||||
bptc.encode(m_data, bytes);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue