// SPDX-FileCopyrightText: 2013-2021 Tobias Lorenz <tobias.lorenz@gmx.net>
//
// SPDX-License-Identifier: GPL-3.0-or-later

#pragma once

#include <Vector/BLF/platform.h>

#include <Vector/BLF/AbstractFile.h>
#include <Vector/BLF/ObjectHeader2.h>

#include <Vector/BLF/vector_blf_export.h>

namespace Vector {
namespace BLF {

/**
 * @brief MOST_STATISTICEX
 *
 * Event transports some bus statistic information that was previously (until CANoe/
 * CANalyzerVersion 6.1) carried by the main bus statistic event but was not logged. Usually the
 * event is not visible in a Trace window.
 */
struct VECTOR_BLF_EXPORT MostStatisticEx final : ObjectHeader2 {
    MostStatisticEx();

    void read(AbstractFile & is) override;
    void write(AbstractFile & os) override;
    uint32_t calculateObjectSize() const override;

    /**
     * @brief application channel
     *
     * Application channel
     */
    uint16_t channel {};

    /** reserved */
    uint16_t reservedMostStatisticEx1 {};

    /**
     * Number of coding errors
     */
    uint32_t codingErrors {};

    /**
     * MOST frame counter
     */
    uint32_t frameCounter {};

    /** reserved */
    uint32_t reservedMostStatisticEx2 {};
};

}
}
