#ifndef FREQUENCYTUNINGPROTOCOLBM_H
#define FREQUENCYTUNINGPROTOCOLBM_H

#include <QObject>
#include <QList>

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

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

    // 解析数据
    bool parseDeviceFrameData(QByteArray rawData, DeviceFrameBaseDto * ftFrameData, int frameType);
    DeviceFrameBaseDto * frameFactory(int frameType);

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

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

    enum FREQUENCY_TUNING_FRAME_TYPE
    {
        UNKNOW_FRAME = 0,
        FREQ_FRAME = 1,
        PULSE_FRAME = 2,
        NETWORK_FRAME = 3
    };
};

#endif // FREQUENCYTUNINGPROTOCOLBM_H
