implement fix for CSBK verbosity not being set; during CC stream hide CSBK/TSBK/RCCH verbosity; implement CSBKO_MAINT CSBK; correct missing behavior to perform DMR payload activation; add CRC handling for MBC;
parent
a64dfa38fd
commit
b3c803e918
@ -0,0 +1,98 @@
|
||||
/**
|
||||
* Digital Voice Modem - Host Software
|
||||
* GPLv2 Open Source. Use is subject to license terms.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* @package DVM / Host Software
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2023 by Bryan Biedenkapp N2PLL
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
#include "Defines.h"
|
||||
#include "dmr/lc/csbk/CSBK_MAINT.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace dmr::lc::csbk;
|
||||
using namespace dmr::lc;
|
||||
using namespace dmr;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the CSBK_MAINT class.
|
||||
/// </summary>
|
||||
CSBK_MAINT::CSBK_MAINT() : CSBK()
|
||||
{
|
||||
m_CSBKO = CSBKO_MAINT;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a control signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns>True, if CSBK was decoded, otherwise false.</returns>
|
||||
bool CSBK_MAINT::decode(const uint8_t* data)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t csbk[DMR_CSBK_LENGTH_BYTES];
|
||||
::memset(csbk, 0x00U, DMR_CSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = CSBK::decode(data, csbk);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t csbkValue = CSBK::toValue(csbk);
|
||||
|
||||
m_dstId = (uint32_t)((csbkValue >> 24) & 0xFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(csbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a control signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void CSBK_MAINT::encode(uint8_t* data)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t csbkValue = 0U;
|
||||
|
||||
csbkValue = (csbkValue << 25) + m_dstId; // Target Radio Address
|
||||
csbkValue = (csbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
std::unique_ptr<uint8_t[]> csbk = CSBK::fromValue(csbkValue);
|
||||
CSBK::encode(data, csbk.get());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current CSBK.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
std::string CSBK_MAINT::toString()
|
||||
{
|
||||
return std::string("CSBKO_MAINT (Call Maintainence)");
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
/**
|
||||
* Digital Voice Modem - Host Software
|
||||
* GPLv2 Open Source. Use is subject to license terms.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* @package DVM / Host Software
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2023 by Bryan Biedenkapp N2PLL
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
#if !defined(__DMR_LC_CSBK__CSBK_MAINT_H__)
|
||||
#define __DMR_LC_CSBK__CSBK_MAINT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "dmr/lc/CSBK.h"
|
||||
|
||||
namespace dmr
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace csbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements MAINT - Call Maintainence
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API CSBK_MAINT : public CSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the CSBK_MAINT class.</summary>
|
||||
CSBK_MAINT();
|
||||
|
||||
/// <summary>Decode a control signalling block.</summary>
|
||||
bool decode(const uint8_t* data);
|
||||
/// <summary>Encode a control signalling block.</summary>
|
||||
void encode(uint8_t* data);
|
||||
|
||||
/// <summary>Returns a string that represents the current CSBK.</summary>
|
||||
virtual std::string toString() override;
|
||||
};
|
||||
} // namespace csbk
|
||||
} // namespace lc
|
||||
} // namespace dmr
|
||||
|
||||
#endif // __DMR_LC_CSBK__CSBK_MAINT_H__
|
||||
Loading…
Reference in new issue