You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dvmhost/src/dfsi/frames/MotStartOfStream.h

71 lines
2.7 KiB

// SPDX-License-Identifier: GPL-2.0-only
/**
* Digital Voice Modem - DFSI Peer Application
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* @package DVM / DFSI Peer Application
* @derivedfrom MMDVMHost (https://github.com/g4klx/MMDVMHost)
* @license GPLv2 License (https://opensource.org/licenses/GPL-2.0)
*
* Copyright (C) 2024 Patrick McDonnell, W3AXL
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
*
*/
#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
// Implements a P25 Motorola start of stream packet.
//
// 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 |
// + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// | |
// +-+-+-+-+-+-+-+-+
// ---------------------------------------------------------------------------
class HOST_SW_API MotStartOfStream {
public:
static const uint8_t LENGTH = 10;
static const uint8_t FIXED_MARKER = 0x02;
/// <summary>Initializes a copy instance of the MotStartOfStream class.</summary>
MotStartOfStream();
/// <summary>Initializes a copy instance of the MotStartOfStream class.</summary>
MotStartOfStream(uint8_t* data);
/// <summary>Decode a start of stream frame.</summary>
bool decode(const uint8_t* data);
/// <summary>Encode a start of stream frame.</summary>
void encode(uint8_t* data);
public:
/// <summary></summary>
__PROPERTY(uint8_t, marker, Marker);
/// <summary></summary>
__PROPERTY(RTFlag::E, rt, RT);
/// <summary></summary>
__PROPERTY(StartStopFlag::E, startStop, StartStop);
/// <summary></summary>
__PROPERTY(StreamTypeFlag::E, streamType, StreamType);
};
} // namespace dfsi
} // namespace p25
#endif // __MOT_START_OF_STREAM_H__

Powered by TurnKey Linux.