#pragma once

#include <cstdint>

#include <QString>
#include <QVector>

#include "core/models/Types.h"

namespace softbus::core::models
{

enum class Endianness : std::uint8_t
{
    BigEndian = 0,
    LittleEndian,
    BigEndianByteSwap
};

struct DataPointMapping
{
    QString    pointId;
    QString    metadataId;
    std::uint32_t registerAddress{0xFFFFFFFFu}; // 可选：用于按地址匹配
    std::uint16_t byteOffset{0};
    std::uint16_t byteLength{0};
    std::int8_t bitOffset{-1};
    Endianness endianness{Endianness::BigEndian};
    DataType   rawType{DataType::INT32};
    double     scaleFactor{1.0};
    double     offsetFactor{0.0};
    QString    expression;
};

struct DeviceDataProfile
{
    QString                  deviceId;
    QString                  protocol;
    QVector<DataPointMapping> mappings;
};

} // namespace softbus::core::models
