#ifndef NTPSERVERPROTOCOLBM_H
#define NTPSERVERPROTOCOLBM_H

#include "DeviceProtocolBase.h"
#include "dto/NtpServerStatusDto.h"
#include "dto/CommandReplyDto.h"

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

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

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

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

    enum NTP_SERVER_FRAME_TYPE
    {
        UNKNOW_FRAME = 0,
        STATUS_FRAME = 1,
        CMDREP_FRAME = 2
    };
};

#endif // NTPSERVERPROTOCOLBM_H
