parent
fb0bb665eb
commit
e0ea19b350
@ -0,0 +1,106 @@
|
||||
// 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 BlockHeader.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file BlockHeader.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__BLOCK_HEADER_H__)
|
||||
#define __BLOCK_HEADER_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
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a DFSI block header packet.
|
||||
* \code{.unparsed}
|
||||
* Compact Form
|
||||
* Byte 0
|
||||
* Bit 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
* |E| BT |
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
*
|
||||
* Verbose Form
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* |E| BT | TSO | BL |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API BlockHeader {
|
||||
public:
|
||||
static const uint8_t LENGTH = 1;
|
||||
static const uint8_t VERBOSE_LENGTH = 4;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the BlockHeader class.
|
||||
*/
|
||||
BlockHeader();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the BlockHeader class.
|
||||
* @param data Buffer to containing BlockHeader to decode.
|
||||
* @param verbose Flag indicating verbose form of BlockHeader.
|
||||
*/
|
||||
BlockHeader(uint8_t* data, bool verbose = false);
|
||||
|
||||
/**
|
||||
* @brief Decode a block header frame.
|
||||
* @param[in] data Buffer to containing BlockHeader to decode.
|
||||
* @param verbose Flag indicating verbose form of BlockHeader.
|
||||
*/
|
||||
bool decode(const uint8_t* data, bool verbose = false);
|
||||
/**
|
||||
* @brief Encode a block header frame.
|
||||
* @param[out] data Buffer to encode a BlockHeader.
|
||||
* @param verbose Flag indicating verbose form of BlockHeader.
|
||||
*/
|
||||
void encode(uint8_t *data, bool verbose = false);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Payload type.
|
||||
* This simple boolean marks this header as either IANA standard, or profile specific.
|
||||
*/
|
||||
__PROPERTY(bool, payloadType, PayloadType);
|
||||
/**
|
||||
* @brief Block type.
|
||||
*/
|
||||
__PROPERTY(BlockType::E, blockType, BlockType);
|
||||
/**
|
||||
* @brief Timestamp Offset.
|
||||
*/
|
||||
__PROPERTY(uint16_t, timestampOffset, TimestampOffset);
|
||||
/**
|
||||
* @brief Block length.
|
||||
*/
|
||||
__PROPERTY(uint16_t, blockLength, BlockLength);
|
||||
};
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __BLOCK_HEADER_H__
|
||||
@ -0,0 +1,89 @@
|
||||
// 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 ControlOctet.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file ControlOctet.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__CONTROL_OCTET_H__)
|
||||
#define __CONTROL_OCTET_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
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a DFSI control octet packet.
|
||||
* \code{.unparsed}
|
||||
* Byte 0
|
||||
* Bit 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
* |S|C| BHC |
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API ControlOctet {
|
||||
public:
|
||||
static const uint8_t LENGTH = 1;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the ControlOctet class.
|
||||
*/
|
||||
ControlOctet();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the ControlOctet class.
|
||||
* @param data Buffer to containing ControlOctet to decode.
|
||||
*/
|
||||
ControlOctet(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a control octet frame.
|
||||
* @param[in] data Buffer to containing ControlOctet to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a control octet frame.
|
||||
* @param[out] data Buffer to encode a ControlOctet.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(bool, signal, Signal);
|
||||
/**
|
||||
* @brief Indicates a compact (1) or verbose (0) block header.
|
||||
*/
|
||||
__PROPERTY(bool, compact, Compact);
|
||||
/**
|
||||
* @brief Number of block headers following this control octet.
|
||||
*/
|
||||
__PROPERTY(uint8_t, blockHeaderCnt, BlockHeaderCnt);
|
||||
};
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __CONTROL_OCTET_H__
|
||||
@ -0,0 +1,145 @@
|
||||
// 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 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @defgroup dfsi_frames DFSI Data Frames
|
||||
* @brief Implementation for the DFSI data frames.
|
||||
* @ingroup dfsi
|
||||
*
|
||||
* @defgroup dfsi_fsc_frames DFSI Control Frames
|
||||
* @brief Implementation for the DFSI control frames.
|
||||
* @ingroup dfsi_frames
|
||||
*
|
||||
* @file FrameDefines.h
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__FRAME_DEFINES_H__)
|
||||
#define __FRAME_DEFINES_H__
|
||||
|
||||
#include "common/Defines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace frames
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Constants
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @addtogroup dfsi_frames
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @brief FSC Control Service Message.*/
|
||||
namespace FSCMessageType {
|
||||
/** @brief FSC Control Service Message.*/
|
||||
enum E : uint8_t {
|
||||
FSC_CONNECT = 0, //! Establish connection with FSS.
|
||||
FSC_HEARTBEAT = 1, //! Heartbeat/Connectivity Maintenance.
|
||||
FSC_ACK = 2, //! Control Service Ack.
|
||||
|
||||
FSC_DISCONNECT = 9, //! Detach Control Service.
|
||||
|
||||
FSC_INVALID = 127, //! Invalid Control Message.
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief FSC ACK/NAK Codes. */
|
||||
namespace FSCAckResponseCode {
|
||||
/** @brief FSC ACK/NAK Codes. */
|
||||
enum E : uint8_t {
|
||||
CONTROL_ACK = 0, //! Acknowledgement.
|
||||
CONTROL_NAK = 1, //! Unspecified Negative Acknowledgement.
|
||||
CONTROL_NAK_CONNECTED = 2, //! Server is connected to some other host.
|
||||
CONTROL_NAK_M_UNSUPP = 3, //! Unsupported Manufactuerer Message.
|
||||
CONTROL_NAK_V_UNSUPP = 4, //! Unsupported Message Version.
|
||||
CONTROL_NAK_F_UNSUPP = 5, //! Unsupported Function.
|
||||
CONTROL_NAK_PARMS = 6, //! Bad / Unsupported Command Parameters.
|
||||
CONTROL_NAK_BUSY = 7 //! FSS is currently busy with a function.
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief DFSI Block Types */
|
||||
namespace BlockType {
|
||||
/** @brief DFSI Block Types */
|
||||
enum E : uint8_t {
|
||||
FULL_RATE_VOICE = 0, //! Full Rate Voice
|
||||
|
||||
VOICE_HEADER_P1 = 6, //! Voice Header 1
|
||||
VOICE_HEADER_P2 = 7, //! Voice Header 2
|
||||
|
||||
START_OF_STREAM = 9, //! Start of Stream
|
||||
END_OF_STREAM = 10, //! End of Stream
|
||||
|
||||
UNDEFINED = 127 //! Undefined
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief RT/RT Flag */
|
||||
namespace RTFlag {
|
||||
/** @brief RT/RT Flag */
|
||||
enum E : uint8_t {
|
||||
ENABLED = 0x02U, //! RT/RT Enabled
|
||||
DISABLED = 0x04U //! RT/RT Disabled
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief Start/Stop Flag */
|
||||
namespace StartStopFlag {
|
||||
/** @brief Start/Stop Flag */
|
||||
enum E : uint8_t {
|
||||
START = 0x0CU, //! Start
|
||||
STOP = 0x25U //! Stop
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief V.24 Data Stream Type */
|
||||
namespace StreamTypeFlag {
|
||||
/** @brief V.24 Data Stream Type */
|
||||
enum E : uint8_t {
|
||||
VOICE = 0x0BU //! Voice
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief RSSI Data Validity */
|
||||
namespace RssiValidityFlag {
|
||||
/** @brief RSSI Data Validity */
|
||||
enum E : uint8_t {
|
||||
INVALID = 0x00U, //! Invalid
|
||||
VALID = 0x1A //! Valid
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief V.24 Data Source */
|
||||
namespace SourceFlag {
|
||||
/** @brief V.24 Data Source */
|
||||
enum E : uint8_t {
|
||||
DIU = 0x00U, //! DIU
|
||||
QUANTAR = 0x02U //! Quantar
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief */
|
||||
namespace ICWFlag {
|
||||
/** @brief */
|
||||
enum E : uint8_t {
|
||||
DIU = 0x00U, //! DIU
|
||||
QUANTAR = 0x1B //! Quantar
|
||||
};
|
||||
}
|
||||
/** @} */
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FRAME_DEFINES_H__
|
||||
@ -0,0 +1,38 @@
|
||||
// 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 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
#if !defined(__DFSI_FRAMES_H__)
|
||||
#define __DFSI_FRAMES_H__
|
||||
|
||||
#include "Defines.h"
|
||||
|
||||
// TIA
|
||||
#include "common/p25/dfsi/frames/StartOfStream.h"
|
||||
#include "common/p25/dfsi/frames/ControlOctet.h"
|
||||
#include "common/p25/dfsi/frames/BlockHeader.h"
|
||||
#include "common/p25/dfsi/frames/FullRateVoice.h"
|
||||
|
||||
// "The" Manufacturer
|
||||
#include "common/p25/dfsi/frames/MotFullRateVoice.h"
|
||||
#include "common/p25/dfsi/frames/MotStartOfStream.h"
|
||||
#include "common/p25/dfsi/frames/MotStartVoiceFrame.h"
|
||||
#include "common/p25/dfsi/frames/MotVoiceHeader1.h"
|
||||
#include "common/p25/dfsi/frames/MotVoiceHeader2.h"
|
||||
|
||||
// FSC
|
||||
#include "common/p25/dfsi/frames/fsc/FSCMessage.h"
|
||||
#include "common/p25/dfsi/frames/fsc/FSCResponse.h"
|
||||
#include "common/p25/dfsi/frames/fsc/FSCACK.h"
|
||||
#include "common/p25/dfsi/frames/fsc/FSCConnect.h"
|
||||
#include "common/p25/dfsi/frames/fsc/FSCConnectResponse.h"
|
||||
#include "common/p25/dfsi/frames/fsc/FSCDisconnect.h"
|
||||
#include "common/p25/dfsi/frames/fsc/FSCHeartbeat.h"
|
||||
|
||||
#endif // __DFSI_FRAMES_H__
|
||||
@ -0,0 +1,259 @@
|
||||
// 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 FullRateVoice.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file FullRateVoice.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__FULL_RATE_VOICE_H__)
|
||||
#define __FULL_RATE_VOICE_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/p25/dfsi/DFSIDefines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "common/p25/dfsi/frames/FrameDefines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace frames
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 full rate voice packet.
|
||||
* \code{.unparsed}
|
||||
* CAI Frames 1, 2, 10 and 11.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | U0(b11-0) | U1(b11-0) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U2(b10-0) | U3(b11-0) | U4(b10-3) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U4 | U5(b10-0) | U6(b10-0) | U7(b6-0) |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B |
|
||||
* | | | | |4| | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 3 - 8.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | U0(b11-0) | U1(b11-0) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U2(b10-0) | U3(b11-0) | U4(b10-3) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U4 | U5(b10-0) | U6(b10-0) | U7(b6-0) |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | LC0,4,8 | LC1,5,9 | LC2, |
|
||||
* | | | | |4| | | | | | 6,10 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | | LC3,7,11 |R| Status |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 12 - 17.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | U0(b11-0) | U1(b11-0) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U2(b10-0) | U3(b11-0) | U4(b10-3) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U4 | U5(b10-0) | U6(b10-0) | U7(b6-0) |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | ES0,4,8 | ES1,5,9 | ES2, |
|
||||
* | | | | |4| | | | | | 6,10 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | | ES3,7,11 |R| Status |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 9 and 10.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | U0(b11-0) | U1(b11-0) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U2(b10-0) | U3(b11-0) | U4(b10-3) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U4 | U5(b10-0) | U6(b10-0) | U7(b6-0) |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | LSD0,2 | LSD1,3 |
|
||||
* | | | | |4| | | | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Rsvd |Si |Sj |
|
||||
* +=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* Because the TIA.102-BAHA spec represents the "message vectors" as
|
||||
* 16-bit units (U0 - U7) this makes understanding the layout of the
|
||||
* buffer ... difficult for the 8-bit aligned minded. The following is
|
||||
* the layout with 8-bit aligned IMBE blocks instead of message vectors:
|
||||
*
|
||||
* CAI Frames 1, 2, 10 and 11.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | IMBE 1 | IMBE 2 | IMBE 3 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 4 | IMBE 5 | IMBE 6 | IMBE 7 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 8 | IMBE 9 | IMBE 10 | IMBE 11 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B |
|
||||
* | | | | |4| | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 3 - 8.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | IMBE 1 | IMBE 2 | IMBE 3 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 4 | IMBE 5 | IMBE 6 | IMBE 7 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 8 | IMBE 9 | IMBE 10 | IMBE 11 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | Link Ctrl | Link Ctrl |
|
||||
* | | | | |4| | | | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Link Ctrl |R| Status |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 12 - 17.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | IMBE 1 | IMBE 2 | IMBE 3 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 4 | IMBE 5 | IMBE 6 | IMBE 7 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 8 | IMBE 9 | IMBE 10 | IMBE 11 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | Enc Sync | Enc Sync |
|
||||
* | | | | |4| | | | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Enc Sync |R| Status |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 9 and 10.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | IMBE 1 | IMBE 2 | IMBE 3 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 4 | IMBE 5 | IMBE 6 | IMBE 7 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 8 | IMBE 9 | IMBE 10 | IMBE 11 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | LSD0,2 | LSD1,3 |
|
||||
* | | | | |4| | | | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Rsvd |Si |Sj |
|
||||
* +=+=+=+=+=+=+=+=+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API FullRateVoice {
|
||||
public:
|
||||
static const uint8_t LENGTH = 18;
|
||||
static const uint8_t ADDITIONAL_LENGTH = 4;
|
||||
static const uint8_t IMBE_BUF_LEN = 11;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FullRateVoice class.
|
||||
*/
|
||||
FullRateVoice();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FullRateVoice class.
|
||||
* @param data Buffer to containing FullRateVoice to decode.
|
||||
*/
|
||||
FullRateVoice(uint8_t* data);
|
||||
/**
|
||||
* @brief Finalizes a instance of the FullRateVoice class.
|
||||
*/
|
||||
~FullRateVoice();
|
||||
|
||||
/**
|
||||
* @brief Decode a full rate voice frame.
|
||||
* @param[in] data Buffer to containing FullRateVoice to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a full rate voice frame.
|
||||
* @param[out] data Buffer to encode a FullRateVoice.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
uint8_t* imbeData; // ?? - this should probably be private with getters/setters
|
||||
uint8_t* additionalData; // ?? - this should probably be private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief Frame Type.
|
||||
*/
|
||||
__PROPERTY(defines::DFSIFrameType::E, frameType, FrameType);
|
||||
/**
|
||||
* @brief Total errors detected in the frame.
|
||||
*/
|
||||
__PROPERTY(uint8_t, totalErrors, TotalErrors);
|
||||
/**
|
||||
* @brief Flag indicating the frame should be muted.
|
||||
*/
|
||||
__PROPERTY(bool, muteFrame, MuteFrame);
|
||||
/**
|
||||
* @brief Flag indicating the frame was lost.
|
||||
*/
|
||||
__PROPERTY(bool, lostFrame, LostFrame);
|
||||
/**
|
||||
* @brief Superframe Counter.
|
||||
*/
|
||||
__PROPERTY(uint8_t, superframeCnt, SuperframeCnt);
|
||||
/**
|
||||
* @brief Busy Status.
|
||||
*/
|
||||
__PROPERTY(uint8_t, busy, Busy);
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 3 through 8.
|
||||
* @returns bool True, if frame is voice 3 through 8, otherwise false.
|
||||
*/
|
||||
bool isVoice3thru8();
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 12 through 17.
|
||||
* @returns bool True, if frame is voice 12 through 17, otherwise false.
|
||||
*/
|
||||
bool isVoice12thru17();
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 9 or 10.
|
||||
* @returns bool True, if frame is voice 9, or 10, otherwise false.
|
||||
*/
|
||||
bool isVoice9or10();
|
||||
};
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FULL_RATE_VOICE_H__
|
||||
@ -0,0 +1,127 @@
|
||||
// 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 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file MotFullRateVoice.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file MotFullRateVoice.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__MOT_FULL_RATE_VOICE_H__)
|
||||
#define __MOT_FULL_RATE_VOICE_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/p25/dfsi/DFSIDefines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "common/p25/dfsi/frames/FrameDefines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace frames
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 Motorola full rate voice packet.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | Addtl Data | Addtl Data | Addtl Data |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Reserved | IMBE 1 | IMBE 2 | IMBE 3 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 4 | IMBE 5 | IMBE 6 | IMBE 7 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 8 | IMBE 9 | IMBE 10 | IMBE 11 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Src Flag |
|
||||
* +=+=+=+=+=+=+=+=+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API MotFullRateVoice {
|
||||
public:
|
||||
static const uint8_t LENGTH = 17;
|
||||
static const uint8_t SHORTENED_LENGTH = 14;
|
||||
static const uint8_t ADDITIONAL_LENGTH = 4;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotFullRateVoice class.
|
||||
*/
|
||||
MotFullRateVoice();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotFullRateVoice class.
|
||||
* @param data Buffer to containing MotFullRateVoice to decode.
|
||||
*/
|
||||
MotFullRateVoice(uint8_t* data);
|
||||
/**
|
||||
* @brief Finalizes a instance of the MotFullRateVoice class.
|
||||
*/
|
||||
~MotFullRateVoice();
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
uint32_t size();
|
||||
/**
|
||||
* @brief Decode a full rate voice frame.
|
||||
* @param[in] data Buffer to containing MotFullRateVoice to decode.
|
||||
* @param shortened Flag indicating this is a shortened frame.
|
||||
*/
|
||||
bool decode(const uint8_t* data, bool shortened = false);
|
||||
/**
|
||||
* @brief Encode a full rate voice frame.
|
||||
* @param[out] data Buffer to encode a MotFullRateVoice.
|
||||
* @param shortened Flag indicating this is a shortened frame.
|
||||
*/
|
||||
void encode(uint8_t* data, bool shortened = false);
|
||||
|
||||
public:
|
||||
uint8_t* imbeData; // ?? - this should probably be private with getters/setters
|
||||
uint8_t* additionalData; // ?? - this should probably be private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief Frame Type.
|
||||
*/
|
||||
__PROPERTY(defines::DFSIFrameType::E, frameType, FrameType);
|
||||
/**
|
||||
* @brief V.24 Data Source.
|
||||
*/
|
||||
__PROPERTY(SourceFlag::E, source, Source);
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 1, 2, 10 or 11.
|
||||
* @returns bool True, if frame is voice 1, 2, 10, or 11, otherwise false.
|
||||
*/
|
||||
bool isVoice1or2or10or11();
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 2 or 11.
|
||||
* @returns bool True, if frame is voice 2, or 11, otherwise false.
|
||||
*/
|
||||
bool isVoice2or11();
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 9 or 18.
|
||||
* @returns bool True, if frame is voice 9, or 18, otherwise false.
|
||||
*/
|
||||
bool isVoice9or18();
|
||||
};
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __MOT_FULL_RATE_VOICE_H__
|
||||
@ -0,0 +1,99 @@
|
||||
// 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 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file MotStartVoiceFrame.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file MotStartVoiceFrame.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__MOT_START_OF_STREAM_H__)
|
||||
#define __MOT_START_OF_STREAM_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
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 Motorola start of stream packet.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Fixed Mark | RT Mode Flag | Start/Stop | Type Flag |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Reserved |
|
||||
* + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | |
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API MotStartOfStream {
|
||||
public:
|
||||
static const uint8_t LENGTH = 10;
|
||||
static const uint8_t FIXED_MARKER = 0x02;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotStartOfStream class.
|
||||
*/
|
||||
MotStartOfStream();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotStartOfStream class.
|
||||
* @param data Buffer to containing MotStartOfStream to decode.
|
||||
*/
|
||||
MotStartOfStream(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a start of stream frame.
|
||||
* @param[in] data Buffer to containing MotStartOfStream to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a start of stream frame.
|
||||
* @param[out] data Buffer to encode a MotStartOfStream.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(uint8_t, marker, Marker);
|
||||
/**
|
||||
* @brief RT/RT Flag.
|
||||
*/
|
||||
__PROPERTY(RTFlag::E, rt, RT);
|
||||
/**
|
||||
* @brief Start/Stop.
|
||||
*/
|
||||
__PROPERTY(StartStopFlag::E, startStop, StartStop);
|
||||
/**
|
||||
* @brief Stream Type.
|
||||
*/
|
||||
__PROPERTY(StreamTypeFlag::E, streamType, StreamType);
|
||||
};
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __MOT_START_OF_STREAM_H__
|
||||
@ -0,0 +1,117 @@
|
||||
// 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 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file MotStartVoiceFrame.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file MotStartVoiceFrame.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__MOT_START_VOICE_FRAME_H__)
|
||||
#define __MOT_START_VOICE_FRAME_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/MotStartOfStream.h"
|
||||
#include "common/p25/dfsi/frames/MotFullRateVoice.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace frames
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 Motorola voice frame 1/10 start.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Encoded Motorola Start of Stream |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | ICW Flag ? | RSSI | RSSI Valid | RSSI |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Adj MM ? | Full Rate Voice Frame |
|
||||
* +-+-+-+-+-+-+-+-+ +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | |
|
||||
* +=+=+=+=+=+=+=+=+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API MotStartVoiceFrame {
|
||||
public:
|
||||
static const uint8_t LENGTH = 22;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotStartVoiceFrame class.
|
||||
*/
|
||||
MotStartVoiceFrame();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotStartVoiceFrame class.
|
||||
* @param data Buffer to containing MotStartVoiceFrame to decode.
|
||||
*/
|
||||
MotStartVoiceFrame(uint8_t* data);
|
||||
/**
|
||||
* @brief Finalizes a instance of the MotStartVoiceFrame class.
|
||||
*/
|
||||
~MotStartVoiceFrame();
|
||||
|
||||
/**
|
||||
* @brief Decode a start voice frame.
|
||||
* @param[in] data Buffer to containing MotStartVoiceFrame to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a start voice frame.
|
||||
* @param[out] data Buffer to encode a MotStartVoiceFrame.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
MotStartOfStream* startOfStream; // ?? - this should probably be private with getters/setters
|
||||
MotFullRateVoice* fullRateVoice; // ?? - this should probably be private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(ICWFlag::E, icw, ICW);
|
||||
/**
|
||||
* @brief RSSI Value.
|
||||
*/
|
||||
__PROPERTY(uint8_t, rssi, RSSI);
|
||||
/**
|
||||
* @brief Flag indicating whether or not the RSSI field is valid.
|
||||
*/
|
||||
__PROPERTY(RssiValidityFlag::E, rssiValidity, RSSIValidity);
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(uint8_t, nRssi, NRSSI);
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(uint8_t, adjMM, AdjMM);
|
||||
};
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __MOT_START_VOICE_FRAME_H__
|
||||
@ -0,0 +1,117 @@
|
||||
// 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 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file MotVoiceHeader1.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file MotVoiceHeader1.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__MOT_VOICE_HEADER_1_H__)
|
||||
#define __MOT_VOICE_HEADER_1_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/MotStartOfStream.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace frames
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 Motorola voice header frame 1.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Encoded Motorola Start of Stream |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | ICW Flag ? | RSSI | RSSI Valid | RSSI |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Header Control Word |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Src Flag |
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API MotVoiceHeader1 {
|
||||
public:
|
||||
static const uint8_t LENGTH = 30;
|
||||
static const uint8_t HCW_LENGTH = 21;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotVoiceHeader1 class.
|
||||
*/
|
||||
MotVoiceHeader1();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotVoiceHeader1 class.
|
||||
* @param data Buffer to containing MotVoiceHeader1 to decode.
|
||||
*/
|
||||
MotVoiceHeader1(uint8_t* data);
|
||||
/**
|
||||
* @brief Finalizes a instance of the MotVoiceHeader1 class.
|
||||
*/
|
||||
~MotVoiceHeader1();
|
||||
|
||||
/**
|
||||
* @brief Decode a voice header 1 frame.
|
||||
* @param[in] data Buffer to containing MotVoiceHeader1 to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a voice header 1 frame.
|
||||
* @param[out] data Buffer to encode a MotVoiceHeader1.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
uint8_t* header; // ?? - this should probably be private with getters/setters
|
||||
MotStartOfStream* startOfStream; // ?? - this should probably be private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(ICWFlag::E, icw, ICW);
|
||||
/**
|
||||
* @brief RSSI Value.
|
||||
*/
|
||||
__PROPERTY(uint8_t, rssi, RSSI);
|
||||
/**
|
||||
* @brief Flag indicating whether or not the RSSI field is valid.
|
||||
*/
|
||||
__PROPERTY(RssiValidityFlag::E, rssiValidity, RSSIValidity);
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(uint8_t, nRssi, NRSSI);
|
||||
};
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __MOT_VOICE_HEADER_1_H__
|
||||
@ -0,0 +1,100 @@
|
||||
// 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 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file MotVoiceHeader2.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file MotVoiceHeader2.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__MOT_VOICE_HEADER_2_H__)
|
||||
#define __MOT_VOICE_HEADER_2_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/MotStartOfStream.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace frames
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 Motorola voice header frame 2.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Header Control Word |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | | Reserved |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API MotVoiceHeader2 {
|
||||
public:
|
||||
static const uint8_t LENGTH = 22;
|
||||
static const uint8_t HCW_LENGTH = 20;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotVoiceHeader2 class.
|
||||
*/
|
||||
MotVoiceHeader2();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotVoiceHeader2 class.
|
||||
* @param data Buffer to containing MotVoiceHeader2 to decode.
|
||||
*/
|
||||
MotVoiceHeader2(uint8_t* data);
|
||||
/**
|
||||
* @brief Finalizes a instance of the MotVoiceHeader2 class.
|
||||
*/
|
||||
~MotVoiceHeader2();
|
||||
|
||||
/**
|
||||
* @brief Decode a voice header 2 frame.
|
||||
* @param[in] data Buffer to containing MotVoiceHeader2 to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a voice header 2 frame.
|
||||
* @param[out] data Buffer to encode a MotVoiceHeader2.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
uint8_t* header; // ?? - this should probably be a private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief V.24 Data Source.
|
||||
*/
|
||||
__PROPERTY(SourceFlag::E, source, Source);
|
||||
};
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __MOT_VOICE_HEADER_2_H__
|
||||
@ -0,0 +1,85 @@
|
||||
// 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 StartOfStream.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file StartOfStream.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__START_OF_STREAM_H__)
|
||||
#define __START_OF_STREAM_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
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 DFSI start of stream packet.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | NID | Rsvd | Err C |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API StartOfStream {
|
||||
public:
|
||||
static const uint8_t LENGTH = 4;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the StartOfStream class.
|
||||
*/
|
||||
StartOfStream();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the StartOfStream class.
|
||||
* @param data Buffer to containing StartOfStream to decode.
|
||||
*/
|
||||
StartOfStream(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a start of stream frame.
|
||||
* @param[in] data Buffer to containing StartOfStream to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a start of stream frame.
|
||||
* @param[out] data Buffer to encode a StartOfStream.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Network Identifier.
|
||||
*/
|
||||
__PROPERTY(uint16_t, nid, NID);
|
||||
/**
|
||||
* @brief Error count.
|
||||
*/
|
||||
__PROPERTY(uint8_t, errorCount, ErrorCount);
|
||||
};
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __START_OF_STREAM_H__
|
||||
@ -0,0 +1,96 @@
|
||||
// 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 FSCACK.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCACK.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_ACK_H__)
|
||||
#define __FSC_ACK_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 Acknowledgement Message.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCACK : public FSCMessage {
|
||||
public:
|
||||
static const uint8_t LENGTH = 6;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCACK class.
|
||||
*/
|
||||
FSCACK();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCACK class.
|
||||
* @param data Buffer to containing FSCACK to decode.
|
||||
*/
|
||||
FSCACK(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a FSC ACK frame.
|
||||
* @param[in] data Buffer to containing FSCACK to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data) override;
|
||||
/**
|
||||
* @brief Encode a FSC ACK frame.
|
||||
* @param[out] data Buffer to encode a FSCACK.
|
||||
*/
|
||||
void encode(uint8_t* data) override;
|
||||
|
||||
public:
|
||||
uint8_t* responseData; // ?? - this should probably be private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief Acknowledged Message ID.
|
||||
*/
|
||||
__PROPERTY(FSCMessageType::E, ackMessageId, AckMessageId);
|
||||
/**
|
||||
* @brief Acknowledged Message Version.
|
||||
*/
|
||||
__READONLY_PROPERTY(uint8_t, ackVersion, AckVersion);
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__READONLY_PROPERTY(uint8_t, ackCorrelationTag, AckCorrelationTag);
|
||||
/**
|
||||
* @brief Response code.
|
||||
*/
|
||||
__PROPERTY(FSCAckResponseCode::E, responseCode, ResponseCode);
|
||||
/**
|
||||
* @brief Response Data Length.
|
||||
*/
|
||||
__PROPERTY(uint8_t, respLength, ResponseLength);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_ACK_H__
|
||||
@ -0,0 +1,90 @@
|
||||
// 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 FSCConnect.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCConnect.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_CONNECT_H__)
|
||||
#define __FSC_CONNECT_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 Connect Message.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCConnect : public FSCMessage {
|
||||
public:
|
||||
static const uint8_t LENGTH = 11;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCConnect class.
|
||||
*/
|
||||
FSCConnect();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCConnect class.
|
||||
* @param data Buffer to containing FSCConnect to decode.
|
||||
*/
|
||||
FSCConnect(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a FSC connect frame.
|
||||
* @param[in] data Buffer to containing FSCConnect to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data) override;
|
||||
/**
|
||||
* @brief Encode a FSC connect frame.
|
||||
* @param[out] data Buffer to encode a FSCConnect.
|
||||
*/
|
||||
void encode(uint8_t* data) override;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Voice Conveyance RTP Port.
|
||||
*/
|
||||
__PROPERTY(uint16_t, vcBasePort, VCBasePort);
|
||||
/**
|
||||
* @brief SSRC Identifier for all RTP transmissions.
|
||||
*/
|
||||
__PROPERTY(uint32_t, vcSSRC, VCSSRC);
|
||||
/**
|
||||
* @brief Fixed Station Heartbeat Period.
|
||||
*/
|
||||
__PROPERTY(uint8_t, fsHeartbeatPeriod, FSHeartbeatPeriod);
|
||||
/**
|
||||
* @brief Host Heartbeat Period.
|
||||
*/
|
||||
__PROPERTY(uint8_t, hostHeartbeatPeriod, HostHeartbeatPeriod);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_CONNECT_H__
|
||||
@ -0,0 +1,78 @@
|
||||
// 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(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__
|
||||
@ -0,0 +1,61 @@
|
||||
// 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 FSCDisconnect.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCDisconnect.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_DISCONNECT_H__)
|
||||
#define __FSC_DISCONNECT_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 Disconnect Message.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCDisconnect : public FSCMessage {
|
||||
public:
|
||||
static const uint8_t LENGTH = 3;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCDisconnect class.
|
||||
*/
|
||||
FSCDisconnect();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCDisconnect class.
|
||||
* @param data Buffer to containing FSCDisconnect to decode.
|
||||
*/
|
||||
FSCDisconnect(uint8_t* data);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_DISCONNECT_H__
|
||||
@ -0,0 +1,61 @@
|
||||
// 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 FSCHeartbeat.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCHeartbeat.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_HEARTBEAT_H__)
|
||||
#define __FSC_HEARTBEAT_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 Heartbeat Message.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCHeartbeat : public FSCMessage {
|
||||
public:
|
||||
static const uint8_t LENGTH = 3;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCHeartbeat class.
|
||||
*/
|
||||
FSCHeartbeat();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCHeartbeat class.
|
||||
* @param data Buffer to containing FSCHeartbeat to decode.
|
||||
*/
|
||||
FSCHeartbeat(uint8_t* data);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_HEARTBEAT_H__
|
||||
@ -0,0 +1,85 @@
|
||||
// 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 FSCMessage.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCMessage.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_MESSAGE_H__)
|
||||
#define __FSC_MESSAGE_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 messages derive from.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCMessage {
|
||||
public:
|
||||
static const uint8_t LENGTH = 3;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCMessage class.
|
||||
*/
|
||||
FSCMessage();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCMessage class.
|
||||
* @param data Buffer to containing FSCMessage to decode.
|
||||
*/
|
||||
FSCMessage(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a FSC message frame.
|
||||
* @param[in] data Buffer to containing FSCMessage to decode.
|
||||
*/
|
||||
virtual bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a FSC message frame.
|
||||
* @param[out] data Buffer to encode a FSCMessage.
|
||||
*/
|
||||
virtual void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Message ID.
|
||||
*/
|
||||
__PROTECTED_PROPERTY(FSCMessageType::E, messageId, MessageId);
|
||||
/**
|
||||
* @brief Message Version.
|
||||
*/
|
||||
__PROTECTED_READONLY_PROPERTY(uint8_t, version, Version);
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROTECTED_READONLY_PROPERTY(uint8_t, correlationTag, CorrelationTag);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace frames
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_MESSAGE_H__
|
||||
@ -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) 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(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__
|
||||
@ -1,103 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* 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 BlockHeader.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file BlockHeader.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__BLOCK_HEADER_H__)
|
||||
#define __BLOCK_HEADER_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a DFSI block header packet.
|
||||
* \code{.unparsed}
|
||||
* Compact Form
|
||||
* Byte 0
|
||||
* Bit 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
* |E| BT |
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
*
|
||||
* Verbose Form
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* |E| BT | TSO | BL |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API BlockHeader {
|
||||
public:
|
||||
static const uint8_t LENGTH = 1;
|
||||
static const uint8_t VERBOSE_LENGTH = 4;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the BlockHeader class.
|
||||
*/
|
||||
BlockHeader();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the BlockHeader class.
|
||||
* @param data Buffer to containing BlockHeader to decode.
|
||||
* @param verbose Flag indicating verbose form of BlockHeader.
|
||||
*/
|
||||
BlockHeader(uint8_t* data, bool verbose = false);
|
||||
|
||||
/**
|
||||
* @brief Decode a block header frame.
|
||||
* @param[in] data Buffer to containing BlockHeader to decode.
|
||||
* @param verbose Flag indicating verbose form of BlockHeader.
|
||||
*/
|
||||
bool decode(const uint8_t* data, bool verbose = false);
|
||||
/**
|
||||
* @brief Encode a block header frame.
|
||||
* @param[out] data Buffer to encode a BlockHeader.
|
||||
* @param verbose Flag indicating verbose form of BlockHeader.
|
||||
*/
|
||||
void encode(uint8_t *data, bool verbose = false);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Payload type.
|
||||
* This simple boolean marks this header as either IANA standard, or profile specific.
|
||||
*/
|
||||
__PROPERTY(bool, payloadType, PayloadType);
|
||||
/**
|
||||
* @brief Block type.
|
||||
*/
|
||||
__PROPERTY(BlockType::E, blockType, BlockType);
|
||||
/**
|
||||
* @brief Timestamp Offset.
|
||||
*/
|
||||
__PROPERTY(uint16_t, timestampOffset, TimestampOffset);
|
||||
/**
|
||||
* @brief Block length.
|
||||
*/
|
||||
__PROPERTY(uint16_t, blockLength, BlockLength);
|
||||
};
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __BLOCK_HEADER_H__
|
||||
@ -1,86 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* 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 ControlOctet.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file ControlOctet.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__CONTROL_OCTET_H__)
|
||||
#define __CONTROL_OCTET_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a DFSI control octet packet.
|
||||
* \code{.unparsed}
|
||||
* Byte 0
|
||||
* Bit 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
* |S|C| BHC |
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API ControlOctet {
|
||||
public:
|
||||
static const uint8_t LENGTH = 1;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the ControlOctet class.
|
||||
*/
|
||||
ControlOctet();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the ControlOctet class.
|
||||
* @param data Buffer to containing ControlOctet to decode.
|
||||
*/
|
||||
ControlOctet(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a control octet frame.
|
||||
* @param[in] data Buffer to containing ControlOctet to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a control octet frame.
|
||||
* @param[out] data Buffer to encode a ControlOctet.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(bool, signal, Signal);
|
||||
/**
|
||||
* @brief Indicates a compact (1) or verbose (0) block header.
|
||||
*/
|
||||
__PROPERTY(bool, compact, Compact);
|
||||
/**
|
||||
* @brief Number of block headers following this control octet.
|
||||
*/
|
||||
__PROPERTY(uint8_t, blockHeaderCnt, BlockHeaderCnt);
|
||||
};
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __CONTROL_OCTET_H__
|
||||
@ -1,142 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* GPLv2 Open Source. Use is subject to license terms.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright (C) 2024 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @defgroup dfsi_frames DFSI Data Frames
|
||||
* @brief Implementation for the DFSI data frames.
|
||||
* @ingroup dfsi
|
||||
*
|
||||
* @defgroup dfsi_fsc_frames DFSI Control Frames
|
||||
* @brief Implementation for the DFSI control frames.
|
||||
* @ingroup dfsi_frames
|
||||
*
|
||||
* @file FrameDefines.h
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__FRAME_DEFINES_H__)
|
||||
#define __FRAME_DEFINES_H__
|
||||
|
||||
#include "common/Defines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Constants
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @addtogroup dfsi_frames
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @brief FSC Control Service Message.*/
|
||||
namespace FSCMessageType {
|
||||
/** @brief FSC Control Service Message.*/
|
||||
enum E : uint8_t {
|
||||
FSC_CONNECT = 0, //! Establish connection with FSS.
|
||||
FSC_HEARTBEAT = 1, //! Heartbeat/Connectivity Maintenance.
|
||||
FSC_ACK = 2, //! Control Service Ack.
|
||||
|
||||
FSC_DISCONNECT = 9, //! Detach Control Service.
|
||||
|
||||
FSC_INVALID = 127, //! Invalid Control Message.
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief FSC ACK/NAK Codes. */
|
||||
namespace FSCAckResponseCode {
|
||||
/** @brief FSC ACK/NAK Codes. */
|
||||
enum E : uint8_t {
|
||||
CONTROL_ACK = 0, //! Acknowledgement.
|
||||
CONTROL_NAK = 1, //! Unspecified Negative Acknowledgement.
|
||||
CONTROL_NAK_CONNECTED = 2, //! Server is connected to some other host.
|
||||
CONTROL_NAK_M_UNSUPP = 3, //! Unsupported Manufactuerer Message.
|
||||
CONTROL_NAK_V_UNSUPP = 4, //! Unsupported Message Version.
|
||||
CONTROL_NAK_F_UNSUPP = 5, //! Unsupported Function.
|
||||
CONTROL_NAK_PARMS = 6, //! Bad / Unsupported Command Parameters.
|
||||
CONTROL_NAK_BUSY = 7 //! FSS is currently busy with a function.
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief DFSI Block Types */
|
||||
namespace BlockType {
|
||||
/** @brief DFSI Block Types */
|
||||
enum E : uint8_t {
|
||||
FULL_RATE_VOICE = 0, //! Full Rate Voice
|
||||
|
||||
VOICE_HEADER_P1 = 6, //! Voice Header 1
|
||||
VOICE_HEADER_P2 = 7, //! Voice Header 2
|
||||
|
||||
START_OF_STREAM = 9, //! Start of Stream
|
||||
END_OF_STREAM = 10, //! End of Stream
|
||||
|
||||
UNDEFINED = 127 //! Undefined
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief RT/RT Flag */
|
||||
namespace RTFlag {
|
||||
/** @brief RT/RT Flag */
|
||||
enum E : uint8_t {
|
||||
ENABLED = 0x02U, //! RT/RT Enabled
|
||||
DISABLED = 0x04U //! RT/RT Disabled
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief Start/Stop Flag */
|
||||
namespace StartStopFlag {
|
||||
/** @brief Start/Stop Flag */
|
||||
enum E : uint8_t {
|
||||
START = 0x0CU, //! Start
|
||||
STOP = 0x25U //! Stop
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief V.24 Data Stream Type */
|
||||
namespace StreamTypeFlag {
|
||||
/** @brief V.24 Data Stream Type */
|
||||
enum E : uint8_t {
|
||||
VOICE = 0x0BU //! Voice
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief RSSI Data Validity */
|
||||
namespace RssiValidityFlag {
|
||||
/** @brief RSSI Data Validity */
|
||||
enum E : uint8_t {
|
||||
INVALID = 0x00U, //! Invalid
|
||||
VALID = 0x1A //! Valid
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief V.24 Data Source */
|
||||
namespace SourceFlag {
|
||||
/** @brief V.24 Data Source */
|
||||
enum E : uint8_t {
|
||||
DIU = 0x00U, //! DIU
|
||||
QUANTAR = 0x02U //! Quantar
|
||||
};
|
||||
}
|
||||
|
||||
/** @brief */
|
||||
namespace ICWFlag {
|
||||
/** @brief */
|
||||
enum E : uint8_t {
|
||||
DIU = 0x00U, //! DIU
|
||||
QUANTAR = 0x1B //! Quantar
|
||||
};
|
||||
}
|
||||
/** @} */
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FRAME_DEFINES_H__
|
||||
@ -1,38 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* GPLv2 Open Source. Use is subject to license terms.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright (C) 2024 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
#if !defined(__DFSI_FRAMES_H__)
|
||||
#define __DFSI_FRAMES_H__
|
||||
|
||||
#include "Defines.h"
|
||||
|
||||
// TIA
|
||||
#include "frames/StartOfStream.h"
|
||||
#include "frames/ControlOctet.h"
|
||||
#include "frames/BlockHeader.h"
|
||||
#include "frames/FullRateVoice.h"
|
||||
|
||||
// "The" Manufacturer
|
||||
#include "frames/MotFullRateVoice.h"
|
||||
#include "frames/MotStartOfStream.h"
|
||||
#include "frames/MotStartVoiceFrame.h"
|
||||
#include "frames/MotVoiceHeader1.h"
|
||||
#include "frames/MotVoiceHeader2.h"
|
||||
|
||||
// FSC
|
||||
#include "frames/fsc/FSCMessage.h"
|
||||
#include "frames/fsc/FSCResponse.h"
|
||||
#include "frames/fsc/FSCACK.h"
|
||||
#include "frames/fsc/FSCConnect.h"
|
||||
#include "frames/fsc/FSCConnectResponse.h"
|
||||
#include "frames/fsc/FSCDisconnect.h"
|
||||
#include "frames/fsc/FSCHeartbeat.h"
|
||||
|
||||
#endif // __DFSI_FRAMES_H__
|
||||
@ -1,256 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* 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 FullRateVoice.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file FullRateVoice.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__FULL_RATE_VOICE_H__)
|
||||
#define __FULL_RATE_VOICE_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/p25/dfsi/DFSIDefines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 full rate voice packet.
|
||||
* \code{.unparsed}
|
||||
* CAI Frames 1, 2, 10 and 11.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | U0(b11-0) | U1(b11-0) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U2(b10-0) | U3(b11-0) | U4(b10-3) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U4 | U5(b10-0) | U6(b10-0) | U7(b6-0) |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B |
|
||||
* | | | | |4| | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 3 - 8.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | U0(b11-0) | U1(b11-0) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U2(b10-0) | U3(b11-0) | U4(b10-3) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U4 | U5(b10-0) | U6(b10-0) | U7(b6-0) |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | LC0,4,8 | LC1,5,9 | LC2, |
|
||||
* | | | | |4| | | | | | 6,10 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | | LC3,7,11 |R| Status |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 12 - 17.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | U0(b11-0) | U1(b11-0) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U2(b10-0) | U3(b11-0) | U4(b10-3) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U4 | U5(b10-0) | U6(b10-0) | U7(b6-0) |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | ES0,4,8 | ES1,5,9 | ES2, |
|
||||
* | | | | |4| | | | | | 6,10 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | | ES3,7,11 |R| Status |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 9 and 10.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | U0(b11-0) | U1(b11-0) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U2(b10-0) | U3(b11-0) | U4(b10-3) |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | U4 | U5(b10-0) | U6(b10-0) | U7(b6-0) |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | LSD0,2 | LSD1,3 |
|
||||
* | | | | |4| | | | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Rsvd |Si |Sj |
|
||||
* +=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* Because the TIA.102-BAHA spec represents the "message vectors" as
|
||||
* 16-bit units (U0 - U7) this makes understanding the layout of the
|
||||
* buffer ... difficult for the 8-bit aligned minded. The following is
|
||||
* the layout with 8-bit aligned IMBE blocks instead of message vectors:
|
||||
*
|
||||
* CAI Frames 1, 2, 10 and 11.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | IMBE 1 | IMBE 2 | IMBE 3 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 4 | IMBE 5 | IMBE 6 | IMBE 7 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 8 | IMBE 9 | IMBE 10 | IMBE 11 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B |
|
||||
* | | | | |4| | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 3 - 8.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | IMBE 1 | IMBE 2 | IMBE 3 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 4 | IMBE 5 | IMBE 6 | IMBE 7 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 8 | IMBE 9 | IMBE 10 | IMBE 11 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | Link Ctrl | Link Ctrl |
|
||||
* | | | | |4| | | | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Link Ctrl |R| Status |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 12 - 17.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | IMBE 1 | IMBE 2 | IMBE 3 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 4 | IMBE 5 | IMBE 6 | IMBE 7 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 8 | IMBE 9 | IMBE 10 | IMBE 11 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | Enc Sync | Enc Sync |
|
||||
* | | | | |4| | | | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Enc Sync |R| Status |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
*
|
||||
* CAI Frames 9 and 10.
|
||||
*
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | IMBE 1 | IMBE 2 | IMBE 3 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 4 | IMBE 5 | IMBE 6 | IMBE 7 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 8 | IMBE 9 | IMBE 10 | IMBE 11 |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Et | Er |M|L|E| E1 |SF | B | LSD0,2 | LSD1,3 |
|
||||
* | | | | |4| | | | | |
|
||||
* +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
||||
* | Rsvd |Si |Sj |
|
||||
* +=+=+=+=+=+=+=+=+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API FullRateVoice {
|
||||
public:
|
||||
static const uint8_t LENGTH = 18;
|
||||
static const uint8_t ADDITIONAL_LENGTH = 4;
|
||||
static const uint8_t IMBE_BUF_LEN = 11;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FullRateVoice class.
|
||||
*/
|
||||
FullRateVoice();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FullRateVoice class.
|
||||
* @param data Buffer to containing FullRateVoice to decode.
|
||||
*/
|
||||
FullRateVoice(uint8_t* data);
|
||||
/**
|
||||
* @brief Finalizes a instance of the FullRateVoice class.
|
||||
*/
|
||||
~FullRateVoice();
|
||||
|
||||
/**
|
||||
* @brief Decode a full rate voice frame.
|
||||
* @param[in] data Buffer to containing FullRateVoice to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a full rate voice frame.
|
||||
* @param[out] data Buffer to encode a FullRateVoice.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
uint8_t* imbeData; // ?? - this should probably be private with getters/setters
|
||||
uint8_t* additionalData; // ?? - this should probably be private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief Frame Type.
|
||||
*/
|
||||
__PROPERTY(defines::DFSIFrameType::E, frameType, FrameType);
|
||||
/**
|
||||
* @brief Total errors detected in the frame.
|
||||
*/
|
||||
__PROPERTY(uint8_t, totalErrors, TotalErrors);
|
||||
/**
|
||||
* @brief Flag indicating the frame should be muted.
|
||||
*/
|
||||
__PROPERTY(bool, muteFrame, MuteFrame);
|
||||
/**
|
||||
* @brief Flag indicating the frame was lost.
|
||||
*/
|
||||
__PROPERTY(bool, lostFrame, LostFrame);
|
||||
/**
|
||||
* @brief Superframe Counter.
|
||||
*/
|
||||
__PROPERTY(uint8_t, superframeCnt, SuperframeCnt);
|
||||
/**
|
||||
* @brief Busy Status.
|
||||
*/
|
||||
__PROPERTY(uint8_t, busy, Busy);
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 3 through 8.
|
||||
* @returns bool True, if frame is voice 3 through 8, otherwise false.
|
||||
*/
|
||||
bool isVoice3thru8();
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 12 through 17.
|
||||
* @returns bool True, if frame is voice 12 through 17, otherwise false.
|
||||
*/
|
||||
bool isVoice12thru17();
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 9 or 10.
|
||||
* @returns bool True, if frame is voice 9, or 10, otherwise false.
|
||||
*/
|
||||
bool isVoice9or10();
|
||||
};
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FULL_RATE_VOICE_H__
|
||||
@ -1,124 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* GPLv2 Open Source. Use is subject to license terms.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright (C) 2024 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file MotFullRateVoice.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file MotFullRateVoice.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__MOT_FULL_RATE_VOICE_H__)
|
||||
#define __MOT_FULL_RATE_VOICE_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/p25/dfsi/DFSIDefines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 Motorola full rate voice packet.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | FT | Addtl Data | Addtl Data | Addtl Data |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Reserved | IMBE 1 | IMBE 2 | IMBE 3 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 4 | IMBE 5 | IMBE 6 | IMBE 7 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | IMBE 8 | IMBE 9 | IMBE 10 | IMBE 11 |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Src Flag |
|
||||
* +=+=+=+=+=+=+=+=+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API MotFullRateVoice {
|
||||
public:
|
||||
static const uint8_t LENGTH = 17;
|
||||
static const uint8_t SHORTENED_LENGTH = 14;
|
||||
static const uint8_t ADDITIONAL_LENGTH = 4;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotFullRateVoice class.
|
||||
*/
|
||||
MotFullRateVoice();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotFullRateVoice class.
|
||||
* @param data Buffer to containing MotFullRateVoice to decode.
|
||||
*/
|
||||
MotFullRateVoice(uint8_t* data);
|
||||
/**
|
||||
* @brief Finalizes a instance of the MotFullRateVoice class.
|
||||
*/
|
||||
~MotFullRateVoice();
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
uint32_t size();
|
||||
/**
|
||||
* @brief Decode a full rate voice frame.
|
||||
* @param[in] data Buffer to containing MotFullRateVoice to decode.
|
||||
* @param shortened Flag indicating this is a shortened frame.
|
||||
*/
|
||||
bool decode(const uint8_t* data, bool shortened = false);
|
||||
/**
|
||||
* @brief Encode a full rate voice frame.
|
||||
* @param[out] data Buffer to encode a MotFullRateVoice.
|
||||
* @param shortened Flag indicating this is a shortened frame.
|
||||
*/
|
||||
void encode(uint8_t* data, bool shortened = false);
|
||||
|
||||
public:
|
||||
uint8_t* imbeData; // ?? - this should probably be private with getters/setters
|
||||
uint8_t* additionalData; // ?? - this should probably be private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief Frame Type.
|
||||
*/
|
||||
__PROPERTY(defines::DFSIFrameType::E, frameType, FrameType);
|
||||
/**
|
||||
* @brief V.24 Data Source.
|
||||
*/
|
||||
__PROPERTY(SourceFlag::E, source, Source);
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 1, 2, 10 or 11.
|
||||
* @returns bool True, if frame is voice 1, 2, 10, or 11, otherwise false.
|
||||
*/
|
||||
bool isVoice1or2or10or11();
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 2 or 11.
|
||||
* @returns bool True, if frame is voice 2, or 11, otherwise false.
|
||||
*/
|
||||
bool isVoice2or11();
|
||||
/**
|
||||
* @brief Helper indicating if the frame is voice 9 or 18.
|
||||
* @returns bool True, if frame is voice 9, or 18, otherwise false.
|
||||
*/
|
||||
bool isVoice9or18();
|
||||
};
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __MOT_FULL_RATE_VOICE_H__
|
||||
@ -1,96 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* GPLv2 Open Source. Use is subject to license terms.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright (C) 2024 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file MotStartVoiceFrame.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file MotStartVoiceFrame.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__MOT_START_OF_STREAM_H__)
|
||||
#define __MOT_START_OF_STREAM_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 Motorola start of stream packet.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Fixed Mark | RT Mode Flag | Start/Stop | Type Flag |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Reserved |
|
||||
* + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | |
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API MotStartOfStream {
|
||||
public:
|
||||
static const uint8_t LENGTH = 10;
|
||||
static const uint8_t FIXED_MARKER = 0x02;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotStartOfStream class.
|
||||
*/
|
||||
MotStartOfStream();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotStartOfStream class.
|
||||
* @param data Buffer to containing MotStartOfStream to decode.
|
||||
*/
|
||||
MotStartOfStream(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a start of stream frame.
|
||||
* @param[in] data Buffer to containing MotStartOfStream to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a start of stream frame.
|
||||
* @param[out] data Buffer to encode a MotStartOfStream.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(uint8_t, marker, Marker);
|
||||
/**
|
||||
* @brief RT/RT Flag.
|
||||
*/
|
||||
__PROPERTY(RTFlag::E, rt, RT);
|
||||
/**
|
||||
* @brief Start/Stop.
|
||||
*/
|
||||
__PROPERTY(StartStopFlag::E, startStop, StartStop);
|
||||
/**
|
||||
* @brief Stream Type.
|
||||
*/
|
||||
__PROPERTY(StreamTypeFlag::E, streamType, StreamType);
|
||||
};
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __MOT_START_OF_STREAM_H__
|
||||
@ -1,114 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* GPLv2 Open Source. Use is subject to license terms.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright (C) 2024 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file MotStartVoiceFrame.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file MotStartVoiceFrame.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__MOT_START_VOICE_FRAME_H__)
|
||||
#define __MOT_START_VOICE_FRAME_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
#include "frames/MotStartOfStream.h"
|
||||
#include "frames/MotFullRateVoice.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 Motorola voice frame 1/10 start.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Encoded Motorola Start of Stream |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | ICW Flag ? | RSSI | RSSI Valid | RSSI |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Adj MM ? | Full Rate Voice Frame |
|
||||
* +-+-+-+-+-+-+-+-+ +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | |
|
||||
* +=+=+=+=+=+=+=+=+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API MotStartVoiceFrame {
|
||||
public:
|
||||
static const uint8_t LENGTH = 22;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotStartVoiceFrame class.
|
||||
*/
|
||||
MotStartVoiceFrame();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotStartVoiceFrame class.
|
||||
* @param data Buffer to containing MotStartVoiceFrame to decode.
|
||||
*/
|
||||
MotStartVoiceFrame(uint8_t* data);
|
||||
/**
|
||||
* @brief Finalizes a instance of the MotStartVoiceFrame class.
|
||||
*/
|
||||
~MotStartVoiceFrame();
|
||||
|
||||
/**
|
||||
* @brief Decode a start voice frame.
|
||||
* @param[in] data Buffer to containing MotStartVoiceFrame to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a start voice frame.
|
||||
* @param[out] data Buffer to encode a MotStartVoiceFrame.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
MotStartOfStream* startOfStream; // ?? - this should probably be private with getters/setters
|
||||
MotFullRateVoice* fullRateVoice; // ?? - this should probably be private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(ICWFlag::E, icw, ICW);
|
||||
/**
|
||||
* @brief RSSI Value.
|
||||
*/
|
||||
__PROPERTY(uint8_t, rssi, RSSI);
|
||||
/**
|
||||
* @brief Flag indicating whether or not the RSSI field is valid.
|
||||
*/
|
||||
__PROPERTY(RssiValidityFlag::E, rssiValidity, RSSIValidity);
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(uint8_t, nRssi, NRSSI);
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(uint8_t, adjMM, AdjMM);
|
||||
};
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __MOT_START_VOICE_FRAME_H__
|
||||
@ -1,114 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* GPLv2 Open Source. Use is subject to license terms.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright (C) 2024 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file MotVoiceHeader1.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file MotVoiceHeader1.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__MOT_VOICE_HEADER_1_H__)
|
||||
#define __MOT_VOICE_HEADER_1_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
#include "frames/MotStartOfStream.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 Motorola voice header frame 1.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Encoded Motorola Start of Stream |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | ICW Flag ? | RSSI | RSSI Valid | RSSI |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Header Control Word |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Src Flag |
|
||||
* +-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API MotVoiceHeader1 {
|
||||
public:
|
||||
static const uint8_t LENGTH = 30;
|
||||
static const uint8_t HCW_LENGTH = 21;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotVoiceHeader1 class.
|
||||
*/
|
||||
MotVoiceHeader1();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotVoiceHeader1 class.
|
||||
* @param data Buffer to containing MotVoiceHeader1 to decode.
|
||||
*/
|
||||
MotVoiceHeader1(uint8_t* data);
|
||||
/**
|
||||
* @brief Finalizes a instance of the MotVoiceHeader1 class.
|
||||
*/
|
||||
~MotVoiceHeader1();
|
||||
|
||||
/**
|
||||
* @brief Decode a voice header 1 frame.
|
||||
* @param[in] data Buffer to containing MotVoiceHeader1 to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a voice header 1 frame.
|
||||
* @param[out] data Buffer to encode a MotVoiceHeader1.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
uint8_t* header; // ?? - this should probably be private with getters/setters
|
||||
MotStartOfStream* startOfStream; // ?? - this should probably be private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(ICWFlag::E, icw, ICW);
|
||||
/**
|
||||
* @brief RSSI Value.
|
||||
*/
|
||||
__PROPERTY(uint8_t, rssi, RSSI);
|
||||
/**
|
||||
* @brief Flag indicating whether or not the RSSI field is valid.
|
||||
*/
|
||||
__PROPERTY(RssiValidityFlag::E, rssiValidity, RSSIValidity);
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROPERTY(uint8_t, nRssi, NRSSI);
|
||||
};
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __MOT_VOICE_HEADER_1_H__
|
||||
@ -1,97 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* GPLv2 Open Source. Use is subject to license terms.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright (C) 2024 Patrick McDonnell, W3AXL
|
||||
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file MotVoiceHeader2.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file MotVoiceHeader2.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__MOT_VOICE_HEADER_2_H__)
|
||||
#define __MOT_VOICE_HEADER_2_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
#include "frames/MotStartOfStream.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 Motorola voice header frame 2.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2 3
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Header Control Word |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | | Reserved |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API MotVoiceHeader2 {
|
||||
public:
|
||||
static const uint8_t LENGTH = 22;
|
||||
static const uint8_t HCW_LENGTH = 20;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotVoiceHeader2 class.
|
||||
*/
|
||||
MotVoiceHeader2();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the MotVoiceHeader2 class.
|
||||
* @param data Buffer to containing MotVoiceHeader2 to decode.
|
||||
*/
|
||||
MotVoiceHeader2(uint8_t* data);
|
||||
/**
|
||||
* @brief Finalizes a instance of the MotVoiceHeader2 class.
|
||||
*/
|
||||
~MotVoiceHeader2();
|
||||
|
||||
/**
|
||||
* @brief Decode a voice header 2 frame.
|
||||
* @param[in] data Buffer to containing MotVoiceHeader2 to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a voice header 2 frame.
|
||||
* @param[out] data Buffer to encode a MotVoiceHeader2.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
uint8_t* header; // ?? - this should probably be a private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief V.24 Data Source.
|
||||
*/
|
||||
__PROPERTY(SourceFlag::E, source, Source);
|
||||
};
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __MOT_VOICE_HEADER_2_H__
|
||||
@ -1,82 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* 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 StartOfStream.h
|
||||
* @ingroup dfsi_frames
|
||||
* @file StartOfStream.cpp
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
#if !defined(__START_OF_STREAM_H__)
|
||||
#define __START_OF_STREAM_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements a P25 DFSI start of stream packet.
|
||||
* \code{.unparsed}
|
||||
* Byte 0 1 2
|
||||
* Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | NID | Rsvd | Err C |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* \endcode
|
||||
* @ingroup dfsi_frames
|
||||
*/
|
||||
class HOST_SW_API StartOfStream {
|
||||
public:
|
||||
static const uint8_t LENGTH = 4;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the StartOfStream class.
|
||||
*/
|
||||
StartOfStream();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the StartOfStream class.
|
||||
* @param data Buffer to containing StartOfStream to decode.
|
||||
*/
|
||||
StartOfStream(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a start of stream frame.
|
||||
* @param[in] data Buffer to containing StartOfStream to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a start of stream frame.
|
||||
* @param[out] data Buffer to encode a StartOfStream.
|
||||
*/
|
||||
void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Network Identifier.
|
||||
*/
|
||||
__PROPERTY(uint16_t, nid, NID);
|
||||
/**
|
||||
* @brief Error count.
|
||||
*/
|
||||
__PROPERTY(uint8_t, errorCount, ErrorCount);
|
||||
};
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __START_OF_STREAM_H__
|
||||
@ -1,93 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* 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 FSCACK.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCACK.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_ACK_H__)
|
||||
#define __FSC_ACK_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
#include "frames/fsc/FSCMessage.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace fsc
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements the FSC Acknowledgement Message.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCACK : public FSCMessage {
|
||||
public:
|
||||
static const uint8_t LENGTH = 6;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCACK class.
|
||||
*/
|
||||
FSCACK();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCACK class.
|
||||
* @param data Buffer to containing FSCACK to decode.
|
||||
*/
|
||||
FSCACK(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a FSC ACK frame.
|
||||
* @param[in] data Buffer to containing FSCACK to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data) override;
|
||||
/**
|
||||
* @brief Encode a FSC ACK frame.
|
||||
* @param[out] data Buffer to encode a FSCACK.
|
||||
*/
|
||||
void encode(uint8_t* data) override;
|
||||
|
||||
public:
|
||||
uint8_t* responseData; // ?? - this should probably be private with getters/setters
|
||||
|
||||
/**
|
||||
* @brief Acknowledged Message ID.
|
||||
*/
|
||||
__PROPERTY(FSCMessageType::E, ackMessageId, AckMessageId);
|
||||
/**
|
||||
* @brief Acknowledged Message Version.
|
||||
*/
|
||||
__READONLY_PROPERTY(uint8_t, ackVersion, AckVersion);
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__READONLY_PROPERTY(uint8_t, ackCorrelationTag, AckCorrelationTag);
|
||||
/**
|
||||
* @brief Response code.
|
||||
*/
|
||||
__PROPERTY(FSCAckResponseCode::E, responseCode, ResponseCode);
|
||||
/**
|
||||
* @brief Response Data Length.
|
||||
*/
|
||||
__PROPERTY(uint8_t, respLength, ResponseLength);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_ACK_H__
|
||||
@ -1,87 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* 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 FSCConnect.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCConnect.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_CONNECT_H__)
|
||||
#define __FSC_CONNECT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
#include "frames/fsc/FSCMessage.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace fsc
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements the FSC Connect Message.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCConnect : public FSCMessage {
|
||||
public:
|
||||
static const uint8_t LENGTH = 11;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCConnect class.
|
||||
*/
|
||||
FSCConnect();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCConnect class.
|
||||
* @param data Buffer to containing FSCConnect to decode.
|
||||
*/
|
||||
FSCConnect(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a FSC connect frame.
|
||||
* @param[in] data Buffer to containing FSCConnect to decode.
|
||||
*/
|
||||
bool decode(const uint8_t* data) override;
|
||||
/**
|
||||
* @brief Encode a FSC connect frame.
|
||||
* @param[out] data Buffer to encode a FSCConnect.
|
||||
*/
|
||||
void encode(uint8_t* data) override;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Voice Conveyance RTP Port.
|
||||
*/
|
||||
__PROPERTY(uint16_t, vcBasePort, VCBasePort);
|
||||
/**
|
||||
* @brief SSRC Identifier for all RTP transmissions.
|
||||
*/
|
||||
__PROPERTY(uint32_t, vcSSRC, VCSSRC);
|
||||
/**
|
||||
* @brief Fixed Station Heartbeat Period.
|
||||
*/
|
||||
__PROPERTY(uint8_t, fsHeartbeatPeriod, FSHeartbeatPeriod);
|
||||
/**
|
||||
* @brief Host Heartbeat Period.
|
||||
*/
|
||||
__PROPERTY(uint8_t, hostHeartbeatPeriod, HostHeartbeatPeriod);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_CONNECT_H__
|
||||
@ -1,75 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* 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 "frames/FrameDefines.h"
|
||||
#include "frames/fsc/FSCResponse.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
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(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 dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_CONNECT_RESPONSE_H__
|
||||
@ -1,58 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* 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 FSCDisconnect.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCDisconnect.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_DISCONNECT_H__)
|
||||
#define __FSC_DISCONNECT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
#include "frames/fsc/FSCMessage.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace fsc
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements the FSC Disconnect Message.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCDisconnect : public FSCMessage {
|
||||
public:
|
||||
static const uint8_t LENGTH = 3;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCDisconnect class.
|
||||
*/
|
||||
FSCDisconnect();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCDisconnect class.
|
||||
* @param data Buffer to containing FSCDisconnect to decode.
|
||||
*/
|
||||
FSCDisconnect(uint8_t* data);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_DISCONNECT_H__
|
||||
@ -1,58 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* 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 FSCHeartbeat.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCHeartbeat.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_HEARTBEAT_H__)
|
||||
#define __FSC_HEARTBEAT_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
#include "frames/fsc/FSCMessage.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace fsc
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Implements the FSC Heartbeat Message.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCHeartbeat : public FSCMessage {
|
||||
public:
|
||||
static const uint8_t LENGTH = 3;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCHeartbeat class.
|
||||
*/
|
||||
FSCHeartbeat();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCHeartbeat class.
|
||||
* @param data Buffer to containing FSCHeartbeat to decode.
|
||||
*/
|
||||
FSCHeartbeat(uint8_t* data);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_HEARTBEAT_H__
|
||||
@ -1,82 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* 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 FSCMessage.h
|
||||
* @ingroup dfsi_fsc_frames
|
||||
* @file FSCMessage.cpp
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
#if !defined(__FSC_MESSAGE_H__)
|
||||
#define __FSC_MESSAGE_H__
|
||||
|
||||
#include "Defines.h"
|
||||
#include "common/Defines.h"
|
||||
#include "common/Log.h"
|
||||
#include "common/Utils.h"
|
||||
#include "frames/FrameDefines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
namespace fsc
|
||||
{
|
||||
// ---------------------------------------------------------------------------
|
||||
// Class Declaration
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Base class FSC messages derive from.
|
||||
* @ingroup dfsi_fsc_frames
|
||||
*/
|
||||
class HOST_SW_API FSCMessage {
|
||||
public:
|
||||
static const uint8_t LENGTH = 3;
|
||||
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCMessage class.
|
||||
*/
|
||||
FSCMessage();
|
||||
/**
|
||||
* @brief Initializes a copy instance of the FSCMessage class.
|
||||
* @param data Buffer to containing FSCMessage to decode.
|
||||
*/
|
||||
FSCMessage(uint8_t* data);
|
||||
|
||||
/**
|
||||
* @brief Decode a FSC message frame.
|
||||
* @param[in] data Buffer to containing FSCMessage to decode.
|
||||
*/
|
||||
virtual bool decode(const uint8_t* data);
|
||||
/**
|
||||
* @brief Encode a FSC message frame.
|
||||
* @param[out] data Buffer to encode a FSCMessage.
|
||||
*/
|
||||
virtual void encode(uint8_t* data);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Message ID.
|
||||
*/
|
||||
__PROTECTED_PROPERTY(FSCMessageType::E, messageId, MessageId);
|
||||
/**
|
||||
* @brief Message Version.
|
||||
*/
|
||||
__PROTECTED_READONLY_PROPERTY(uint8_t, version, Version);
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
__PROTECTED_READONLY_PROPERTY(uint8_t, correlationTag, CorrelationTag);
|
||||
};
|
||||
} // namespace fsc
|
||||
} // namespace dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_MESSAGE_H__
|
||||
@ -1,74 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Digital Voice Modem - DFSI V.24/UDP Software
|
||||
* 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 "frames/FrameDefines.h"
|
||||
|
||||
namespace p25
|
||||
{
|
||||
namespace dfsi
|
||||
{
|
||||
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(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 dfsi
|
||||
} // namespace p25
|
||||
|
||||
#endif // __FSC_RESPONSE_H__
|
||||
Loading…
Reference in new issue