parent
1053abf875
commit
3254122c4d
@ -0,0 +1,178 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/P25Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
#include "edac/CRC.h"
|
||||
#include "HostMain.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the AMBT class.
|
||||
/// </summary>
|
||||
AMBT::AMBT() : TSBK()
|
||||
{
|
||||
/* stub */
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool AMBT::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
LogError(LOG_P25, "AMBT::decode(), bad call, not implemented");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void AMBT::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
LogError(LOG_P25, "AMBT::encode(), bad call, not implemented");
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to convert TSBK bytes to a 64-bit long value.
|
||||
/// </summary>
|
||||
/// <param name="tsbk"></param>
|
||||
/// <returns></returns>
|
||||
ulong64_t AMBT::tsbkValue(const data::DataHeader dataHeader, const uint8_t* pduUserData)
|
||||
{
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
// combine bytes into ulong64_t (8 byte) value
|
||||
tsbkValue = dataHeader.getAMBTField8();
|
||||
tsbkValue = (tsbkValue << 8) + dataHeader.getAMBTField9();
|
||||
tsbkValue = (tsbkValue << 8) + pduUserData[0U];
|
||||
tsbkValue = (tsbkValue << 8) + pduUserData[1U];
|
||||
tsbkValue = (tsbkValue << 8) + pduUserData[2U];
|
||||
tsbkValue = (tsbkValue << 8) + pduUserData[3U];
|
||||
tsbkValue = (tsbkValue << 8) + pduUserData[4U];
|
||||
tsbkValue = (tsbkValue << 8) + pduUserData[5U];
|
||||
|
||||
return tsbkValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="dataHeader"></param>
|
||||
/// <param name="blocks"></param>
|
||||
/// <param name="pduUserData"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool AMBT::decode(const data::DataHeader dataHeader, const data::DataBlock* blocks, uint8_t* pduUserData)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
if (dataHeader.getFormat() != PDU_FMT_AMBT) {
|
||||
LogError(LOG_P25, "TSBK::decodeMBT(), PDU is not a AMBT PDU");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dataHeader.getBlocksToFollow() == 0U) {
|
||||
LogError(LOG_P25, "TSBK::decodeMBT(), PDU contains no data blocks");
|
||||
return false;
|
||||
}
|
||||
|
||||
m_lco = dataHeader.getAMBTOpcode(); // LCO
|
||||
m_lastBlock = true;
|
||||
m_mfId = dataHeader.getMFId(); // Mfg Id.
|
||||
|
||||
if (dataHeader.getOutbound()) {
|
||||
LogWarning(LOG_P25, "TSBK::decodeMBT(), MBT is an outbound MBT?, mfId = $%02X, lco = $%02X", m_mfId, m_lco);
|
||||
}
|
||||
|
||||
// get PDU block data
|
||||
::memset(pduUserData, 0x00U, P25_PDU_UNCONFIRMED_LENGTH_BYTES * dataHeader.getBlocksToFollow());
|
||||
|
||||
uint32_t dataOffset = 0U;
|
||||
for (uint8_t i = 0; i < dataHeader.getBlocksToFollow(); i++) {
|
||||
uint32_t len = blocks[i].getData(pduUserData + dataOffset);
|
||||
if (len != P25_PDU_UNCONFIRMED_LENGTH_BYTES) {
|
||||
LogError(LOG_P25, "TSBK::decodeMBT(), failed to read PDU data block");
|
||||
return false;
|
||||
}
|
||||
|
||||
dataOffset += P25_PDU_UNCONFIRMED_LENGTH_BYTES;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="pduUserData"></param>
|
||||
void AMBT::encode(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
dataHeader.setFormat(PDU_FMT_AMBT);
|
||||
dataHeader.setMFId(m_mfId);
|
||||
dataHeader.setAckNeeded(false);
|
||||
dataHeader.setOutbound(true);
|
||||
dataHeader.setSAP(PDU_SAP_TRUNK_CTRL);
|
||||
dataHeader.setLLId(m_srcId);
|
||||
dataHeader.setFullMessage(true);
|
||||
dataHeader.setBlocksToFollow(1U);
|
||||
|
||||
dataHeader.setAMBTOpcode(m_lco);
|
||||
|
||||
// generate packet CRC-32 and set data blocks
|
||||
if (dataHeader.getBlocksToFollow() > 1U) {
|
||||
edac::CRC::addCRC32(pduUserData, P25_PDU_UNCONFIRMED_LENGTH_BYTES * dataHeader.getBlocksToFollow());
|
||||
} else {
|
||||
edac::CRC::addCRC32(pduUserData, P25_PDU_UNCONFIRMED_LENGTH_BYTES);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC__AMBT_H__)
|
||||
#define __P25_LC__AMBT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
#include "p25/data/DataHeader.h"
|
||||
#include "p25/data/DataBlock.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Represents link control data for Alternate Trunking packets.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API AMBT : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the AMBT class.</summary>
|
||||
AMBT();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks) = 0;
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData) = 0;
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
protected:
|
||||
/// <summary>Internal helper to convert TSBK bytes to a 64-bit long value.</summary>
|
||||
static ulong64_t tsbkValue(const data::DataHeader dataHeader, const uint8_t* pduUserData);
|
||||
|
||||
/// <summary>Internal helper to decode a trunking signalling block.</summary>
|
||||
bool decode(const data::DataHeader dataHeader, const data::DataBlock* blocks, uint8_t* pduUserData);
|
||||
/// <summary>Internal helper to encode a trunking signalling block.</summary>
|
||||
void encode(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
};
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC__AMBT_H__
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,104 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/IOSP_ACK_RSP.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the IOSP_ACK_RSP class.
|
||||
/// </summary>
|
||||
IOSP_ACK_RSP::IOSP_ACK_RSP() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_IOSP_ACK_RSP;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool IOSP_ACK_RSP::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_aivFlag = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Additional Info. Flag
|
||||
m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void IOSP_ACK_RSP::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = (m_service & 0x3F); // Service Type
|
||||
tsbkValue |= (m_aivFlag) ? 0x80U : 0x00U; // Additional Info. Valid Flag
|
||||
tsbkValue |= (m_extendedAddrFlag) ? 0x40U : 0x00U; // Extended Addressing Flag
|
||||
if (m_aivFlag && m_extendedAddrFlag) {
|
||||
tsbkValue = (tsbkValue << 20) + m_siteData.netId(); // Network ID
|
||||
tsbkValue = (tsbkValue << 12) + m_siteData.sysId(); // System ID
|
||||
}
|
||||
else {
|
||||
tsbkValue = (tsbkValue << 32) + m_dstId; // Target Radio Address
|
||||
}
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__IOSP_ACK_RSP_H__)
|
||||
#define __P25_LC_TSBK__IOSP_ACK_RSP_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements ACK RSP U - Acknowledge Response - Unit (ISP) and
|
||||
// ACK RSP FNE - Acknowledge Response - FNE (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API IOSP_ACK_RSP : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the IOSP_ACK_RSP class.</summary>
|
||||
IOSP_ACK_RSP();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__IOSP_ACK_RSP_H__
|
||||
@ -0,0 +1,93 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/IOSP_CALL_ALRT.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the IOSP_CALL_ALRT class.
|
||||
/// </summary>
|
||||
IOSP_CALL_ALRT::IOSP_CALL_ALRT() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_IOSP_CALL_ALRT;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool IOSP_CALL_ALRT::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void IOSP_CALL_ALRT::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = (tsbkValue << 40) + m_dstId; // Target Radio Address
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__IOSP_CALL_ALRT_H__)
|
||||
#define __P25_LC_TSBK__IOSP_CALL_ALRT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements CALL ALRT REQ - Call Alert Request (ISP) and
|
||||
// CALL ALRT - Call Alert (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API IOSP_CALL_ALRT : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the IOSP_CALL_ALRT class.</summary>
|
||||
IOSP_CALL_ALRT();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__IOSP_CALL_ALRT_H__
|
||||
@ -0,0 +1,111 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/IOSP_EXT_FNCT.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the IOSP_EXT_FNCT class.
|
||||
/// </summary>
|
||||
IOSP_EXT_FNCT::IOSP_EXT_FNCT() : TSBK(),
|
||||
m_extendedFunction(P25_EXT_FNCT_CHECK)
|
||||
{
|
||||
m_lco = TSBK_IOSP_EXT_FNCT;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool IOSP_EXT_FNCT::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_extendedFunction = (uint32_t)((tsbkValue >> 48) & 0xFFFFU); // Extended Function
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Argument
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Target Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void IOSP_EXT_FNCT::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = (tsbkValue << 16) + m_extendedFunction; // Extended Function
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Argument
|
||||
tsbkValue = (tsbkValue << 24) + m_dstId; // Target Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void IOSP_EXT_FNCT::copy(const IOSP_EXT_FNCT& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_extendedFunction = data.m_extendedFunction;
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__IOSP_EXT_FNCT_H__)
|
||||
#define __P25_LC_TSBK__IOSP_EXT_FNCT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements EXT FNCT RSP - Extended Function Response (ISP) and
|
||||
// EXT FNCT CMD - Extended Function Command (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API IOSP_EXT_FNCT : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the IOSP_EXT_FNCT class.</summary>
|
||||
IOSP_EXT_FNCT();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
public:
|
||||
/// <summary>Extended function opcode.</summary>
|
||||
__PROPERTY(uint32_t, extendedFunction, ExtendedFunction);
|
||||
|
||||
__COPY(IOSP_EXT_FNCT);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__IOSP_EXT_FNCT_H__
|
||||
@ -0,0 +1,113 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/IOSP_GRP_AFF.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the IOSP_GRP_AFF class.
|
||||
/// </summary>
|
||||
IOSP_GRP_AFF::IOSP_GRP_AFF() : TSBK(),
|
||||
m_announceGroup(P25_WUID_ALL)
|
||||
{
|
||||
m_lco = TSBK_IOSP_GRP_AFF;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool IOSP_GRP_AFF::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_sysId = (uint32_t)((tsbkValue >> 40) & 0xFFFU); // System ID
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Talkgroup Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void IOSP_GRP_AFF::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = 1U; // Local/Global Affiliation Flag (0 = Local, 1 = Global)
|
||||
tsbkValue = (tsbkValue << 7) + (m_response & 0x3U); // Affiliation Response
|
||||
tsbkValue = (tsbkValue << 16) + (m_announceGroup & 0xFFFFU); // Announcement Group Address
|
||||
tsbkValue = (tsbkValue << 16) + (m_dstId & 0xFFFFU); // Talkgroup Address
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void IOSP_GRP_AFF::copy(const IOSP_GRP_AFF& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_announceGroup = data.m_announceGroup;
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__IOSP_GRP_AFF_H__)
|
||||
#define __P25_LC_TSBK__IOSP_GRP_AFF_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements GRP AFF REQ - Group Affiliation Request (ISP) and
|
||||
// GRP AFF RSP - Group Affiliation Response (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API IOSP_GRP_AFF : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the IOSP_GRP_AFF class.</summary>
|
||||
IOSP_GRP_AFF();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
public:
|
||||
/// <summary>Announcement group.</summary>
|
||||
__PROPERTY(uint32_t, announceGroup, AnnounceGroup);
|
||||
|
||||
__COPY(IOSP_GRP_AFF);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__IOSP_GRP_AFF_H__
|
||||
@ -0,0 +1,104 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/IOSP_GRP_VCH.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the IOSP_GRP_VCH class.
|
||||
/// </summary>
|
||||
IOSP_GRP_VCH::IOSP_GRP_VCH() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_IOSP_GRP_VCH;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool IOSP_GRP_VCH::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_emergency = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Emergency Flag
|
||||
m_encrypted = (((tsbkValue >> 56) & 0xFFU) & 0x40U) == 0x40U; // Encryption Flag
|
||||
m_priority = (((tsbkValue >> 56) & 0xFFU) & 0x07U); // Priority
|
||||
m_grpVchId = ((tsbkValue >> 52) & 0x0FU); // Channel ID
|
||||
m_grpVchNo = ((tsbkValue >> 40) & 0xFFFU); // Channel Number
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void IOSP_GRP_VCH::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue =
|
||||
(m_emergency ? 0x80U : 0x00U) + // Emergency Flag
|
||||
(m_encrypted ? 0x40U : 0x00U) + // Encrypted Flag
|
||||
(m_priority & 0x07U); // Priority
|
||||
tsbkValue = (tsbkValue << 4) + m_siteData.channelId(); // Channel ID
|
||||
tsbkValue = (tsbkValue << 12) + m_grpVchNo; // Channel Number
|
||||
tsbkValue = (tsbkValue << 16) + m_dstId; // Talkgroup Address
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__IOSP_GRP_VCH_H__)
|
||||
#define __P25_LC_TSBK__IOSP_GRP_VCH_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements GRP VCH REQ - Group Voice Channel Request (ISP) and
|
||||
// GRP VCH GRANT - Group Voice Channel Grant (OSP).
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API IOSP_GRP_VCH : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the IOSP_GRP_VCH class.</summary>
|
||||
IOSP_GRP_VCH();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__IOSP_GRP_VCH_H__
|
||||
@ -0,0 +1,111 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/IOSP_MSG_UPDT.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the IOSP_MSG_UPDT class.
|
||||
/// </summary>
|
||||
IOSP_MSG_UPDT::IOSP_MSG_UPDT() : TSBK(),
|
||||
m_messageValue(0U)
|
||||
{
|
||||
m_lco = TSBK_IOSP_MSG_UPDT;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool IOSP_MSG_UPDT::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_messageValue = (uint8_t)((tsbkValue >> 56) & 0xFFU); // Message Value
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void IOSP_MSG_UPDT::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = (tsbkValue << 16) + m_messageValue; // Message Value
|
||||
tsbkValue = (tsbkValue << 24) + m_dstId; // Target Radio Address
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void IOSP_MSG_UPDT::copy(const IOSP_MSG_UPDT& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_messageValue = data.m_messageValue;
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__IOSP_MSG_UPDT_H__)
|
||||
#define __P25_LC_TSBK__IOSP_MSG_UPDT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements MSG UPDT REQ - Message Update Request (ISP) and
|
||||
// MSG UPDT - Message Update (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API IOSP_MSG_UPDT : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the IOSP_MSG_UPDT class.</summary>
|
||||
IOSP_MSG_UPDT();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
public:
|
||||
/// <summary>Status value.</summary>
|
||||
__PROPERTY(uint8_t, messageValue, Message);
|
||||
|
||||
__COPY(IOSP_MSG_UPDT);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__IOSP_MSG_UPDT_H__
|
||||
@ -0,0 +1,112 @@
|
||||
/**
|
||||
* 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) 2022 by Bryan Biedenkapp N2PLL
|
||||
* Copyright (C) 2022 by Jason- UWU - TIME_DATE_ANN & RAD_MON_CMD
|
||||
*
|
||||
* 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 "p25/lc/tsbk/IOSP_RAD_MON.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the IOSP_RAD_MON class.
|
||||
/// </summary>
|
||||
IOSP_RAD_MON::IOSP_RAD_MON() : TSBK(),
|
||||
m_txMult(0U)
|
||||
{
|
||||
m_lco = TSBK_IOSP_RAD_MON;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool IOSP_RAD_MON::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_txMult = (uint8_t)((tsbkValue >> 48) & 0x3U); // TX Multiplier
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void IOSP_RAD_MON::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = (tsbkValue << 48) + (m_txMult & 0x3U); // TX Multiplier
|
||||
tsbkValue = (tsbkValue << 24) + (m_srcId & 0xFFFFFFU); // Source Radio Address
|
||||
tsbkValue = tsbkValue + (m_dstId & 0xFFFFFFU); // Target Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void IOSP_RAD_MON::copy(const IOSP_RAD_MON& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_txMult = data.m_txMult;
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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) 2022 by Bryan Biedenkapp N2PLL
|
||||
* Copyright (C) 2022 by Jason- UWU - TIME_DATE_ANN & RAD_MON_CMD
|
||||
*
|
||||
* 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(__P25_LC_TSBK__IOSP_RAD_MON_H__)
|
||||
#define __P25_LC_TSBK__IOSP_RAD_MON_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements RAD MON REQ - Radio Unit Monitor Request (ISP) and
|
||||
// RAD MON CMD - Radio Monitor Command (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API IOSP_RAD_MON : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the IOSP_RAD_MON class.</summary>
|
||||
IOSP_RAD_MON();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
public:
|
||||
/// <summary>Radio Unit Monitor.</summary>
|
||||
__PROPERTY(uint8_t, txMult, TxMult);
|
||||
|
||||
__COPY(IOSP_RAD_MON);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__IOSP_RAD_MON_H__
|
||||
@ -0,0 +1,111 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/IOSP_STS_UPDT.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the IOSP_STS_UPDT class.
|
||||
/// </summary>
|
||||
IOSP_STS_UPDT::IOSP_STS_UPDT() : TSBK(),
|
||||
m_statusValue(0U)
|
||||
{
|
||||
m_lco = TSBK_IOSP_STS_UPDT;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool IOSP_STS_UPDT::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_statusValue = (uint8_t)((tsbkValue >> 56) & 0xFFU); // Status Value
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void IOSP_STS_UPDT::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = (tsbkValue << 16) + m_statusValue; // Status Value
|
||||
tsbkValue = (tsbkValue << 24) + m_dstId; // Target Radio Address
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void IOSP_STS_UPDT::copy(const IOSP_STS_UPDT& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_statusValue = data.m_statusValue;
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__IOSP_STS_UPDT_H__)
|
||||
#define __P25_LC_TSBK__IOSP_STS_UPDT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements STS UPDT REQ - Status Update Request (ISP) and
|
||||
// STS UPDT - Status Update (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API IOSP_STS_UPDT : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the IOSP_STS_UPDT class.</summary>
|
||||
IOSP_STS_UPDT();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
public:
|
||||
/// <summary>Status value.</summary>
|
||||
__PROPERTY(uint8_t, statusValue, Status);
|
||||
|
||||
__COPY(IOSP_STS_UPDT);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__IOSP_STS_UPDT_H__
|
||||
@ -0,0 +1,101 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/IOSP_UU_ANS.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the IOSP_UU_ANS class.
|
||||
/// </summary>
|
||||
IOSP_UU_ANS::IOSP_UU_ANS() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_IOSP_UU_ANS;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool IOSP_UU_ANS::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_emergency = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Emergency Flag
|
||||
m_encrypted = (((tsbkValue >> 56) & 0xFFU) & 0x40U) == 0x40U; // Encryption Flag
|
||||
m_priority = (((tsbkValue >> 56) & 0xFFU) & 0x07U); // Priority
|
||||
m_response = (uint8_t)((tsbkValue >> 48) & 0xFFU); // Answer Response
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void IOSP_UU_ANS::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue =
|
||||
(m_emergency ? 0x80U : 0x00U) + // Emergency Flag
|
||||
(m_encrypted ? 0x40U : 0x00U) + // Encrypted Flag
|
||||
(m_priority & 0x07U); // Priority
|
||||
tsbkValue = (tsbkValue << 32) + m_dstId; // Target Radio Address
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__IOSP_UU_ANS_H__)
|
||||
#define __P25_LC_TSBK__IOSP_UU_ANS_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements UU ANS RSP - Unit-to-Unit Answer Response (ISP) and
|
||||
// UU ANS REQ - Unit-to-Unit Answer Request (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API IOSP_UU_ANS : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the IOSP_UU_ANS class.</summary>
|
||||
IOSP_UU_ANS();
|
||||
|
||||
/// <summary>Equals operator.</summary>
|
||||
IOSP_UU_ANS& operator=(const IOSP_UU_ANS& data);
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__IOSP_UU_ANS_H__
|
||||
@ -0,0 +1,104 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/IOSP_UU_VCH.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the IOSP_UU_VCH class.
|
||||
/// </summary>
|
||||
IOSP_UU_VCH::IOSP_UU_VCH() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_IOSP_UU_VCH;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool IOSP_UU_VCH::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_emergency = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Emergency Flag
|
||||
m_encrypted = (((tsbkValue >> 56) & 0xFFU) & 0x40U) == 0x40U; // Encryption Flag
|
||||
m_priority = (((tsbkValue >> 56) & 0xFFU) & 0x07U); // Priority
|
||||
m_grpVchId = ((tsbkValue >> 52) & 0x0FU); // Channel ID
|
||||
m_grpVchNo = ((tsbkValue >> 40) & 0xFFFU); // Channel Number
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void IOSP_UU_VCH::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue =
|
||||
(m_emergency ? 0x80U : 0x00U) + // Emergency Flag
|
||||
(m_encrypted ? 0x40U : 0x00U) + // Encrypted Flag
|
||||
(m_priority & 0x07U); // Priority
|
||||
tsbkValue = (tsbkValue << 4) + m_siteData.channelId(); // Channel ID
|
||||
tsbkValue = (tsbkValue << 12) + m_grpVchNo; // Channel Number
|
||||
tsbkValue = (tsbkValue << 24) + m_dstId; // Target Radio Address
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__IOSP_UU_VCH_H__)
|
||||
#define __P25_LC_TSBK__IOSP_UU_VCH_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements UU VCH REQ - Unit-to-Unit Voice Channel Request (ISP) and
|
||||
// UU VCH GRANT - Unit-to-Unit Voice Channel Grant (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API IOSP_UU_VCH : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the IOSP_UU_VCH class.</summary>
|
||||
IOSP_UU_VCH();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__IOSP_UU_VCH_H__
|
||||
@ -0,0 +1,96 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/IOSP_U_REG.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the IOSP_U_REG class.
|
||||
/// </summary>
|
||||
IOSP_U_REG::IOSP_U_REG() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_IOSP_U_REG;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool IOSP_U_REG::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_netId = (uint32_t)((tsbkValue >> 36) & 0xFFFFFU); // Network ID
|
||||
m_sysId = (uint32_t)((tsbkValue >> 24) & 0xFFFU); // System ID
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void IOSP_U_REG::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = (tsbkValue << 2) + (m_response & 0x3U); // Unit Registration Response
|
||||
tsbkValue = (tsbkValue << 12) + m_siteData.sysId(); // System ID
|
||||
tsbkValue = (tsbkValue << 24) + m_dstId; // Source ID
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__IOSP_U_REG_H__)
|
||||
#define __P25_LC_TSBK__IOSP_U_REG_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements U REG REQ - Unit Registration Request (ISP) and
|
||||
// U REG RSP - Unit Registration Response (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API IOSP_U_REG : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the IOSP_U_REG class.</summary>
|
||||
IOSP_U_REG();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__IOSP_U_REG_H__
|
||||
@ -0,0 +1,105 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/ISP_AUTH_FNE_RST.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ISP_AUTH_FNE_RST class.
|
||||
/// </summary>
|
||||
ISP_AUTH_FNE_RST::ISP_AUTH_FNE_RST() : TSBK(),
|
||||
m_authSuccess(false),
|
||||
m_authStandalone(false)
|
||||
{
|
||||
m_lco = TSBK_ISP_AUTH_FNE_RST;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool ISP_AUTH_FNE_RST::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_authSuccess = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Authentication Success Flag
|
||||
m_authStandalone = (((tsbkValue >> 56) & 0xFFU) & 0x01U) == 0x01U; // Authentication Standalone Flag
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void ISP_AUTH_FNE_RST::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void ISP_AUTH_FNE_RST::copy(const ISP_AUTH_FNE_RST& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_authSuccess = data.m_authSuccess;
|
||||
m_authStandalone = data.m_authStandalone;
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__ISP_AUTH_FNE_RST_H__)
|
||||
#define __P25_LC_TSBK__ISP_AUTH_FNE_RST_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements AUTH FNE RST - Authentication FNE Result
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API ISP_AUTH_FNE_RST : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the ISP_AUTH_FNE_RST class.</summary>
|
||||
ISP_AUTH_FNE_RST();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
public:
|
||||
/// <summary>Flag indicating authentication was successful.</summary>
|
||||
__PROPERTY(bool, authSuccess, AuthSuccess);
|
||||
/// <summary>Flag indicating authentication is standalone.</summary>
|
||||
__PROPERTY(bool, authStandalone, AuthStandalone);
|
||||
|
||||
__COPY(ISP_AUTH_FNE_RST);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__ISP_AUTH_FNE_RST_H__
|
||||
@ -0,0 +1,136 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/ISP_AUTH_RESP.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ISP_AUTH_RESP class.
|
||||
/// </summary>
|
||||
ISP_AUTH_RESP::ISP_AUTH_RESP() : TSBK(),
|
||||
m_authStandalone(false),
|
||||
m_authRes(NULL)
|
||||
{
|
||||
m_lco = TSBK_ISP_AUTH_RESP;
|
||||
|
||||
m_authRes = new uint8_t[P25_AUTH_RES_LENGTH_BYTES];
|
||||
::memset(m_authRes, 0x00U, P25_AUTH_RES_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes a instance of ISP_AUTH_RESP class.
|
||||
/// </summary>
|
||||
ISP_AUTH_RESP::~ISP_AUTH_RESP()
|
||||
{
|
||||
if (m_authRes != NULL) {
|
||||
delete[] m_authRes;
|
||||
m_authRes = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool ISP_AUTH_RESP::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_aivFlag = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Additional Info. Flag
|
||||
m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type
|
||||
m_response = (uint8_t)((tsbkValue >> 48) & 0xFFU); // Reason
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void ISP_AUTH_RESP::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
}
|
||||
|
||||
/// <summary>Gets the authentication result.</summary>
|
||||
/// <returns></returns>
|
||||
void ISP_AUTH_RESP::getAuthRes(uint8_t* res) const
|
||||
{
|
||||
assert(res != NULL);
|
||||
|
||||
::memcpy(res, m_authRes, P25_AUTH_RES_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void ISP_AUTH_RESP::copy(const ISP_AUTH_RESP& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_authStandalone = data.m_authStandalone;
|
||||
|
||||
if (m_authRes != NULL) {
|
||||
delete[] m_authRes;
|
||||
}
|
||||
|
||||
m_authRes = new uint8_t[P25_AUTH_RES_LENGTH_BYTES];
|
||||
::memcpy(m_authRes, data.m_authRes, P25_AUTH_RES_LENGTH_BYTES);
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__ISP_AUTH_RESP_H__)
|
||||
#define __P25_LC_TSBK__ISP_AUTH_RESP_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements AUTH RESP - Authentication Response
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API ISP_AUTH_RESP : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the ISP_AUTH_RESP class.</summary>
|
||||
ISP_AUTH_RESP();
|
||||
/// <summary>Finalizes a instance of the ISP_AUTH_RESP class.</summary>
|
||||
~ISP_AUTH_RESP();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
/** Authentication data */
|
||||
/// <summary>Gets the authentication result.</summary>
|
||||
void getAuthRes(uint8_t* res) const;
|
||||
|
||||
public:
|
||||
/// <summary>Flag indicating authentication is standalone.</summary>
|
||||
__PROPERTY(bool, authStandalone, AuthStandalone);
|
||||
|
||||
private:
|
||||
/** Authentication data */
|
||||
uint8_t* m_authRes;
|
||||
|
||||
__COPY(ISP_AUTH_RESP);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__ISP_AUTH_RESP_H__
|
||||
@ -0,0 +1,85 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/ISP_AUTH_SU_DMD.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ISP_AUTH_SU_DMD class.
|
||||
/// </summary>
|
||||
ISP_AUTH_SU_DMD::ISP_AUTH_SU_DMD() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_ISP_AUTH_SU_DMD;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool ISP_AUTH_SU_DMD::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void ISP_AUTH_SU_DMD::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__ISP_AUTH_SU_DMD_H__)
|
||||
#define __P25_LC_TSBK__ISP_AUTH_SU_DMD_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements AUTH SU DMD - Authentication SU Demand
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API ISP_AUTH_SU_DMD : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the ISP_AUTH_SU_DMD class.</summary>
|
||||
ISP_AUTH_SU_DMD();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__ISP_AUTH_SU_DMD_H__
|
||||
@ -0,0 +1,89 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/ISP_CAN_SRV_REQ.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ISP_CAN_SRV_REQ class.
|
||||
/// </summary>
|
||||
ISP_CAN_SRV_REQ::ISP_CAN_SRV_REQ() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_ISP_CAN_SRV_REQ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool ISP_CAN_SRV_REQ::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_aivFlag = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Additional Info. Flag
|
||||
m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type
|
||||
m_response = (uint8_t)((tsbkValue >> 48) & 0xFFU); // Reason
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void ISP_CAN_SRV_REQ::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__ISP_CAN_SRV_REQ_H__)
|
||||
#define __P25_LC_TSBK__ISP_CAN_SRV_REQ_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements CAN SRV REQ - Cancel Service Request
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API ISP_CAN_SRV_REQ : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the ISP_CAN_SRV_REQ class.</summary>
|
||||
ISP_CAN_SRV_REQ();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__ISP_CAN_SRV_REQ_H__
|
||||
@ -0,0 +1,100 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/ISP_EMERG_ALRM_REQ.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ISP_EMERG_ALRM_REQ class.
|
||||
/// </summary>
|
||||
ISP_EMERG_ALRM_REQ::ISP_EMERG_ALRM_REQ() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_ISP_EMERG_ALRM_REQ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool ISP_EMERG_ALRM_REQ::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
/*
|
||||
** bryanb: this is a bit of a hack -- because the EMERG ALRM and DENY have the same
|
||||
** opcode; the following are used by TSBK_OSP_DENY_RSP; best way to check is for m_response > 0
|
||||
*/
|
||||
m_aivFlag = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Additional Info. Flag
|
||||
m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type
|
||||
m_response = (uint8_t)((tsbkValue >> 48) & 0xFFU); // Reason
|
||||
|
||||
if (m_response == 0U) {
|
||||
m_emergency = true;
|
||||
} else {
|
||||
m_emergency = false;
|
||||
}
|
||||
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void ISP_EMERG_ALRM_REQ::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__ISP_EMERG_ALRM_REQ_H__)
|
||||
#define __P25_LC_TSBK__ISP_EMERG_ALRM_REQ_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements EMERG ALRM REQ - Emergency Alarm Request
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API ISP_EMERG_ALRM_REQ : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the ISP_EMERG_ALRM_REQ class.</summary>
|
||||
ISP_EMERG_ALRM_REQ();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__ISP_EMERG_ALRM_REQ_H__
|
||||
@ -0,0 +1,103 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/ISP_GRP_AFF_Q_RSP.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ISP_GRP_AFF_Q_RSP class.
|
||||
/// </summary>
|
||||
ISP_GRP_AFF_Q_RSP::ISP_GRP_AFF_Q_RSP() : TSBK(),
|
||||
m_announceGroup(P25_WUID_ALL)
|
||||
{
|
||||
m_lco = TSBK_ISP_GRP_AFF_Q_RSP;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool ISP_GRP_AFF_Q_RSP::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_announceGroup = (uint32_t)((tsbkValue >> 40) & 0xFFFFU); // Announcement Group Address
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Talkgroup Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void ISP_GRP_AFF_Q_RSP::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void ISP_GRP_AFF_Q_RSP::copy(const ISP_GRP_AFF_Q_RSP& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_announceGroup = data.m_announceGroup;
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__ISP_GRP_AFF_Q_RSP_H__)
|
||||
#define __P25_LC_TSBK__ISP_GRP_AFF_Q_RSP_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements GRP AFF Q RSP - Group Affiliation Query Response
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API ISP_GRP_AFF_Q_RSP : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the ISP_GRP_AFF_Q_RSP class.</summary>
|
||||
ISP_GRP_AFF_Q_RSP();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
public:
|
||||
/// <summary>Announcement group.</summary>
|
||||
__PROPERTY(uint32_t, announceGroup, AnnounceGroup);
|
||||
|
||||
__COPY(ISP_GRP_AFF_Q_RSP);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__ISP_GRP_AFF_Q_RSP_H__
|
||||
@ -0,0 +1,103 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/ISP_LOC_REG_REQ.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ISP_LOC_REG_REQ class.
|
||||
/// </summary>
|
||||
ISP_LOC_REG_REQ::ISP_LOC_REG_REQ() : TSBK(),
|
||||
m_lra(0U)
|
||||
{
|
||||
m_lco = TSBK_ISP_LOC_REG_REQ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool ISP_LOC_REG_REQ::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_lra = (uint8_t)((tsbkValue >> 40) & 0xFFU); // LRA
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Talkgroup Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void ISP_LOC_REG_REQ::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void ISP_LOC_REG_REQ::copy(const ISP_LOC_REG_REQ& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_lra = data.m_lra;
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__ISP_LOC_REG_REQ_H__)
|
||||
#define __P25_LC_TSBK__ISP_LOC_REG_REQ_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements LOC REG REQ - Location Registration Request
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API ISP_LOC_REG_REQ : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the ISP_LOC_REG_REQ class.</summary>
|
||||
ISP_LOC_REG_REQ();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
public:
|
||||
/// <summary>Location registration area.</summary>
|
||||
__PROPERTY(uint8_t, lra, LRA);
|
||||
|
||||
__COPY(ISP_LOC_REG_REQ);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__ISP_LOC_REG_REQ_H__
|
||||
@ -0,0 +1,105 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/ISP_SNDCP_CH_REQ.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ISP_SNDCP_CH_REQ class.
|
||||
/// </summary>
|
||||
ISP_SNDCP_CH_REQ::ISP_SNDCP_CH_REQ() : TSBK(),
|
||||
m_dataServiceOptions(0U),
|
||||
m_dataAccessControl(0U)
|
||||
{
|
||||
m_lco = TSBK_ISP_SNDCP_CH_REQ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool ISP_SNDCP_CH_REQ::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_dataServiceOptions = (uint8_t)((tsbkValue >> 56) & 0xFFU); // Data Service Options
|
||||
m_dataAccessControl = (uint32_t)((tsbkValue >> 40) & 0xFFFFFFFFU); // Data Access Control
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void ISP_SNDCP_CH_REQ::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void ISP_SNDCP_CH_REQ::copy(const ISP_SNDCP_CH_REQ& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_dataServiceOptions = data.m_dataServiceOptions;
|
||||
m_dataAccessControl = data.m_dataAccessControl;
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__ISP_SNDCP_CH_REQ_H__)
|
||||
#define __P25_LC_TSBK__ISP_SNDCP_CH_REQ_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements SNDCP CH REQ - SNDCP Data Channel Request (ISP).
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API ISP_SNDCP_CH_REQ : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the ISP_SNDCP_CH_REQ class.</summary>
|
||||
ISP_SNDCP_CH_REQ();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
public:
|
||||
/// <summary>SNDCP Data Service Options</summary>
|
||||
__PROPERTY(uint8_t, dataServiceOptions, DataServiceOptions);
|
||||
/// <summary>SNDCP Data Access Control</summary>
|
||||
__PROPERTY(uint32_t, dataAccessControl, DataAccessControl);
|
||||
|
||||
__COPY(ISP_SNDCP_CH_REQ);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__ISP_SNDCP_CH_REQ_H__
|
||||
@ -0,0 +1,87 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/ISP_U_DEREG_REQ.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ISP_U_DEREG_REQ class.
|
||||
/// </summary>
|
||||
ISP_U_DEREG_REQ::ISP_U_DEREG_REQ() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_ISP_U_DEREG_REQ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool ISP_U_DEREG_REQ::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_netId = (uint32_t)((tsbkValue >> 36) & 0xFFFFFU); // Network ID
|
||||
m_sysId = (uint32_t)((tsbkValue >> 24) & 0xFFFU); // System ID
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void ISP_U_DEREG_REQ::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__ISP_U_DEREG_REQ_H__)
|
||||
#define __P25_LC_TSBK__ISP_U_DEREG_REQ_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements U DE REG REQ - Unit De-Registration Request
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API ISP_U_DEREG_REQ : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the ISP_U_DEREG_REQ class.</summary>
|
||||
ISP_U_DEREG_REQ();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__ISP_U_DEREG_REQ_H__
|
||||
@ -0,0 +1,91 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_IOSP_ACK_RSP.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_IOSP_ACK_RSP class.
|
||||
/// </summary>
|
||||
MBT_IOSP_ACK_RSP::MBT_IOSP_ACK_RSP() : AMBT()
|
||||
{
|
||||
m_lco = TSBK_IOSP_ACK_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_IOSP_ACK_RSP::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
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::tsbkValue(dataHeader, pduUserData);
|
||||
|
||||
m_aivFlag = false;
|
||||
m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type
|
||||
m_netId = (uint32_t)((tsbkValue >> 36) & 0xFFFFFU); // Network ID
|
||||
m_sysId = (uint32_t)((tsbkValue >> 24) & 0xFFFU); // System ID
|
||||
m_dstId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Target Radio 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_IOSP_ACK_RSP::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_IOSP_ACK_RSP_H__)
|
||||
#define __P25_LC_TSBK__MBT_IOSP_ACK_RSP_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements ACK RSP U - Acknowledge Response - Unit (ISP) and
|
||||
// ACK RSP FNE - Acknowledge Response - FNE (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_IOSP_ACK_RSP : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_IOSP_ACK_RSP class.</summary>
|
||||
MBT_IOSP_ACK_RSP();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_IOSP_ACK_RSP_H__
|
||||
@ -0,0 +1,89 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_IOSP_CALL_ALRT.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_IOSP_CALL_ALRT class.
|
||||
/// </summary>
|
||||
MBT_IOSP_CALL_ALRT::MBT_IOSP_CALL_ALRT() : AMBT()
|
||||
{
|
||||
m_lco = TSBK_IOSP_CALL_ALRT;
|
||||
}
|
||||
|
||||
/// <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_IOSP_CALL_ALRT::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
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::tsbkValue(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 >> 8) & 0xFFFFFFU); // Target Radio 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_IOSP_CALL_ALRT::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_IOSP_CALL_ALRT_H__)
|
||||
#define __P25_LC_TSBK__MBT_IOSP_CALL_ALRT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements CALL ALRT REQ - Call Alert Request (ISP) and
|
||||
// CALL ALRT - Call Alert (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_IOSP_CALL_ALRT : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_IOSP_CALL_ALRT class.</summary>
|
||||
MBT_IOSP_CALL_ALRT();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_IOSP_CALL_ALRT_H__
|
||||
@ -0,0 +1,106 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_IOSP_EXT_FNCT.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_IOSP_EXT_FNCT class.
|
||||
/// </summary>
|
||||
MBT_IOSP_EXT_FNCT::MBT_IOSP_EXT_FNCT() : AMBT(),
|
||||
m_extendedFunction(P25_EXT_FNCT_CHECK)
|
||||
{
|
||||
m_lco = TSBK_IOSP_EXT_FNCT;
|
||||
}
|
||||
|
||||
/// <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_IOSP_EXT_FNCT::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
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::tsbkValue(dataHeader, pduUserData);
|
||||
|
||||
m_netId = (uint32_t)((tsbkValue >> 44) & 0xFFFFFU); // Network ID
|
||||
m_sysId = (uint32_t)((tsbkValue >> 32) & 0xFFFU); // System ID
|
||||
m_extendedFunction = (uint32_t)(((tsbkValue) & 0xFFFFU) << 8) + // Extended Function
|
||||
pduUserData[6U];
|
||||
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_IOSP_EXT_FNCT::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void MBT_IOSP_EXT_FNCT::copy(const MBT_IOSP_EXT_FNCT& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_extendedFunction = data.m_extendedFunction;
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_IOSP_EXT_FNCT_H__)
|
||||
#define __P25_LC_TSBK__MBT_IOSP_EXT_FNCT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements EXT FNCT RSP - Extended Function Response (ISP) and
|
||||
// EXT FNCT CMD - Extended Function Command (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_IOSP_EXT_FNCT : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_IOSP_EXT_FNCT class.</summary>
|
||||
MBT_IOSP_EXT_FNCT();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
|
||||
public:
|
||||
/// <summary>Extended function opcode.</summary>
|
||||
__PROPERTY(uint32_t, extendedFunction, ExtendedFunction);
|
||||
|
||||
__COPY(MBT_IOSP_EXT_FNCT);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_IOSP_EXT_FNCT_H__
|
||||
@ -0,0 +1,89 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_IOSP_GRP_AFF.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_IOSP_GRP_AFF class.
|
||||
/// </summary>
|
||||
MBT_IOSP_GRP_AFF::MBT_IOSP_GRP_AFF() : AMBT()
|
||||
{
|
||||
m_lco = TSBK_IOSP_GRP_AFF;
|
||||
}
|
||||
|
||||
/// <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_IOSP_GRP_AFF::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
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::tsbkValue(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_IOSP_GRP_AFF::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_IOSP_GRP_AFF_H__)
|
||||
#define __P25_LC_TSBK__MBT_IOSP_GRP_AFF_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements GRP AFF REQ - Group Affiliation Request (ISP) and
|
||||
// GRP AFF RSP - Group Affiliation Response (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_IOSP_GRP_AFF : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_IOSP_GRP_AFF class.</summary>
|
||||
MBT_IOSP_GRP_AFF();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_IOSP_GRP_AFF_H__
|
||||
@ -0,0 +1,106 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_IOSP_MSG_UPDT.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_IOSP_MSG_UPDT class.
|
||||
/// </summary>
|
||||
MBT_IOSP_MSG_UPDT::MBT_IOSP_MSG_UPDT() : AMBT(),
|
||||
m_messageValue(0U)
|
||||
{
|
||||
m_lco = TSBK_IOSP_MSG_UPDT;
|
||||
}
|
||||
|
||||
/// <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_IOSP_MSG_UPDT::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
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::tsbkValue(dataHeader, pduUserData);
|
||||
|
||||
m_messageValue = (uint8_t)((tsbkValue >> 48) & 0xFFFFU); // Message Value
|
||||
m_netId = (uint32_t)((tsbkValue >> 28) & 0xFFFFFU); // Network ID
|
||||
m_sysId = (uint32_t)((tsbkValue >> 16) & 0xFFFU); // System ID
|
||||
m_dstId = (uint32_t)(((tsbkValue) & 0xFFFFU) << 8) + pduUserData[6U]; // Target Radio 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_IOSP_MSG_UPDT::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void MBT_IOSP_MSG_UPDT::copy(const MBT_IOSP_MSG_UPDT& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_messageValue = data.m_messageValue;
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_IOSP_MSG_UPDT_H__)
|
||||
#define __P25_LC_TSBK__MBT_IOSP_MSG_UPDT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements MSG UPDT REQ - Message Update Request (ISP) and
|
||||
// MSG UPDT - Message Update (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_IOSP_MSG_UPDT : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_IOSP_MSG_UPDT class.</summary>
|
||||
MBT_IOSP_MSG_UPDT();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
|
||||
public:
|
||||
/// <summary>Message value.</summary>
|
||||
__PROPERTY(uint8_t, messageValue, Message);
|
||||
|
||||
__COPY(MBT_IOSP_MSG_UPDT);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_IOSP_MSG_UPDT_H__
|
||||
@ -0,0 +1,106 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_IOSP_STS_UPDT.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_IOSP_STS_UPDT class.
|
||||
/// </summary>
|
||||
MBT_IOSP_STS_UPDT::MBT_IOSP_STS_UPDT() : AMBT(),
|
||||
m_statusValue(0U)
|
||||
{
|
||||
m_lco = TSBK_IOSP_STS_UPDT;
|
||||
}
|
||||
|
||||
/// <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_IOSP_STS_UPDT::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
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::tsbkValue(dataHeader, pduUserData);
|
||||
|
||||
m_statusValue = (uint8_t)((tsbkValue >> 48) & 0xFFFFU); // Message Value
|
||||
m_netId = (uint32_t)((tsbkValue >> 28) & 0xFFFFFU); // Network ID
|
||||
m_sysId = (uint32_t)((tsbkValue >> 16) & 0xFFFU); // System ID
|
||||
m_dstId = (uint32_t)(((tsbkValue) & 0xFFFFU) << 8) + pduUserData[6U]; // Target Radio 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_IOSP_STS_UPDT::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void MBT_IOSP_STS_UPDT::copy(const MBT_IOSP_STS_UPDT& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_statusValue = data.m_statusValue;
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_IOSP_STS_UPDT_H__)
|
||||
#define __P25_LC_TSBK__MBT_IOSP_STS_UPDT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements STS UPDT REQ - Status Update Request (ISP) and
|
||||
// STS UPDT - Status Update (OSP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_IOSP_STS_UPDT : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_IOSP_STS_UPDT class.</summary>
|
||||
MBT_IOSP_STS_UPDT();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
|
||||
public:
|
||||
/// <summary>Status value.</summary>
|
||||
__PROPERTY(uint8_t, statusValue, Status);
|
||||
|
||||
__COPY(MBT_IOSP_STS_UPDT);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_IOSP_STS_UPDT_H__
|
||||
@ -0,0 +1,184 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_ISP_AUTH_RESP_M.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_ISP_AUTH_RESP_M class.
|
||||
/// </summary>
|
||||
MBT_ISP_AUTH_RESP_M::MBT_ISP_AUTH_RESP_M() : AMBT()
|
||||
{
|
||||
m_lco = TSBK_ISP_AUTH_RESP_M;
|
||||
|
||||
m_authRes = new uint8_t[P25_AUTH_RES_LENGTH_BYTES];
|
||||
::memset(m_authRes, 0x00U, P25_AUTH_RES_LENGTH_BYTES);
|
||||
m_authRC = new uint8_t[P25_AUTH_RAND_CHLNG_LENGTH_BYTES];
|
||||
::memset(m_authRC, 0x00U, P25_AUTH_RAND_CHLNG_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes a instance of MBT_ISP_AUTH_RESP_M class.
|
||||
/// </summary>
|
||||
MBT_ISP_AUTH_RESP_M::~MBT_ISP_AUTH_RESP_M()
|
||||
{
|
||||
if (m_authRes != NULL) {
|
||||
delete[] m_authRes;
|
||||
m_authRes = NULL;
|
||||
}
|
||||
|
||||
if (m_authRC != NULL) {
|
||||
delete[] m_authRC;
|
||||
m_authRC = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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_AUTH_RESP_M::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
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::tsbkValue(dataHeader, pduUserData);
|
||||
|
||||
if (dataHeader.getBlocksToFollow() != 2) {
|
||||
LogError(LOG_P25, "TSBK::decodeMBT(), PDU does not contain the appropriate amount of data blocks");
|
||||
return false;
|
||||
}
|
||||
|
||||
m_netId = (uint32_t)((tsbkValue >> 44) & 0xFFFFFU); // Network ID
|
||||
m_sysId = (uint32_t)((tsbkValue >> 32) & 0xFFFU); // System ID
|
||||
m_srcId = dataHeader.getLLId(); // Source Radio Address
|
||||
|
||||
/** Block 1 */
|
||||
m_authRC[4U] = (uint8_t)pduUserData[5U] & 0xFFU; // Random Challenge b4
|
||||
m_authRC[3U] = (uint8_t)pduUserData[6U] & 0xFFU; // Random Challenge b3
|
||||
m_authRC[2U] = (uint8_t)pduUserData[7U] & 0xFFU; // Random Challenge b2
|
||||
m_authRC[1U] = (uint8_t)pduUserData[8U] & 0xFFU; // Random Challenge b1
|
||||
m_authRC[0U] = (uint8_t)pduUserData[9U] & 0xFFU; // Random Challenge b0
|
||||
m_authRes[3U] = (uint8_t)pduUserData[10U] & 0xFFU; // Result b3
|
||||
m_authRes[2U] = (uint8_t)pduUserData[11U] & 0xFFU; // Result b2
|
||||
|
||||
/** Block 2 */
|
||||
m_authRes[1U] = (uint8_t)pduUserData[12U] & 0xFFU; // Result b1
|
||||
m_authRes[0U] = (uint8_t)pduUserData[13U] & 0xFFU; // Result b0
|
||||
m_authStandalone = ((pduUserData[14U] & 0xFFU) & 0x01U) == 0x01U; // Authentication Standalone Flag
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a alternate trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="dataHeader"></param>
|
||||
/// <param name="pduUserData"></param>
|
||||
void MBT_ISP_AUTH_RESP_M::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/// <summary>Gets the authentication result.</summary>
|
||||
/// <returns></returns>
|
||||
void MBT_ISP_AUTH_RESP_M::getAuthRes(uint8_t* res) const
|
||||
{
|
||||
assert(res != NULL);
|
||||
|
||||
::memcpy(res, m_authRes, P25_AUTH_RES_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
/// <summary>Sets the authentication random challenge.</summary>
|
||||
/// <param name="rc"></param>
|
||||
void MBT_ISP_AUTH_RESP_M::setAuthRC(const uint8_t* rc)
|
||||
{
|
||||
assert(rc != NULL);
|
||||
|
||||
::memcpy(m_authRC, rc, P25_AUTH_RAND_CHLNG_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
/// <summary>Gets the authentication random challenge.</summary>
|
||||
/// <returns></returns>
|
||||
void MBT_ISP_AUTH_RESP_M::getAuthRC(uint8_t* rc) const
|
||||
{
|
||||
assert(rc != NULL);
|
||||
|
||||
::memcpy(rc, m_authRC, P25_AUTH_RAND_CHLNG_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void MBT_ISP_AUTH_RESP_M::copy(const MBT_ISP_AUTH_RESP_M& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_authStandalone = data.m_authStandalone;
|
||||
|
||||
if (m_authRes != NULL) {
|
||||
delete[] m_authRes;
|
||||
}
|
||||
|
||||
m_authRes = new uint8_t[P25_AUTH_RES_LENGTH_BYTES];
|
||||
::memcpy(m_authRes, data.m_authRes, P25_AUTH_RES_LENGTH_BYTES);
|
||||
|
||||
if (m_authRC != NULL) {
|
||||
delete[] m_authRC;
|
||||
}
|
||||
|
||||
m_authRC = new uint8_t[P25_AUTH_RAND_CHLNG_LENGTH_BYTES];
|
||||
::memcpy(m_authRC, data.m_authRC, P25_AUTH_RAND_CHLNG_LENGTH_BYTES);
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_ISP_AUTH_RESP_M_H__)
|
||||
#define __P25_LC_TSBK__MBT_ISP_AUTH_RESP_M_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements AUTH RESP M - Authentication Response Mutual
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_ISP_AUTH_RESP_M : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_ISP_AUTH_RESP_M class.</summary>
|
||||
MBT_ISP_AUTH_RESP_M();
|
||||
/// <summary>Finalizes a instance of the MBT_ISP_AUTH_RESP_M class.</summary>
|
||||
~MBT_ISP_AUTH_RESP_M();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
|
||||
/** Authentication data */
|
||||
/// <summary>Gets the authentication result.</summary>
|
||||
void getAuthRes(uint8_t* res) const;
|
||||
|
||||
/// <summary>Sets the authentication random challenge.</summary>
|
||||
void setAuthRC(const uint8_t* rc);
|
||||
/// <summary>Gets the authentication random challenge.</summary>
|
||||
void getAuthRC(uint8_t* rc) const;
|
||||
|
||||
public:
|
||||
/// <summary>Flag indicating authentication is standalone.</summary>
|
||||
__PROPERTY(bool, authStandalone, AuthStandalone);
|
||||
|
||||
private:
|
||||
/** Authentication data */
|
||||
uint8_t* m_authRes;
|
||||
uint8_t* m_authRC;
|
||||
|
||||
__COPY(MBT_ISP_AUTH_RESP_M);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_ISP_AUTH_RESP_M_H__
|
||||
@ -0,0 +1,88 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_ISP_AUTH_SU_DMD.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_ISP_AUTH_SU_DMD class.
|
||||
/// </summary>
|
||||
MBT_ISP_AUTH_SU_DMD::MBT_ISP_AUTH_SU_DMD() : AMBT()
|
||||
{
|
||||
m_lco = TSBK_IOSP_GRP_AFF;
|
||||
}
|
||||
|
||||
/// <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_AUTH_SU_DMD::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
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::tsbkValue(dataHeader, pduUserData);
|
||||
|
||||
m_netId = (uint32_t)((tsbkValue >> 44) & 0xFFFFFU); // Network ID
|
||||
m_sysId = (uint32_t)((tsbkValue >> 32) & 0xFFFU); // System ID
|
||||
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_AUTH_SU_DMD::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return;
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_ISP_AUTH_SU_DMD_H__)
|
||||
#define __P25_LC_TSBK__MBT_ISP_AUTH_SU_DMD_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements AUTH SU DMD - Authentication SU Demand
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_ISP_AUTH_SU_DMD : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_ISP_AUTH_SU_DMD class.</summary>
|
||||
MBT_ISP_AUTH_SU_DMD();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_ISP_AUTH_SU_DMD_H__
|
||||
@ -0,0 +1,93 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_ISP_CAN_SRV_REQ.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_ISP_CAN_SRV_REQ class.
|
||||
/// </summary>
|
||||
MBT_ISP_CAN_SRV_REQ::MBT_ISP_CAN_SRV_REQ() : AMBT()
|
||||
{
|
||||
m_lco = TSBK_ISP_CAN_SRV_REQ;
|
||||
}
|
||||
|
||||
/// <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_CAN_SRV_REQ::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
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::tsbkValue(dataHeader, pduUserData);
|
||||
|
||||
m_aivFlag = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Additional Info. Flag
|
||||
m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type
|
||||
m_response = (uint8_t)((tsbkValue >> 48) & 0xFFU); // Reason
|
||||
m_netId = (uint32_t)((tsbkValue >> 20) & 0xFFFFFU); // Network ID
|
||||
m_sysId = (uint32_t)((tsbkValue >> 8) & 0xFFFU); // System ID
|
||||
m_dstId = (uint32_t)((((tsbkValue) & 0xFFU) << 16) + // Target Radio Address
|
||||
(pduUserData[6U] << 8) + (pduUserData[7U]));
|
||||
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_CAN_SRV_REQ::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return;
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_ISP_CAN_SRV_REQ_H__)
|
||||
#define __P25_LC_TSBK__MBT_ISP_CAN_SRV_REQ_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements CAN SRV REQ - Cancel Service Request
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_ISP_CAN_SRV_REQ : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_ISP_CAN_SRV_REQ class.</summary>
|
||||
MBT_ISP_CAN_SRV_REQ();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_ISP_CAN_SRV_REQ_H__
|
||||
@ -0,0 +1,133 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_OSP_ADJ_STS_BCAST.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_OSP_ADJ_STS_BCAST class.
|
||||
/// </summary>
|
||||
MBT_OSP_ADJ_STS_BCAST::MBT_OSP_ADJ_STS_BCAST() : AMBT(),
|
||||
m_adjCFVA(P25_CFVA_FAILURE),
|
||||
m_adjRfssId(0U),
|
||||
m_adjSiteId(0U),
|
||||
m_adjChannelId(0U),
|
||||
m_adjChannelNo(0U),
|
||||
m_adjServiceClass(P25_SVC_CLS_INVALID)
|
||||
{
|
||||
m_lco = TSBK_OSP_ADJ_STS_BCAST;
|
||||
}
|
||||
|
||||
/// <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_OSP_ADJ_STS_BCAST::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a alternate trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="dataHeader"></param>
|
||||
/// <param name="pduUserData"></param>
|
||||
void MBT_OSP_ADJ_STS_BCAST::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
if ((m_adjRfssId != 0U) && (m_adjSiteId != 0U) && (m_adjChannelNo != 0U)) {
|
||||
if (m_adjSysId == 0U) {
|
||||
m_adjSysId = m_siteData.sysId();
|
||||
}
|
||||
|
||||
// pack LRA, CFVA and system ID into LLID
|
||||
uint32_t llId = m_siteData.lra(); // Location Registration Area
|
||||
llId = (llId << 8) + m_adjCFVA; // CFVA
|
||||
llId = (llId << 4) + m_siteData.siteId(); // System ID
|
||||
dataHeader.setLLId(llId);
|
||||
|
||||
dataHeader.setAMBTField8(m_adjRfssId); // RF Sub-System ID
|
||||
dataHeader.setAMBTField9(m_adjSiteId); // Site ID
|
||||
|
||||
/** Block 1 */
|
||||
pduUserData[0U] = ((m_adjChannelId & 0x0FU) << 4) + // Transmit Channel ID & Channel Number MSB
|
||||
((m_adjChannelNo >> 8) & 0xFFU);
|
||||
pduUserData[1U] = (m_adjChannelNo >> 0) & 0xFFU; // Transmit Channel Number LSB
|
||||
pduUserData[2U] = ((m_adjChannelId & 0x0FU) << 4) + // Receive Channel ID & Channel Number MSB
|
||||
((m_adjChannelNo >> 8) & 0xFFU);
|
||||
pduUserData[3U] = (m_adjChannelNo >> 0) & 0xFFU; // Receive Channel Number LSB
|
||||
pduUserData[4U] = m_adjServiceClass; // System Service Class
|
||||
pduUserData[5U] = (m_siteData.netId() >> 12) & 0xFFU; // Network ID (b19-12)
|
||||
pduUserData[6U] = (m_siteData.netId() >> 4) & 0xFFU; // Network ID (b11-b4)
|
||||
pduUserData[7U] = (m_siteData.netId() & 0x0FU) << 4; // Network ID (b3-b0)
|
||||
}
|
||||
else {
|
||||
LogError(LOG_P25, "TSBK::encodeMBT(), invalid values for OSP_ADJ_STS_BCAST, adjRfssId = $%02X, adjSiteId = $%02X, adjChannelId = %u, adjChannelNo = $%02X, adjSvcClass = $%02X",
|
||||
m_adjRfssId, m_adjSiteId, m_adjChannelId, m_adjChannelNo, m_adjServiceClass);
|
||||
return; // blatently ignore creating this TSBK
|
||||
}
|
||||
|
||||
AMBT::encode(dataHeader, pduUserData);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void MBT_OSP_ADJ_STS_BCAST::copy(const MBT_OSP_ADJ_STS_BCAST& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_adjCFVA = data.m_adjCFVA;
|
||||
m_adjRfssId = data.m_adjRfssId;
|
||||
m_adjSiteId = data.m_adjSiteId;
|
||||
m_adjChannelId = data.m_adjChannelId;
|
||||
m_adjChannelNo = data.m_adjChannelNo;
|
||||
m_adjServiceClass = data.m_adjServiceClass;
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_OSP_ADJ_STS_BCAST_H__)
|
||||
#define __P25_LC_TSBK__MBT_OSP_ADJ_STS_BCAST_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements ADJ STS BCAST - Adjacent Site Status Broadcast
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_OSP_ADJ_STS_BCAST : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_OSP_ADJ_STS_BCAST class.</summary>
|
||||
MBT_OSP_ADJ_STS_BCAST();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
|
||||
public:
|
||||
/** Adjacent Site Data */
|
||||
/// <summary>Adjacent site CFVA flags.</summary>
|
||||
__PROPERTY(uint8_t, adjCFVA, AdjSiteCFVA);
|
||||
/// <summary>Adjacent site system ID.</summary>
|
||||
__PROPERTY(uint32_t, adjSysId, AdjSiteSysId);
|
||||
/// <summary>Adjacent site RFSS ID.</summary>
|
||||
__PROPERTY(uint8_t, adjRfssId, AdjSiteRFSSId);
|
||||
/// <summary>Adjacent site ID.</summary>
|
||||
__PROPERTY(uint8_t, adjSiteId, AdjSiteId);
|
||||
/// <summary>Adjacent site channel ID.</summary>
|
||||
__PROPERTY(uint8_t, adjChannelId, AdjSiteChnId);
|
||||
/// <summary>Adjacent site channel number.</summary>
|
||||
__PROPERTY(uint32_t, adjChannelNo, AdjSiteChnNo);
|
||||
/// <summary>Adjacent site service class.</summary>
|
||||
__PROPERTY(uint8_t, adjServiceClass, AdjSiteSvcClass);
|
||||
|
||||
__COPY(MBT_OSP_ADJ_STS_BCAST);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_OSP_ADJ_STS_BCAST_H__
|
||||
@ -0,0 +1,188 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_OSP_AUTH_DMD.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_OSP_AUTH_DMD class.
|
||||
/// </summary>
|
||||
MBT_OSP_AUTH_DMD::MBT_OSP_AUTH_DMD() : AMBT()
|
||||
{
|
||||
m_lco = TSBK_OSP_AUTH_DMD;
|
||||
|
||||
m_authRS = new uint8_t[P25_AUTH_RAND_SEED_LENGTH_BYTES];
|
||||
::memset(m_authRS, 0x00U, P25_AUTH_RAND_SEED_LENGTH_BYTES);
|
||||
m_authRC = new uint8_t[P25_AUTH_RAND_CHLNG_LENGTH_BYTES];
|
||||
::memset(m_authRC, 0x00U, P25_AUTH_RAND_CHLNG_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes a instance of MBT_OSP_AUTH_DMD class.
|
||||
/// </summary>
|
||||
MBT_OSP_AUTH_DMD::~MBT_OSP_AUTH_DMD()
|
||||
{
|
||||
if (m_authRS != NULL) {
|
||||
delete[] m_authRS;
|
||||
m_authRS = NULL;
|
||||
}
|
||||
|
||||
if (m_authRC != NULL) {
|
||||
delete[] m_authRC;
|
||||
m_authRC = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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_OSP_AUTH_DMD::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a alternate trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="dataHeader"></param>
|
||||
/// <param name="pduUserData"></param>
|
||||
void MBT_OSP_AUTH_DMD::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
dataHeader.setBlocksToFollow(2U);
|
||||
|
||||
dataHeader.setAMBTField8((m_netId >> 12) & 0xFFU); // Network ID (b19-12)
|
||||
dataHeader.setAMBTField9((m_netId >> 4) & 0xFFU); // Network ID (b11-b4)
|
||||
|
||||
/** Block 1 */
|
||||
pduUserData[0U] = ((m_netId & 0x0FU) << 4) + ((m_sysId >> 8) & 0xFFU); // Network ID (b3-b0) + System ID (b11-b8)
|
||||
pduUserData[1U] = (m_sysId & 0xFFU); // System ID (b7-b0)
|
||||
|
||||
__SET_UINT16(m_dstId, pduUserData, 2U); // Target Radio Address
|
||||
|
||||
pduUserData[5U] = m_authRS[9U]; // Random Salt b9
|
||||
pduUserData[6U] = m_authRS[8U]; // Random Salt b8
|
||||
pduUserData[7U] = m_authRS[7U]; // Random Salt b7
|
||||
pduUserData[8U] = m_authRS[6U]; // Random Salt b6
|
||||
pduUserData[9U] = m_authRS[5U]; // Random Salt b5
|
||||
pduUserData[10U] = m_authRS[4U]; // Random Salt b4
|
||||
pduUserData[11U] = m_authRS[3U]; // Random Salt b3
|
||||
|
||||
/** Block 2 */
|
||||
pduUserData[12U] = m_authRS[2U]; // Random Salt b2
|
||||
pduUserData[13U] = m_authRS[1U]; // Random Salt b1
|
||||
pduUserData[14U] = m_authRS[0U]; // Random Salt b0
|
||||
pduUserData[15U] = m_authRC[4U]; // Random Challenge b4
|
||||
pduUserData[16U] = m_authRC[3U]; // Random Challenge b3
|
||||
pduUserData[17U] = m_authRC[2U]; // Random Challenge b2
|
||||
pduUserData[18U] = m_authRC[1U]; // Random Challenge b1
|
||||
pduUserData[19U] = m_authRC[0U]; // Random Challenge b0
|
||||
|
||||
AMBT::encode(dataHeader, pduUserData);
|
||||
}
|
||||
|
||||
/// <summary>Sets the authentication random seed.</summary>
|
||||
/// <param name="mi"></param>
|
||||
void MBT_OSP_AUTH_DMD::setAuthRS(const uint8_t* rs)
|
||||
{
|
||||
assert(rs != NULL);
|
||||
|
||||
::memcpy(m_authRS, rs, P25_AUTH_RAND_SEED_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
/// <summary>Gets the authentication random seed.</summary>
|
||||
/// <returns></returns>
|
||||
void MBT_OSP_AUTH_DMD::getAuthRS(uint8_t* rs) const
|
||||
{
|
||||
assert(rs != NULL);
|
||||
|
||||
::memcpy(rs, m_authRS, P25_AUTH_RAND_SEED_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
/// <summary>Sets the authentication random challenge.</summary>
|
||||
/// <param name="rc"></param>
|
||||
void MBT_OSP_AUTH_DMD::setAuthRC(const uint8_t* rc)
|
||||
{
|
||||
assert(rc != NULL);
|
||||
|
||||
::memcpy(m_authRC, rc, P25_AUTH_RAND_CHLNG_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
/// <summary>Gets the authentication random challenge.</summary>
|
||||
/// <returns></returns>
|
||||
void MBT_OSP_AUTH_DMD::getAuthRC(uint8_t* rc) const
|
||||
{
|
||||
assert(rc != NULL);
|
||||
|
||||
::memcpy(rc, m_authRC, P25_AUTH_RAND_CHLNG_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void MBT_OSP_AUTH_DMD::copy(const MBT_OSP_AUTH_DMD& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
if (m_authRS != NULL) {
|
||||
delete[] m_authRS;
|
||||
}
|
||||
|
||||
m_authRS = new uint8_t[P25_AUTH_RAND_SEED_LENGTH_BYTES];
|
||||
::memcpy(m_authRS, data.m_authRS, P25_AUTH_RAND_SEED_LENGTH_BYTES);
|
||||
|
||||
if (m_authRC != NULL) {
|
||||
delete[] m_authRC;
|
||||
}
|
||||
|
||||
m_authRC = new uint8_t[P25_AUTH_RAND_CHLNG_LENGTH_BYTES];
|
||||
::memcpy(m_authRC, data.m_authRC, P25_AUTH_RAND_CHLNG_LENGTH_BYTES);
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_OSP_AUTH_DMD_H__)
|
||||
#define __P25_LC_TSBK__MBT_OSP_AUTH_DMD_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements AUTH DMD - Authentication Demand
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_OSP_AUTH_DMD : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_OSP_AUTH_DMD class.</summary>
|
||||
MBT_OSP_AUTH_DMD();
|
||||
/// <summary>Finalizes a instance of the MBT_OSP_AUTH_DMD class.</summary>
|
||||
~MBT_OSP_AUTH_DMD();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
|
||||
/// <summary>Sets the authentication random seed.</summary>
|
||||
void setAuthRS(const uint8_t* rs);
|
||||
/// <summary>Gets the authentication random seed.</summary>
|
||||
void getAuthRS(uint8_t* rs) const;
|
||||
|
||||
/// <summary>Sets the authentication random challenge.</summary>
|
||||
void setAuthRC(const uint8_t* rc);
|
||||
/// <summary>Gets the authentication random challenge.</summary>
|
||||
void getAuthRC(uint8_t* rc) const;
|
||||
|
||||
private:
|
||||
/** Authentication data */
|
||||
uint8_t* m_authRS;
|
||||
uint8_t* m_authRC;
|
||||
|
||||
__COPY(MBT_OSP_AUTH_DMD);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_OSP_AUTH_DMD_H__
|
||||
@ -0,0 +1,92 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_OSP_NET_STS_BCAST.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_OSP_NET_STS_BCAST class.
|
||||
/// </summary>
|
||||
MBT_OSP_NET_STS_BCAST::MBT_OSP_NET_STS_BCAST() : AMBT()
|
||||
{
|
||||
m_lco = TSBK_OSP_NET_STS_BCAST;
|
||||
}
|
||||
|
||||
/// <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_OSP_NET_STS_BCAST::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a alternate trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="dataHeader"></param>
|
||||
/// <param name="pduUserData"></param>
|
||||
void MBT_OSP_NET_STS_BCAST::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
// pack LRA and system ID into LLID
|
||||
uint32_t llId = m_siteData.lra(); // Location Registration Area
|
||||
llId = (llId << 12) + m_siteData.siteId(); // System ID
|
||||
dataHeader.setLLId(llId);
|
||||
|
||||
/** Block 1 */
|
||||
pduUserData[0U] = (m_siteData.netId() >> 12) & 0xFFU; // Network ID (b19-12)
|
||||
pduUserData[1U] = (m_siteData.netId() >> 4) & 0xFFU; // Network ID (b11-b4)
|
||||
pduUserData[2U] = (m_siteData.netId() & 0x0FU) << 4; // Network ID (b3-b0)
|
||||
pduUserData[3U] = ((m_siteData.channelId() & 0x0FU) << 4) + // Transmit Channel ID & Channel Number MSB
|
||||
((m_siteData.channelNo() >> 8) & 0xFFU);
|
||||
pduUserData[4U] = (m_siteData.channelNo() >> 0) & 0xFFU; // Transmit Channel Number LSB
|
||||
pduUserData[5U] = ((m_siteData.channelId() & 0x0FU) << 4) + // Receive Channel ID & Channel Number MSB
|
||||
((m_siteData.channelNo() >> 8) & 0xFFU);
|
||||
pduUserData[6U] = (m_siteData.channelNo() >> 0) & 0xFFU; // Receive Channel Number LSB
|
||||
pduUserData[7U] = m_siteData.serviceClass(); // System Service Class
|
||||
|
||||
AMBT::encode(dataHeader, pduUserData);
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_OSP_NET_STS_BCAST_H__)
|
||||
#define __P25_LC_TSBK__MBT_OSP_NET_STS_BCAST_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements NET STS BCAST - Network Status Broadcast
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_OSP_NET_STS_BCAST : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_OSP_NET_STS_BCAST class.</summary>
|
||||
MBT_OSP_NET_STS_BCAST();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_OSP_NET_STS_BCAST_H__
|
||||
@ -0,0 +1,94 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/MBT_OSP_RFSS_STS_BCAST.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the MBT_OSP_RFSS_STS_BCAST class.
|
||||
/// </summary>
|
||||
MBT_OSP_RFSS_STS_BCAST::MBT_OSP_RFSS_STS_BCAST() : AMBT()
|
||||
{
|
||||
m_lco = TSBK_OSP_RFSS_STS_BCAST;
|
||||
}
|
||||
|
||||
/// <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_OSP_RFSS_STS_BCAST::decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks)
|
||||
{
|
||||
assert(blocks != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a alternate trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="dataHeader"></param>
|
||||
/// <param name="pduUserData"></param>
|
||||
void MBT_OSP_RFSS_STS_BCAST::encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData)
|
||||
{
|
||||
assert(pduUserData != NULL);
|
||||
|
||||
// pack LRA and system ID into LLID
|
||||
uint32_t llId = m_siteData.lra(); // Location Registration Area
|
||||
llId = (llId << 12) + m_siteData.siteId(); // System ID
|
||||
if (m_siteData.netActive()) {
|
||||
llId |= 0x1000U; // Network Active Flag
|
||||
}
|
||||
dataHeader.setLLId(llId);
|
||||
|
||||
/** Block 1 */
|
||||
pduUserData[0U] = (m_siteData.rfssId()) & 0xFFU; // RF Sub-System ID
|
||||
pduUserData[1U] = (m_siteData.siteId()) & 0xFFU; // Site ID
|
||||
pduUserData[2U] = ((m_siteData.channelId() & 0x0FU) << 4) + // Transmit Channel ID & Channel Number MSB
|
||||
((m_siteData.channelNo() >> 8) & 0xFFU);
|
||||
pduUserData[3U] = (m_siteData.channelNo() >> 0) & 0xFFU; // Transmit Channel Number LSB
|
||||
pduUserData[4U] = ((m_siteData.channelId() & 0x0FU) << 4) + // Receive Channel ID & Channel Number MSB
|
||||
((m_siteData.channelNo() >> 8) & 0xFFU);
|
||||
pduUserData[5U] = (m_siteData.channelNo() >> 0) & 0xFFU; // Receive Channel Number LSB
|
||||
pduUserData[6U] = m_siteData.serviceClass(); // System Service Class
|
||||
|
||||
AMBT::encode(dataHeader, pduUserData);
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__MBT_OSP_RFSS_STS_BCAST_H__)
|
||||
#define __P25_LC_TSBK__MBT_OSP_RFSS_STS_BCAST_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/AMBT.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements RFSS STS BCAST - RFSS Status Broadcast
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API MBT_OSP_RFSS_STS_BCAST : public AMBT {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the MBT_OSP_RFSS_STS_BCAST class.</summary>
|
||||
MBT_OSP_RFSS_STS_BCAST();
|
||||
|
||||
/// <summary>Decode a alternate trunking signalling block.</summary>
|
||||
virtual bool decodeMBT(const data::DataHeader dataHeader, const data::DataBlock* blocks);
|
||||
/// <summary>Encode a alternate trunking signalling block.</summary>
|
||||
virtual void encodeMBT(data::DataHeader& dataHeader, uint8_t* pduUserData);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__MBT_OSP_RFSS_STS_BCAST_H__
|
||||
@ -0,0 +1,130 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/OSP_ADJ_STS_BCAST.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the OSP_ADJ_STS_BCAST class.
|
||||
/// </summary>
|
||||
OSP_ADJ_STS_BCAST::OSP_ADJ_STS_BCAST() : TSBK(),
|
||||
m_adjCFVA(P25_CFVA_FAILURE),
|
||||
m_adjRfssId(0U),
|
||||
m_adjSiteId(0U),
|
||||
m_adjChannelId(0U),
|
||||
m_adjChannelNo(0U),
|
||||
m_adjServiceClass(P25_SVC_CLS_INVALID)
|
||||
{
|
||||
m_lco = TSBK_OSP_ADJ_STS_BCAST;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool OSP_ADJ_STS_BCAST::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_adjSysId = (uint32_t)((tsbkValue >> 40) & 0xFFFU); // Site System ID
|
||||
m_adjRfssId = (uint8_t)((tsbkValue >> 32) & 0xFFU); // Site RFSS ID
|
||||
m_adjSiteId = (uint8_t)((tsbkValue >> 24) & 0xFFU); // Site ID
|
||||
m_adjChannelId = (uint8_t)((tsbkValue >> 20) & 0xFU); // Site Channel ID
|
||||
m_adjChannelNo = (uint32_t)((tsbkValue >> 8) & 0xFFFU); // Site Channel Number
|
||||
m_adjServiceClass = (uint8_t)(tsbkValue & 0xFFU); // Site Service Class
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void OSP_ADJ_STS_BCAST::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = m_siteData.lra(); // Location Registration Area
|
||||
tsbkValue = (tsbkValue << 4) +
|
||||
(m_siteData.netActive()) ? P25_CFVA_NETWORK : 0U; // CFVA
|
||||
tsbkValue = (tsbkValue << 12) + m_siteData.sysId(); // System ID
|
||||
tsbkValue = (tsbkValue << 8) + m_siteData.rfssId(); // RF Sub-System ID
|
||||
tsbkValue = (tsbkValue << 8) + m_siteData.siteId(); // Site ID
|
||||
tsbkValue = (tsbkValue << 4) + m_siteData.channelId(); // Channel ID
|
||||
tsbkValue = (tsbkValue << 12) + m_siteData.channelNo(); // Channel Number
|
||||
tsbkValue = (tsbkValue << 8) + m_siteData.serviceClass(); // System Service Class
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void OSP_ADJ_STS_BCAST::copy(const OSP_ADJ_STS_BCAST& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
m_adjCFVA = data.m_adjCFVA;
|
||||
m_adjRfssId = data.m_adjRfssId;
|
||||
m_adjSiteId = data.m_adjSiteId;
|
||||
m_adjChannelId = data.m_adjChannelId;
|
||||
m_adjChannelNo = data.m_adjChannelNo;
|
||||
m_adjServiceClass = data.m_adjServiceClass;
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__OSP_ADJ_STS_BCAST_H__)
|
||||
#define __P25_LC_TSBK__OSP_ADJ_STS_BCAST_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements ADJ STS BCAST - Adjacent Site Status Broadcast.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API OSP_ADJ_STS_BCAST : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the OSP_ADJ_STS_BCAST class.</summary>
|
||||
OSP_ADJ_STS_BCAST();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
public:
|
||||
/** Adjacent Site Data */
|
||||
/// <summary>Adjacent site CFVA flags.</summary>
|
||||
__PROPERTY(uint8_t, adjCFVA, AdjSiteCFVA);
|
||||
/// <summary>Adjacent site system ID.</summary>
|
||||
__PROPERTY(uint32_t, adjSysId, AdjSiteSysId);
|
||||
/// <summary>Adjacent site RFSS ID.</summary>
|
||||
__PROPERTY(uint8_t, adjRfssId, AdjSiteRFSSId);
|
||||
/// <summary>Adjacent site ID.</summary>
|
||||
__PROPERTY(uint8_t, adjSiteId, AdjSiteId);
|
||||
/// <summary>Adjacent site channel ID.</summary>
|
||||
__PROPERTY(uint8_t, adjChannelId, AdjSiteChnId);
|
||||
/// <summary>Adjacent site channel number.</summary>
|
||||
__PROPERTY(uint32_t, adjChannelNo, AdjSiteChnNo);
|
||||
/// <summary>Adjacent site service class.</summary>
|
||||
__PROPERTY(uint8_t, adjServiceClass, AdjSiteSvcClass);
|
||||
|
||||
__COPY(OSP_ADJ_STS_BCAST);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__OSP_ADJ_STS_BCAST_H__
|
||||
@ -0,0 +1,135 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/OSP_AUTH_FNE_RESP.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the OSP_AUTH_FNE_RESP class.
|
||||
/// </summary>
|
||||
OSP_AUTH_FNE_RESP::OSP_AUTH_FNE_RESP() : TSBK(),
|
||||
m_authRes(NULL)
|
||||
{
|
||||
m_lco = TSBK_OSP_AUTH_FNE_RESP;
|
||||
|
||||
m_authRes = new uint8_t[P25_AUTH_RES_LENGTH_BYTES];
|
||||
::memset(m_authRes, 0x00U, P25_AUTH_RES_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes a instance of OSP_AUTH_FNE_RESP class.
|
||||
/// </summary>
|
||||
OSP_AUTH_FNE_RESP::~OSP_AUTH_FNE_RESP()
|
||||
{
|
||||
if (m_authRes != NULL) {
|
||||
delete[] m_authRes;
|
||||
m_authRes = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool OSP_AUTH_FNE_RESP::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void OSP_AUTH_FNE_RESP::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = (tsbkValue << 8) + m_authRes[3U]; // Result b3
|
||||
tsbkValue = (tsbkValue << 8) + m_authRes[2U]; // Result b2
|
||||
tsbkValue = (tsbkValue << 8) + m_authRes[1U]; // Result b1
|
||||
tsbkValue = (tsbkValue << 8) + m_authRes[0U]; // Result b0
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
|
||||
/// <summary>Sets the authentication result.</summary>
|
||||
/// <param name="mi"></param>
|
||||
void OSP_AUTH_FNE_RESP::setAuthRes(const uint8_t* res)
|
||||
{
|
||||
assert(res != NULL);
|
||||
|
||||
if (m_authRes != NULL) {
|
||||
delete[] m_authRes;
|
||||
}
|
||||
|
||||
m_authRes = new uint8_t[P25_AUTH_RES_LENGTH_BYTES];
|
||||
::memcpy(m_authRes, res, P25_AUTH_RES_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Private Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Internal helper to copy the the class.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
void OSP_AUTH_FNE_RESP::copy(const OSP_AUTH_FNE_RESP& data)
|
||||
{
|
||||
TSBK::copy(data);
|
||||
|
||||
if (m_authRes != NULL) {
|
||||
delete[] m_authRes;
|
||||
}
|
||||
|
||||
m_authRes = new uint8_t[P25_AUTH_RES_LENGTH_BYTES];
|
||||
::memcpy(m_authRes, data.m_authRes, P25_AUTH_RES_LENGTH_BYTES);
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__OSP_AUTH_FNE_RESP_H__)
|
||||
#define __P25_LC_TSBK__OSP_AUTH_FNE_RESP_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements AUTH FNE RESP - Authentication FNE Response
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API OSP_AUTH_FNE_RESP : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the OSP_AUTH_FNE_RESP class.</summary>
|
||||
OSP_AUTH_FNE_RESP();
|
||||
/// <summary>Finalizes a instance of the OSP_AUTH_FNE_RESP class.</summary>
|
||||
~OSP_AUTH_FNE_RESP();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
|
||||
/** Authentication data */
|
||||
/// <summary>Sets the authentication result.</summary>
|
||||
void setAuthRes(const uint8_t* res);
|
||||
|
||||
private:
|
||||
/** Authentication data */
|
||||
uint8_t* m_authRes;
|
||||
|
||||
__COPY(OSP_AUTH_FNE_RESP);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__OSP_AUTH_FNE_RESP_H__
|
||||
@ -0,0 +1,114 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/OSP_DENY_RSP.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the OSP_DENY_RSP class.
|
||||
/// </summary>
|
||||
OSP_DENY_RSP::OSP_DENY_RSP() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_OSP_DENY_RSP;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool OSP_DENY_RSP::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_aivFlag = (((tsbkValue >> 56) & 0xFFU) & 0x80U) == 0x80U; // Additional Info. Flag
|
||||
m_service = (uint8_t)((tsbkValue >> 56) & 0x3FU); // Service Type
|
||||
m_response = (uint8_t)((tsbkValue >> 48) & 0xFFU); // Reason
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void OSP_DENY_RSP::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
if (m_response == 0U) {
|
||||
LogError(LOG_P25, "TSBK::encode(), invalid values for TSBK_OSP_DENY_RSP, reason = %u", m_response);
|
||||
return; // blatently ignore creating this TSBK
|
||||
}
|
||||
|
||||
tsbkValue = (m_aivFlag) ? 0x80U : 0x00U; // Additional Info Flag
|
||||
tsbkValue = (tsbkValue << 6) + m_service; // Service Type
|
||||
tsbkValue = (tsbkValue << 8) + m_response; // Deny/Queue Reason
|
||||
|
||||
if (m_group) {
|
||||
// group deny/queue
|
||||
tsbkValue = (tsbkValue << 8) + 0U; // Call Options
|
||||
tsbkValue = (tsbkValue << 16) + m_dstId; // Talkgroup Address
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
}
|
||||
else {
|
||||
// private/individual deny/queue
|
||||
tsbkValue = (tsbkValue << 24) + m_dstId; // Target Radio Address
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
}
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__OSP_DENY_RSP_H__)
|
||||
#define __P25_LC_TSBK__OSP_DENY_RSP_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements DENY RSP - Queued Response
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API OSP_DENY_RSP : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the OSP_DENY_RSP class.</summary>
|
||||
OSP_DENY_RSP();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__OSP_DENY_RSP_H__
|
||||
@ -0,0 +1,90 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/OSP_DVM_GIT_HASH.h"
|
||||
#include "HostMain.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the OSP_DVM_GIT_HASH class.
|
||||
/// </summary>
|
||||
OSP_DVM_GIT_HASH::OSP_DVM_GIT_HASH() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_OSP_DVM_GIT_HASH;
|
||||
m_mfId = P25_MFG_DVM;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool OSP_DVM_GIT_HASH::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void OSP_DVM_GIT_HASH::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = g_gitHashBytes[0]; // ...
|
||||
tsbkValue = (tsbkValue << 8) + (g_gitHashBytes[1U]); // ...
|
||||
tsbkValue = (tsbkValue << 8) + (g_gitHashBytes[2U]); // ...
|
||||
tsbkValue = (tsbkValue << 8) + (g_gitHashBytes[3U]); // ...
|
||||
tsbkValue = (tsbkValue << 16) + 0U;
|
||||
tsbkValue = (tsbkValue << 4) + m_siteData.channelId(); // Channel ID
|
||||
tsbkValue = (tsbkValue << 12) + m_siteData.channelNo(); // Channel Number
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__OSP_DVM_GIT_HASH_H__)
|
||||
#define __P25_LC_TSBK__OSP_DVM_GIT_HASH_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements DVM GIT Hash Identification
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API OSP_DVM_GIT_HASH : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the OSP_DVM_GIT_HASH class.</summary>
|
||||
OSP_DVM_GIT_HASH();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__OSP_DVM_GIT_HASH_H__
|
||||
@ -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) 2022 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 "p25/lc/tsbk/OSP_DVM_LC_CALL_TERM.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the OSP_DVM_LC_CALL_TERM class.
|
||||
/// </summary>
|
||||
OSP_DVM_LC_CALL_TERM::OSP_DVM_LC_CALL_TERM() : TSBK()
|
||||
{
|
||||
m_lco = LC_CALL_TERM;
|
||||
m_mfId = P25_MFG_DVM;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool OSP_DVM_LC_CALL_TERM::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
uint8_t tsbk[P25_TSBK_LENGTH_BYTES + 1U];
|
||||
::memset(tsbk, 0x00U, P25_TSBK_LENGTH_BYTES);
|
||||
|
||||
bool ret = TSBK::decode(data, tsbk, rawTSBK);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
ulong64_t tsbkValue = TSBK::tsbkValue(tsbk);
|
||||
|
||||
m_grpVchId = ((tsbkValue >> 52) & 0x0FU); // Channel ID
|
||||
m_grpVchNo = ((tsbkValue >> 40) & 0xFFFU); // Channel Number
|
||||
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFU); // Target Radio Address
|
||||
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Source Radio Address
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void OSP_DVM_LC_CALL_TERM::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = (tsbkValue << 4) + m_siteData.channelId(); // Channel ID
|
||||
tsbkValue = (tsbkValue << 12) + m_grpVchNo; // Channel Number
|
||||
tsbkValue = (tsbkValue << 16) + m_dstId; // Talkgroup Address
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__OSP_LC_CALL_TERM_H__)
|
||||
#define __P25_LC_TSBK__OSP_LC_CALL_TERM_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements CALL TERM - Call Termination or Cancellation
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API OSP_DVM_LC_CALL_TERM : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the OSP_DVM_LC_CALL_TERM class.</summary>
|
||||
OSP_DVM_LC_CALL_TERM();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__OSP_LC_CALL_TERM_H__
|
||||
@ -0,0 +1,83 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/OSP_GRP_AFF_Q.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the OSP_GRP_AFF_Q class.
|
||||
/// </summary>
|
||||
OSP_GRP_AFF_Q::OSP_GRP_AFF_Q() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_OSP_GRP_AFF_Q;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool OSP_GRP_AFF_Q::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void OSP_GRP_AFF_Q::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = (tsbkValue << 24) + m_dstId; // Target Radio Address
|
||||
tsbkValue = (tsbkValue << 24) + m_srcId; // Source Radio Address
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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) 2022 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(__P25_LC_TSBK__OSP_GRP_AFF_Q_H__)
|
||||
#define __P25_LC_TSBK__OSP_GRP_AFF_Q_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "p25/lc/TSBK.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace lc
|
||||
{
|
||||
namespace tsbk
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// Implements GRP AFF Q - Group Affiliation Query
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class HOST_SW_API OSP_GRP_AFF_Q : public TSBK {
|
||||
public:
|
||||
/// <summary>Initializes a new instance of the OSP_GRP_AFF_Q class.</summary>
|
||||
OSP_GRP_AFF_Q();
|
||||
|
||||
/// <summary>Decode a trunking signalling block.</summary>
|
||||
virtual bool decode(const uint8_t* data, bool rawTSBK = false);
|
||||
/// <summary>Encode a trunking signalling block.</summary>
|
||||
virtual void encode(uint8_t* data, bool rawTSBK = false, bool noTrellis = false);
|
||||
};
|
||||
} // namespace tsbk
|
||||
} // namespace lc
|
||||
} // namespace p25
|
||||
|
||||
#endif // __P25_LC_TSBK__OSP_GRP_AFF_Q_H__
|
||||
@ -0,0 +1,85 @@
|
||||
/**
|
||||
* 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) 2022 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 "p25/lc/tsbk/OSP_GRP_VCH_GRANT_UPD.h"
|
||||
#include "Log.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace p25::lc::tsbk;
|
||||
using namespace p25::lc;
|
||||
using namespace p25;
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public Class Members
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the OSP_GRP_VCH_GRANT_UPD class.
|
||||
/// </summary>
|
||||
OSP_GRP_VCH_GRANT_UPD::OSP_GRP_VCH_GRANT_UPD() : TSBK()
|
||||
{
|
||||
m_lco = TSBK_OSP_GRP_VCH_GRANT_UPD;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <returns>True, if TSBK was decoded, otherwise false.</returns>
|
||||
bool OSP_GRP_VCH_GRANT_UPD::decode(const uint8_t* data, bool rawTSBK)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
/* stub */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode a trunking signalling block.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="rawTSBK"></param>
|
||||
/// <param name="noTrellis"></param>
|
||||
void OSP_GRP_VCH_GRANT_UPD::encode(uint8_t* data, bool rawTSBK, bool noTrellis)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
ulong64_t tsbkValue = 0U;
|
||||
|
||||
tsbkValue = m_siteData.channelId(); // Channel ID
|
||||
tsbkValue = (tsbkValue << 12) + m_grpVchNo; // Channel Number
|
||||
tsbkValue = (tsbkValue << 16) + m_dstId; // Talkgroup Address
|
||||
tsbkValue = (tsbkValue << 32) + 0;
|
||||
|
||||
uint8_t* tsbk = TSBK::tsbkValue(tsbkValue);
|
||||
TSBK::encode(data, tsbk, rawTSBK, noTrellis);
|
||||
delete[] tsbk;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue