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

#ifndef JEDGE_SERIALDEVICEBASE_H
#define JEDGE_SERIALDEVICEBASE_H

#include <qlibc/QData.hpp>


namespace jedge {

    class JE_API SerialDeviceBase :
            public qlibc::QData {

    public:
        explicit SerialDeviceBase(const qlibc::QData& data) : qlibc::QData(data) { } ;

        virtual size_t writeRawData(unsigned char *data, std::size_t  len, unsigned int cmd_gap = 0) = 0;

        ~SerialDeviceBase() override = default;

        virtual SerialDeviceBase& root(){
            return *this;
        };

    };
}

#endif //JEDGE_SERIALDEVICEBASE_H
