/* ************************************************************************** * Copyright (C) 2023 INAF * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 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 Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * * Authors: * * <>Valerio Pastore INAF-OAS Bologna valerio.pastore@inaf.it **************************************************************************** */ #pragma once #include <Base_Packet.h> namespace inaf::oasbo::Packets { /** * @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 { public: /** * @brief Constructs an AstriHornGeneric object with the given packet structure. * * @param structure The packet structure to be used. */ AstriHornGeneric(inaf::oasbo::Packets::BasePacketStructure &structure) : BasePacket(structure) { } /** * @brief Gets the size of the header in bytes. * * @return The size of the header. */ uint getHeaderSize() const override; /** * @brief Gets the size of the payload in bytes. * * @return The size of the payload. */ uint getPayloadSize() const override; /** * @brief Gets the size of the tail in bytes. * * @return The size of the tail. */ uint getTailSize() const override; /** * @brief Checks if the packet has a recognized header. * * @return True if the packet has a recognized header, false otherwise. */ bool hasRecognizedHeader() const override; /** * @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; }; }