You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
3.3 KiB
75 lines
3.3 KiB
/////////////////////////////////////////////////////////////////////////////////// |
|
// Copyright (C) 2026 Dan Chokola, KD2HSG // |
|
// // |
|
// This program is free software; you can redistribute it and/or modify // |
|
// it under the terms of the GNU General Public License as published by // |
|
// the Free Software Foundation as version 3 of the License, or // |
|
// (at your option) any later version. // |
|
// // |
|
// This program is distributed in the hope that it will be useful, // |
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of // |
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
|
// GNU General Public License V3 for more details. // |
|
// // |
|
// You should have received a copy of the GNU General Public License // |
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. // |
|
/////////////////////////////////////////////////////////////////////////////////// |
|
|
|
#ifndef INCLUDE_CHIRPMODEMMODMESSAGES_H |
|
#define INCLUDE_CHIRPMODEMMODMESSAGES_H |
|
|
|
#include <QByteArray> |
|
#include <QDateTime> |
|
#include <QString> |
|
|
|
#include "util/message.h" |
|
|
|
namespace ChirpModemModMessages { |
|
|
|
//! What to send. Empty optional fields take their values from the settings. |
|
struct TxRequest { |
|
bool m_override = false; //!< Use m_source, m_destination and m_message below |
|
QString m_source; |
|
QString m_destination; |
|
QByteArray m_body; |
|
}; |
|
|
|
//! Transmitter state, sent by the DSP thread when it changes |
|
struct Status { |
|
QString m_event; //!< What happened: queued, started, sent, aborted, error |
|
QString m_error; //!< Last error, empty if the last request was accepted |
|
bool m_transmitting = false; |
|
int m_queueLength = 0; //!< Transmissions waiting, not counting the one on air |
|
qint64 m_framesSent = 0; //!< Since the channel started |
|
qint64 m_transmissions = 0; //!< Requests completed, with their CW ID |
|
double m_airtime = 0; //!< Seconds of samples sent with signal, since the channel started |
|
double m_lastDuration = 0; //!< Seconds of the last transmission generated |
|
int m_channelSampleRate = 0; |
|
int m_ifOffset = 0; //!< Residual channel offset the frames are generated at |
|
}; |
|
|
|
class MsgTx : public Message { |
|
MESSAGE_CLASS_DECLARATION |
|
public: |
|
static MsgTx *create(const TxRequest& request = TxRequest()) { return new MsgTx(request); } |
|
const TxRequest& getRequest() const { return m_request; } |
|
|
|
private: |
|
explicit MsgTx(const TxRequest& request) : m_request(request) {} |
|
TxRequest m_request; |
|
}; |
|
|
|
class MsgStatus : public Message { |
|
MESSAGE_CLASS_DECLARATION |
|
public: |
|
static MsgStatus *create(const Status& status) { return new MsgStatus(status); } |
|
const Status& getStatus() const { return m_status; } |
|
|
|
private: |
|
explicit MsgStatus(const Status& status) : m_status(status) {} |
|
Status m_status; |
|
}; |
|
|
|
} // namespace ChirpModemModMessages |
|
|
|
#endif
|
|
|