add FSCSelChannel message decoding (not that we need it);

82-dvmbridge---implement-notch-filter-for-2175hz-trc-guard-tone
Bryan Biedenkapp 1 year ago
parent 164d2b6c87
commit 406943d75f

@ -35,5 +35,6 @@
#include "common/p25/dfsi/frames/fsc/FSCReportSelModes.h"
#include "common/p25/dfsi/frames/fsc/FSCDisconnect.h"
#include "common/p25/dfsi/frames/fsc/FSCHeartbeat.h"
#include "common/p25/dfsi/frames/fsc/FSCSelChannel.h"
#endif // __DFSI_FRAMES_H__

@ -86,14 +86,13 @@ std::unique_ptr<FSCMessage> FSCMessage::createMessage(const uint8_t* data)
case FSCMessageType::FSC_REPORT_SEL_MODES:
message = new FSCReportSelModes();
break;
case FSCMessageType::FSC_SEL_CHAN:
message = new FSCSelChannel();
break;
case FSCMessageType::FSC_DISCONNECT:
message = new FSCDisconnect();
break;
case FSCMessageType::FSC_SEL_CHAN:
message = new FSCMessage();
break;
default:
LogError(LOG_P25, "FSCMessage::createMessage(), unknown message value, messageId = $%02X", messageId);
break;

@ -0,0 +1,57 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Digital Voice Modem - Common Library
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright (C) 2025 Bryan Biedenkapp, N2PLL
*
*/
#include "common/p25/dfsi/frames/fsc/FSCSelChannel.h"
#include "common/p25/dfsi/DFSIDefines.h"
#include "common/Utils.h"
#include "common/Log.h"
#include <cassert>
#include <cstring>
using namespace p25::dfsi;
using namespace p25::dfsi::frames;
using namespace p25::dfsi::frames::fsc;
// ---------------------------------------------------------------------------
// Public Class Members
// ---------------------------------------------------------------------------
/* Initializes a instance of the FSCSelChannel class. */
FSCSelChannel::FSCSelChannel() : FSCMessage(),
m_rxChan(1U),
m_txChan(1U)
{
m_messageId = FSCMessageType::FSC_SEL_CHAN;
}
/* Decode a FSC select channel frame. */
bool FSCSelChannel::decode(const uint8_t* data)
{
assert(data != nullptr);
FSCMessage::decode(data);
m_rxChan = data[3U]; // Receive Channel
m_txChan = data[4U]; // Transmit Channel
return true;
}
/* Encode a FSC select channel frame. */
void FSCSelChannel::encode(uint8_t* data)
{
assert(data != nullptr);
FSCMessage::encode(data);
data[3U] = m_rxChan; // Receive Channel
data[4U] = m_txChan; // Transmit Channel
}

@ -0,0 +1,77 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Digital Voice Modem - Common Library
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright (C) 2025 Bryan Biedenkapp, N2PLL
*
*/
/**
* @file FSCReportSelModes.h
* @ingroup dfsi_fsc_frames
* @file FSCReportSelModes.cpp
* @ingroup dfsi_fsc_frames
*/
#if !defined(__FSC_SEL_CHANNEL_H__)
#define __FSC_SEL_CHANNEL_H__
#include "Defines.h"
#include "common/Defines.h"
#include "common/Log.h"
#include "common/Utils.h"
#include "common/p25/dfsi/frames/FrameDefines.h"
#include "common/p25/dfsi/frames/fsc/FSCMessage.h"
namespace p25
{
namespace dfsi
{
namespace frames
{
namespace fsc
{
// ---------------------------------------------------------------------------
// Class Declaration
// ---------------------------------------------------------------------------
/**
* @brief Implements the FSC Select Channel Message.
* @ingroup dfsi_fsc_frames
*/
class HOST_SW_API FSCSelChannel : public FSCMessage {
public:
static const uint8_t LENGTH = 3U;
/**
* @brief Initializes a copy instance of the FSCSelChannel class.
*/
FSCSelChannel();
/**
* @brief Decode a FSC select channel frame.
* @param[in] data Buffer to containing FSCSelChannel to decode.
*/
bool decode(const uint8_t* data) override;
/**
* @brief Encode a FSC select channel frame.
* @param[out] data Buffer to encode a FSCSelChannel.
*/
void encode(uint8_t* data) override;
public:
/**
* @brief Receive Channel Number.
*/
__PROPERTY(uint8_t, rxChan, RxChan);
/**
* @brief Transmit Channel Number.
*/
__PROPERTY(uint8_t, txChan, TxChan);
};
} // namespace fsc
} // namespace frames
} // namespace dfsi
} // namespace p25
#endif // __FSC_SEL_CHANNEL_H__
Loading…
Cancel
Save

Powered by TurnKey Linux.