fix long standing dvmhost shutdown bug (object cleanup wasn't occuring due to bad state change handling); refactor FSC packet data classes; remove FSCResponse and FSCConnectResponse (these were ill conceived due to bad interpretation of TIA-102 specifications); correct FSCACK not properly decoding response user data after packet data; refactor the way the FSC message factory createMessage() function created instances of FSC packets; refactor how opening and closing the FSC port is handled; better implement the FSC state machine; correct bad response to an FSC_CONNECT (due to incorrect understanding of TIA-102 specifications);
parent
ff0a5c57c7
commit
da3a2a1869
@ -1,62 +0,0 @@
|
||||
// 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) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
#include "common/p25/dfsi/frames/fsc/FSCConnectResponse.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 FSCConnectResponse class. */
|
||||
|
||||
FSCConnectResponse::FSCConnectResponse() : FSCResponse(),
|
||||
m_vcBasePort(0U)
|
||||
{
|
||||
/* stub */
|
||||
}
|
||||
|
||||
/* Initializes a instance of the FSCConnectResponse class. */
|
||||
|
||||
FSCConnectResponse::FSCConnectResponse(const uint8_t* data) : FSCResponse(data),
|
||||
m_vcBasePort(0U)
|
||||
{
|
||||
FSCConnectResponse::decode(data);
|
||||
}
|
||||
|
||||
/* Decode a FSC connect frame. */
|
||||
|
||||
bool FSCConnectResponse::decode(const uint8_t* data)
|
||||
{
|
||||
assert(data != nullptr);
|
||||
FSCResponse::decode(data);
|
||||
|
||||
m_vcBasePort = __GET_UINT16B(data, 1U); // Voice Conveyance RTP Port
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Encode a FSC connect frame. */
|
||||
|
||||
void FSCConnectResponse::encode(uint8_t* data)
|
||||
{
|
||||
assert(data != nullptr);
|
||||
FSCResponse::encode(data);
|
||||
|
||||
__SET_UINT16B(m_vcBasePort, data, 1U); // Voice Conveyance RTP Port
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
// 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) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file FSCConnectResponse.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCConnectResponse.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_CONNECT_RESPONSE_H__)
|
||||
#define __FSC_CONNECT_RESPONSE_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/FSCResponse.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace frames
|
||||
{
|
||||
namespace fsc
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements the FSC Connect Response Message.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCConnectResponse : public FSCResponse {
|
||||
public:
|
||||
static const uint8_t LENGTH = 3;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCConnectResponse class.
|
||||
*/
|
||||
FSCConnectResponse();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCConnectResponse class.
|
||||
* @param data Buffer to containing FSCConnectResponse to decode.
|
||||
*/
|
||||
FSCConnectResponse(const uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a FSC connect response frame.
|
||||
* @param[in] data Buffer to containing FSCConnectResponse to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data) override;
|
||||
/**
|
||||
* @brief Encode a FSC connect response frame.
|
||||
* @param[out] data Buffer to encode a FSCConnectResponse.
|
||||
*/
|
||||
void encode(uint8_t* data) override;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Voice Conveyance RTP Port.
|
||||
*/
|
||||
__PROPERTY(uint16_t, vcBasePort, VCBasePort);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_CONNECT_RESPONSE_H__
|
||||
@ -1,60 +0,0 @@
|
||||
// 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) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
#include "common/p25/dfsi/frames/fsc/FSCResponse.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 FSCResponse class. */
|
||||
|
||||
FSCResponse::FSCResponse() :
|
||||
m_version(1U)
|
||||
{
|
||||
/* stub */
|
||||
}
|
||||
|
||||
/* Initializes a instance of the FSCResponse class. */
|
||||
|
||||
FSCResponse::FSCResponse(const uint8_t* data) :
|
||||
m_version(1U)
|
||||
{
|
||||
decode(data);
|
||||
}
|
||||
|
||||
/* Decode a FSC message frame. */
|
||||
|
||||
bool FSCResponse::decode(const uint8_t* data)
|
||||
{
|
||||
assert(data != nullptr);
|
||||
|
||||
m_version = data[0U]; // Response Version
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Encode a FSC message frame. */
|
||||
|
||||
void FSCResponse::encode(uint8_t* data)
|
||||
{
|
||||
assert(data != nullptr);
|
||||
|
||||
data[0U] = m_version; // Response Version
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
// 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) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file FSCResponse.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCResponse.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_RESPONSE_H__)
|
||||
#define __FSC_RESPONSE_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "common/p25/dfsi/frames/FrameDefines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace frames
|
||||
{
|
||||
namespace fsc
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Base class FSC response messages derive from.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCResponse {
|
||||
public:
|
||||
static const uint8_t LENGTH = 1;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCResponse class.
|
||||
*/
|
||||
FSCResponse();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCResponse class.
|
||||
* @param data Buffer to containing FSCResponse to decode.
|
||||
*/
|
||||
FSCResponse(const uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a FSC message frame.
|
||||
* @param[in] data Buffer to containing FSCResponse to decode.
|
||||
*/
|
||||
virtual bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a FSC message frame.
|
||||
* @param[out] data Buffer to encode a FSCResponse.
|
||||
*/
|
||||
virtual void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Response Version.
|
||||
*/
|
||||
__PROTECTED_READONLY_PROPERTY(uint8_t, version, Version);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_RESPONSE_H__
|
||||
Loading…
Reference in new issue