#pragma once #include "ByteArrayProvider.h" #include "EDeviceCommandStatus.h" #include #include #include namespace Incart::Usb { class ByteCommand : public QObject { Q_OBJECT protected: const int m_timeoutInterval; // ms std::string m_name; uint32_t m_uid; // unique identifier std::vector m_bytes; public: ByteCommand(const std::string& name, uint32_t uid, const std::vector& bytes, int timeoutInterval = 1000, QObject* parent = nullptr) : QObject(parent) , m_timeoutInterval(timeoutInterval) , m_name(name) , m_uid(uid) , m_bytes(bytes) { } ByteCommand(const std::string& name, uint32_t uid, std::vector&& bytes, int timeoutInterval = 1000, QObject* parent = nullptr) : QObject(parent) , m_timeoutInterval(timeoutInterval) , m_name(name) , m_uid(uid) , m_bytes(bytes) { } signals: void answerIsReady(std::shared_ptr command, std::vector answer, int32_t status); public: int getTimeoutInterval() { return m_timeoutInterval; } std::vector getBytes() { return m_bytes; } std::string getName() { return m_name; } uint32_t getUid() { return m_uid; } }; } // namespace Incart::Usb