Added missing file manual to repo
This commit is contained in:
47
bctransmitter.h
Normal file
47
bctransmitter.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef BCTRANSMITTER_H
|
||||
#define BCTRANSMITTER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QQueue>
|
||||
#include <QMutex>
|
||||
#include <functional>
|
||||
#include <atomic>
|
||||
|
||||
#include <bcvalue.h>
|
||||
#include <bccandrivertinycan.h>
|
||||
|
||||
class BCTransmitter : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
explicit BCTransmitter(QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
|
||||
void onToggleConnectionState( bool connect );
|
||||
void enqueueValueCommand(BC::OpID opID, const BCValue& value);
|
||||
void processValueCommand(BC::OpID opID);
|
||||
|
||||
signals:
|
||||
|
||||
void commandFinished(int id, bool success);
|
||||
void messageLogged(const QString& msg);
|
||||
|
||||
private:
|
||||
|
||||
std::optional<uint32_t> executeRead(const BCValue& value);
|
||||
std::optional<uint32_t> executeWrite(const BCValue& value);
|
||||
|
||||
using BCValueQueue = QQueue<std::reference_wrapper<const BCValue>>;
|
||||
|
||||
BCValueQueue _valueQueue;
|
||||
QMutex _mutex;
|
||||
std::atomic<bool> _isBusy{ false };
|
||||
|
||||
BCCanDriverTinyCan _canDriver;
|
||||
};
|
||||
|
||||
|
||||
#endif // BCTRANSMITTER_H
|
||||
Reference in New Issue
Block a user