#ifndef FREQUENCYTUNINGPROTOCOLTX_H
#define FREQUENCYTUNINGPROTOCOLTX_H

#include <QObject>
#include <QList>

#include "protocol/DeviceProtocolBase.h"
#include "dto/FrequencyTuningStatusFreqDto.h"
#include "dto/FrequencyTuningStatusLockDto.h"
#include "dto/CommandReplyDto.h"

class FrequencyTuningProtocolTX : public DeviceProtocolBase
{
public:
    explicit FrequencyTuningProtocolTX(QObject *parent = nullptr);
    ~FrequencyTuningProtocolTX();

    // 解析数据
    bool parseDeviceFrameData(QByteArray rawData, DeviceFrameBaseDto * ftFrameData, int frameType);
    QByteArray generateSettingCommand(QString devCode, QString commandType, QString valueSet);
    DeviceFrameBaseDto * frameFactory(int frameType);

    //
    QList<QByteArray> extractFrameList(QByteArray rawData);

    // 检测帧格式，帧头帧尾
    int checkFrame(QByteArray rawData);

    enum FREQUENCY_TUNING_FRAME_TYPE
    {
        UNKNOW_FRAME = 0,
        STATUS_FRAME = 1,
        LOCK_FRAME = 2,
        CMDREP_FRAME = 3
    };
};

#endif // FREQUENCYTUNINGPROTOCOLTX_H
