/**
* Digital Voice Modem - Host Software
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* @package DVM / Host Software
*
*/
/*
* Copyright (C) 2022 by Bryan Biedenkapp N2PLL
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(__NXDN_LC__PACKET_INFORMATION_H__)
#define __NXDN_LC__PACKET_INFORMATION_H__
#include "Defines.h"
namespace nxdn
{
namespace lc
{
// ---------------------------------------------------------------------------
// Class Declaration
// Represents the packet information data for link control data.
// ---------------------------------------------------------------------------
class HOST_SW_API PacketInformation {
public:
/// Initializes a new instance of the PacketInformation class.
PacketInformation();
/// Finalizes a instance of the PacketInformation class.
~PacketInformation();
/// Decodes packet information.
bool decode(const uint8_t messageType, const uint8_t* data);
/// Encodes packet information.
void encode(const uint8_t messageType, uint8_t* data);
/// Helper to reset data values to defaults.
void reset();
public:
/** Common Data **/
/// Flag indicating if confirmed delivery is needed.
__PROPERTY(bool, delivery, Delivery);
/// Flag indicating if the packet is a selective retry packet.
__PROPERTY(bool, selectiveRetry, SelectiveRetry);
/// Count of data blocks in t he transmission packet.
__PROPERTY(uint8_t, blockCount, BlockCount);
/// Number of padding octets of the last block.
__PROPERTY(uint8_t, padCount, PadCount);
/// Flag indicating the first fragment.
__PROPERTY(bool, start, Start);
/// Flag indicating if the Tx fragment count circulates.
__PROPERTY(bool, circular, Circular);
/// The number and sequence of fragments.
__PROPERTY(uint16_t, fragmentCount, FragmentCount);
/** Response Data */
/// Response class.
__PROPERTY(uint8_t, rspClass, ResponseClass);
/// Response type.
__PROPERTY(uint8_t, rspType, ResponseType);
/// Error Block Flag.
__PROPERTY(uint16_t, rspErrorBlock, ResponseErrorBlock);
};
} // namespace lc
} // namespace nxdn
#endif // __NXDN_LC__PACKET_INFORMATION_H__