#ifndef TIMEREPLICATORPROTOCOLBM_H
#define TIMEREPLICATORPROTOCOLBM_H

#include <QObject>

#include "common/utils/QByteUtil.h"
#include "DeviceStatusProtocolBase.h"
#include "dto/TimeReplicatorStatusDto.h"

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

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

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

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

#endif // TIMEREPLICATORPROTOCOLBM_H
