#ifndef FREQSWITCHERPROTOCOLBM_H
#define FREQSWITCHERPROTOCOLBM_H

#include <QObject>
#include <QList>

#include "protocol/DeviceStatusProtocolBase.h"
#include "protocol/dto/FreqSwitcherInterfaceDto.h"
#include "protocol/dto/FreqSwitcherStatusDto.h"

class FreqSwitcherProtocolBM : public DeviceStatusProtocolBase
{
    Q_OBJECT
public:
    explicit FreqSwitcherProtocolBM(QObject *parent = nullptr);
    ~FreqSwitcherProtocolBM();

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

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

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

    enum FREQ_SWITCHER_FRAME_TYPE
    {
        UNKNOW_FRAME = 0,
        INTERFACE_FRAME = 1,
        STATUS_FRAME = 2,
        NETWORK_FRAME = 3
    };
};

#endif // FREQSWITCHERPROTOCOLBM_H
