add support to transmit LC_FAILSOFT during conventional fallback (an option, no one uses yet...);

pull/39/head
Bryan Biedenkapp 3 years ago
parent 0c40b2b254
commit 7cb639027d

@ -567,7 +567,8 @@ bool Control::processFrame(uint8_t* data, uint32_t len)
}
break;
}
if (!m_dedicatedControl)
if (!m_dedicatedControl || m_trunk->m_convFallback)
ret = m_voice->process(data, len);
else {
if (m_voiceOnControl && m_affiliations.isChBusy(m_siteData.channelNo())) {

@ -285,6 +285,9 @@ namespace p25
const uint8_t LC_NET_STS_BCAST = 0x24U; // NET STS BCAST - Network Status Broadcast
const uint8_t LC_CONV_FALLBACK = 0x2AU; // CONV FALLBACK - Conventional Fallback
// LDUx/TDULC Motorola Link Control Opcode(s)
const uint8_t LC_FAILSOFT = 0x02U; // FAILSOFT - Failsoft
// TSBK ISP/OSP Shared Opcode(s)
const uint8_t TSBK_IOSP_GRP_VCH = 0x00U; // GRP VCH REQ - Group Voice Channel Request (ISP), GRP VCH GRANT - Group Voice Channel Grant (OSP)
const uint8_t TSBK_IOSP_UU_VCH = 0x04U; // UU VCH REQ - Unit-to-Unit Voice Channel Request (ISP), UU VCH GRANT - Unit-to-Unit Voice Channel Grant (OSP)

@ -0,0 +1,80 @@
/**
* Digital Voice Modem - Host Software
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* @package DVM / Host Software
*
*/
/*
* Copyright (C) 2023 by Bryan Biedenkapp N2PLL
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "Defines.h"
#include "p25/lc/tdulc/LC_FAILSOFT.h"
#include "Log.h"
#include "Utils.h"
using namespace p25::lc::tdulc;
using namespace p25::lc;
using namespace p25;
#include <cassert>
#include <cmath>
// ---------------------------------------------------------------------------
// Public Class Members
// ---------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the LC_FAILSOFT class.
/// </summary>
LC_FAILSOFT::LC_FAILSOFT() : TDULC()
{
m_lco = p25::LC_FAILSOFT;
m_mfId = p25::P25_MFG_MOT;
}
/// <summary>
/// Decode a terminator data unit w/ link control.
/// </summary>
/// <param name="data"></param>
/// <returns>True, if TDULC was decoded, otherwise false.</returns>
bool LC_FAILSOFT::decode(const uint8_t* data)
{
assert(data != NULL);
/* stub */
return true;
}
/// <summary>
/// Encode a terminator data unit w/ link control.
/// </summary>
/// <param name="data"></param>
void LC_FAILSOFT::encode(uint8_t* data)
{
assert(data != NULL);
ulong64_t rsValue = 0U;
rsValue = m_mfId;
rsValue = (rsValue << 56);
std::unique_ptr<uint8_t[]> rs = TDULC::fromValue(rsValue);
TDULC::encode(data, rs.get());
}

@ -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) 2023 by Bryan Biedenkapp N2PLL
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(__P25_LC_TSBK__LC_FAILSOFT_H__)
#define __P25_LC_TSBK__LC_FAILSOFT_H__
#include "Defines.h"
#include "p25/lc/TDULC.h"
namespace p25
{
namespace lc
{
namespace tdulc
{
// ---------------------------------------------------------------------------
// Class Declaration
// Implements FAILSOFT - Failsoft
// ---------------------------------------------------------------------------
class HOST_SW_API LC_FAILSOFT : public TDULC {
public:
/// <summary>Initializes a new instance of the LC_FAILSOFT class.</summary>
LC_FAILSOFT();
/// <summary>Decode a terminator data unit w/ link control.</summary>
bool decode(const uint8_t* data);
/// <summary>Encode a terminator data unit w/ link control.</summary>
void encode(uint8_t* data);
};
} // namespace tdulc
} // namespace lc
} // namespace p25
#endif // __P25_LC_TSBK__LC_FAILSOFT_H__

@ -7,7 +7,7 @@
*
*/
/*
* Copyright (C) 2022 by Bryan Biedenkapp N2PLL
* Copyright (C) 2023 by Bryan Biedenkapp N2PLL
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -42,6 +42,8 @@
#include "p25/lc/tdulc/LC_SYS_SRV_BCAST.h"
#include "p25/lc/tdulc/LC_TEL_INT_VCH_USER.h"
#include "p25/lc/tdulc/LC_FAILSOFT.h"
namespace p25
{
namespace lc

@ -1316,10 +1316,9 @@ void Trunk::writeRF_ControlData(uint8_t frameCnt, uint8_t n, bool adjSS)
if (m_convFallback) {
bool fallbackTx = (frameCnt % 253U) == 0U;
if (fallbackTx && n == 7U) {
if (fallbackTx && n == 8U) {
if (m_convFallbackPacketDelay >= CONV_FALLBACK_PACKET_DELAY) {
std::unique_ptr<lc::tdulc::LC_CONV_FALLBACK> lc = new_unique(lc::tdulc::LC_CONV_FALLBACK);
for (uint8_t i = 0U; i < 3U; i++) {
writeRF_TDULC(lc.get(), true);
}
@ -1329,6 +1328,12 @@ void Trunk::writeRF_ControlData(uint8_t frameCnt, uint8_t n, bool adjSS)
m_convFallbackPacketDelay++;
}
}
else {
if (n == 8U) {
std::unique_ptr<lc::tdulc::LC_FAILSOFT> lc = new_unique(lc::tdulc::LC_FAILSOFT);
writeRF_TDULC(lc.get(), true);
}
}
return;
}

Loading…
Cancel
Save

Powered by TurnKey Linux.