pull/55/head
parent
01b92641fd
commit
0251944438
@ -0,0 +1,83 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
/**
|
||||||
|
* Digital Voice Modem - Common Library
|
||||||
|
* GPLv2 Open Source. Use is subject to license terms.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* @package DVM / Common Library
|
||||||
|
* @license GPLv2 License (https://opensource.org/licenses/GPL-2.0)
|
||||||
|
*
|
||||||
|
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include "Defines.h"
|
||||||
|
#include "p25/lc/tsbk/mbt/MBT_ISP_GRP_AFF_Q_RSP.h"
|
||||||
|
|
||||||
|
using namespace p25::lc::tsbk;
|
||||||
|
using namespace p25::lc;
|
||||||
|
using namespace p25;
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Public Class Members
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the MBT_ISP_GRP_AFF_Q_RSP class.
|
||||||
|
/// </summary>
|
||||||
|
MBT_ISP_GRP_AFF_Q_RSP::MBT_ISP_GRP_AFF_Q_RSP() : AMBT()
|
||||||
|
{
|
||||||
|
m_lco = TSBK_ISP_GRP_AFF_Q_RSP;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Decode a alternate trunking signalling block.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dataHeader"></param>
|
||||||
|
/// <param name="blocks"></param>
|
||||||
|
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||||
|
bool MBT_ISP_GRP_AFF_Q_RSP::decodeMBT(const data::DataHeader& dataHeader, const data::DataBlock* blocks)
|
||||||
|
{
|
||||||
|
assert(blocks != nullptr);
|
||||||
|
|
||||||
|
uint8_t pduUserData[P25_PDU_UNCONFIRMED_LENGTH_BYTES * dataHeader.getBlocksToFollow()];
|
||||||
|
::memset(pduUserData, 0x00U, P25_PDU_UNCONFIRMED_LENGTH_BYTES * dataHeader.getBlocksToFollow());
|
||||||
|
|
||||||
|
bool ret = AMBT::decode(dataHeader, blocks, pduUserData);
|
||||||
|
if (!ret)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
ulong64_t tsbkValue = AMBT::toValue(dataHeader, pduUserData);
|
||||||
|
|
||||||
|
m_netId = (uint32_t)((tsbkValue >> 44) & 0xFFFFFU); // Network ID
|
||||||
|
m_sysId = (uint32_t)((tsbkValue >> 32) & 0xFFFU); // System ID
|
||||||
|
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Talkgroup Address
|
||||||
|
m_srcId = dataHeader.getLLId(); // Source Radio Address
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Encode a alternate trunking signalling block.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dataHeader"></param>
|
||||||
|
/// <param name="pduUserData"></param>
|
||||||
|
void MBT_ISP_GRP_AFF_Q_RSP::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||||
|
{
|
||||||
|
assert(pduUserData != nullptr);
|
||||||
|
|
||||||
|
/* stub */
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a string that represents the current TSBK.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="isp"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
std::string MBT_ISP_GRP_AFF_Q_RSP::toString(bool isp)
|
||||||
|
{
|
||||||
|
return std::string("TSBK_ISP_GRP_AFF_Q_RSP (Group Affiliation Query Response)");
|
||||||
|
}
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
/**
|
||||||
|
* Digital Voice Modem - Common Library
|
||||||
|
* GPLv2 Open Source. Use is subject to license terms.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* @package DVM / Common Library
|
||||||
|
* @license GPLv2 License (https://opensource.org/licenses/GPL-2.0)
|
||||||
|
*
|
||||||
|
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#if !defined(__P25_LC_TSBK__MBT_ISP_GRP_AFF_Q_RSP_H__)
|
||||||
|
#define __P25_LC_TSBK__MBT_ISP_GRP_AFF_Q_RSP_H__
|
||||||
|
|
||||||
|
#include "common/Defines.h"
|
||||||
|
#include "common/p25/lc/AMBT.h"
|
||||||
|
|
||||||
|
namespace p25
|
||||||
|
{
|
||||||
|
namespace lc
|
||||||
|
{
|
||||||
|
namespace tsbk
|
||||||
|
{
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Class Declaration
|
||||||
|
// Implements GRP AFF Q RSP - Group Affiliation Query Response
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class HOST_SW_API MBT_ISP_GRP_AFF_Q_RSP : public AMBT {
|
||||||
|
public:
|
||||||
|
/// <summary>Initializes a new instance of the MBT_ISP_GRP_AFF_Q_RSP class.</summary>
|
||||||
|
MBT_ISP_GRP_AFF_Q_RSP();
|
||||||
|
|
||||||
|
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||||
|
bool decodeMBT(const data::DataHeader& dataHeader, const data::DataBlock* blocks) override;
|
||||||
|
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||||
|
void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) override;
|
||||||
|
|
||||||
|
/// <summary>Returns a string that represents the current TSBK.</summary>
|
||||||
|
std::string toString(bool isp = true) override;
|
||||||
|
};
|
||||||
|
} // namespace tsbk
|
||||||
|
} // namespace lc
|
||||||
|
} // namespace p25
|
||||||
|
|
||||||
|
#endif // __P25_LC_TSBK__MBT_ISP_GRP_AFF_Q_RSP_H__
|
||||||
Loading…
Reference in new issue