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