From 68b8ba031fdc50a5c2603275c892fe6ce6e9ce6f Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Mon, 15 May 2017 09:55:23 +0100 Subject: [PATCH] The UAB in the UDT is one less than reality. --- DMRDataHeader.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DMRDataHeader.cpp b/DMRDataHeader.cpp index d1864a5..4cb1720 100644 --- a/DMRDataHeader.cpp +++ b/DMRDataHeader.cpp @@ -1,6 +1,6 @@ /* - * Copyright (C) 2012 by Ian Wraith - * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX + * Copyright (C) 2012 by Ian Wraith + * Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX * * 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 @@ -118,7 +118,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; + m_blocks = (m_data[8U] & 0x03U) + 1U; break; default: @@ -126,6 +126,7 @@ bool CDMRDataHeader::put(const unsigned char* bytes) break; } + // This may not be needed any longer if (dpf == DPF_UDT && m_blocks == 0U) { unsigned char format = m_data[1U] & 0x0FU; if (format == UDTF_NMEA) {