//
// Created by Ht on 2020/5/21.
//

#ifndef JEDGE_SERIALHOLDERINTERFACE_H
#define JEDGE_SERIALHOLDERINTERFACE_H


#include "SerialDeviceBase.h"
#include <qlibc/qlibc.h>

namespace jedge {
    
    class JE_API  SerialHolderInterface {
    public:
        virtual void getSubDeviceType(qlibc::QData &response, string &devType) = 0;

        virtual void getSubDeviceId(qlibc::QData &response, string &devType) = 0;

        virtual const string& getSerialType() = 0;

        virtual bool writeSerialData(uint8_t* pWrite_buf, int32_t len, unsigned int cmd_gap = 0) = 0;
    };

    using SerialRebufferMaker = std::function<bool(const QByte *srcbuff, int32_t srclen, QRByte &newbuff, size_t& newlen)>;
    using SerialRebufferMakerR = std::shared_ptr<SerialRebufferMaker>;
}

#endif //JEDGE_SERIALHOLDERINTERFACE_H
