re-organize folder structure

This commit is contained in:
Maik Jurischka
2025-12-19 13:04:26 +01:00
parent 01ef031fcd
commit 34ed5b2216
20 changed files with 22 additions and 15 deletions

33
include/socketclient.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef SOCKETCLIENT_H
#define SOCKETCLIENT_H
#include <QObject>
#include <QString>
#include <QJsonDocument>
#include <QJsonObject>
#include <functional>
class SocketClient : public QObject
{
Q_OBJECT
public:
explicit SocketClient(const QString& socketPath = "/tmp/vizion_control.sock", QObject *parent = nullptr);
using ResponseCallback = std::function<void(const QJsonObject&)>;
using ErrorCallback = std::function<void(const QString&)>;
void sendCommand(const QString& command, const QJsonObject& params = QJsonObject(),
ResponseCallback onSuccess = nullptr, ErrorCallback onError = nullptr);
signals:
void commandSuccess(const QJsonObject& response);
void commandError(const QString& errorMessage);
void connectionError(const QString& errorMessage);
private:
QString m_socketPath;
QJsonObject executeCommand(const QString& command, const QJsonObject& params);
};
#endif // SOCKETCLIENT_H