Loading...
Searching...
No Matches
MQTTProtocolSettingsWidget.hpp
1#pragma once
2#include <Device/Protocol/DeviceSettings.hpp>
3#include <Device/Protocol/ProtocolSettingsWidget.hpp>
4
5#include <Protocols/MQTT/MQTTSpecificSettings.hpp>
6
7#include <verdigris>
8
9class QStackedLayout;
10class QLineEdit;
11class QSpinBox;
12class QWidget;
13
14namespace Protocols
15{
16
17class BasicTCPWidget;
18class WebsocketClientWidget;
19class RateWidget;
20
21enum class MqttProtocol
22{
23 TCP = 0,
24 WSClient = 1,
25};
26
27class MQTTTransportWidget : public QWidget
28{
29public:
30 explicit MQTTTransportWidget(
31 Device::ProtocolSettingsWidget& proto, QWidget* parent = nullptr);
32
33 void setCurrentProtocol(MqttProtocol index);
34 ossia::net::mqtt5_configuration configuration(MqttProtocol index) const noexcept;
35 MqttProtocol setConfiguration(const ossia::net::mqtt5_configuration& conf);
36
37private:
38 QStackedLayout* m_transportLayout{};
39
40 BasicTCPWidget* m_tcp{};
41 WebsocketClientWidget* m_ws_client{};
42};
43
45{
46public:
47 explicit MQTTProtocolSettingsWidget(QWidget* parent = nullptr);
48
49 Device::DeviceSettings getSettings() const override;
50 void setSettings(const Device::DeviceSettings& settings) override;
51
52 using Device::ProtocolSettingsWidget::checkForChanges;
53
54private:
55 void setDefaults();
56 QLineEdit* m_deviceNameEdit{};
57 RateWidget* m_rate{};
58 QComboBox* m_transport{};
59 MQTTTransportWidget* m_transportWidget{};
60 MQTTSpecificSettings m_settings;
61};
62}
Definition ProtocolSettingsWidget.hpp:22
Definition TCPWidget.hpp:18
Definition MQTTProtocolSettingsWidget.hpp:45
Definition MQTTProtocolSettingsWidget.hpp:28
Definition RateWidget.hpp:15
Definition WebsocketClientWidget.hpp:12
Definition DeviceSettings.hpp:20
Definition MQTTSpecificSettings.hpp:12