Skip to content
Snippets Groups Projects
Astri_Horn_Generic.h 1.66 KiB
Newer Older
#pragma once

#include <Base_Packet.h>

namespace inaf::oasbo::Packets {

Valerio Pastore's avatar
Valerio Pastore committed
/**
 * @brief Represents a generic ASTRI horn packet.
 * @note the "magic numbers" in the implementation of this class derived from the ASTRI Camera BEE – Camera Camera Data Acquisition
 * Interface Control Document.
 * If the document is updated, be sure to update the magic numbers appropriately. 
 * This class inherits from the BasePacket class and provides
 * functionality specific to ASTRI horn packets.
 */
class AstriHornGeneric : public inaf::oasbo::Packets::BasePacket {
Valerio Pastore's avatar
Valerio Pastore committed
	/**
	 * @brief Constructs an AstriHornGeneric object with the given packet structure.
	 * 
	 * @param structure The packet structure to be used.
	 */
	AstriHornGeneric(inaf::oasbo::PacketLib::BasePacketStructure &structure) : BasePacket(structure){}
Valerio Pastore's avatar
Valerio Pastore committed

	/**
	 * @brief Gets the size of the header in bytes.
	 * 
	 * @return The size of the header.
	 */
	uint getHeaderSize() const override;
Valerio Pastore's avatar
Valerio Pastore committed

	/**
	 * @brief Gets the size of the payload in bytes.
	 * 
	 * @return The size of the payload.
	 */
	uint getPayloadSize() const override;
Valerio Pastore's avatar
Valerio Pastore committed

	/**
	 * @brief Gets the size of the tail in bytes.
	 * 
	 * @return The size of the tail.
	 */
	uint getTailSize() const override;
Valerio Pastore's avatar
Valerio Pastore committed

	/**
	 * @brief Checks if the packet has a recognized header.
	 * 
	 * @return True if the packet has a recognized header, false otherwise.
	 */
Valerio Pastore's avatar
Valerio Pastore committed
	bool hasRecognizedHeader() const override;
Valerio Pastore's avatar
Valerio Pastore committed

	/**
	 * @brief Checks if the given buffer contains a recognized header.
	 * 
	 * @param buff The buffer to check.
	 * @return True if the buffer contains a recognized header, false otherwise.
	 */
	bool isRecognizedHeader(std::vector<uint8_t> buff) const override;
};

Valerio Pastore's avatar
Valerio Pastore committed
}