diff options
| author | Christoph Berg <myon@debian.org> | 2026-04-07 19:02:45 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-04-07 19:02:45 +0200 |
| commit | f647d78463c1250ce9c99af664615fafccf5e959 (patch) | |
| tree | 5b00428cef68aef1c9d407e2d4535687422419b6 /map65/liveCQSender.hpp | |
| parent | 0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff) | |
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'map65/liveCQSender.hpp')
| -rw-r--r-- | map65/liveCQSender.hpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/map65/liveCQSender.hpp b/map65/liveCQSender.hpp new file mode 100644 index 00000000..b4f6db66 --- /dev/null +++ b/map65/liveCQSender.hpp @@ -0,0 +1,57 @@ +#ifndef LIVECQSENDER_HPP_ +#define LIVECQSENDER_HPP_ +#include <boost/log/sources/severity_channel_logger.hpp> +#include <boost/log/trivial.hpp> +#include <QObject> +#include <QTimer> +#include <QSslSocket> +#include <QScopedPointer> +#include "../qt_helpers.hpp" +#include "commons.h" + +class QString; + +class liveCQSender : public QObject +{ + Q_OBJECT + +signals: + void dataReady(const QByteArray &payload); + +public slots: + void init(); // Slot to initialize timers/sockets + + +public: + explicit liveCQSender (QString const& myCall, QString const& myGrid, QString const& theUrl); + ~liveCQSender (); + + void reconnect (); + + // + // Returns false if PSK Reporter connection is not available + // + void addRemoteStation (QByteArray const& postByteArray, QString const& theUrl); + + Q_SIGNAL void errorOccurred (QString const& reason); + +private slots: + void handle_socket_error(QAbstractSocket::SocketError error); + void onConnected(); + void onReadyRead(); + void sendData(const QByteArray &payload); + +private: + using logger_type = boost::log::sources::severity_channel_logger_mt<boost::log::trivial::severity_level>; + logger_type mutable logger_; + QString m_myCall; + QString m_myGrid; + QString m_theUrl; + QScopedPointer<QSslSocket> socket; // Or: std::unique_ptr<QSslSocket + QList<QByteArray> onConnectedRequests; + + // Copy constructor and assignment operator disabled + Q_DISABLE_COPY(liveCQSender) +}; + +#endif |
