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.
109 lines
3.8 KiB
109 lines
3.8 KiB
/*
|
|
* Copyright (C) 2011-2015 by Jonathan Naylor G4KLX
|
|
*
|
|
* 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; either version 2 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 for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*/
|
|
|
|
#ifndef DStarRepeaterTXThread_H
|
|
#define DStarRepeaterTXThread_H
|
|
|
|
#include "DStarRepeaterThread.h"
|
|
#include "OutputQueue.h"
|
|
#include "HeaderData.h"
|
|
#include "AMBEFEC.h"
|
|
#include "Timer.h"
|
|
#if defined(MQTT)
|
|
#include "MQTTPublisher.h"
|
|
#endif
|
|
|
|
#include <wx/wx.h>
|
|
|
|
class CDStarRepeaterTXThread : public IDStarRepeaterThread {
|
|
public:
|
|
CDStarRepeaterTXThread(const wxString& type);
|
|
virtual ~CDStarRepeaterTXThread();
|
|
|
|
virtual void setCallsign(const wxString& callsign, const wxString& gateway, DSTAR_MODE mode, ACK_TYPE ack, bool restriction, bool rpt1Validation, bool dtmfBlanking, bool errorReply);
|
|
virtual void setProtocolHandler(CRepeaterProtocolHandler* handler, bool local);
|
|
virtual void setModem(CModem* modem);
|
|
virtual void setController(CExternalController* controller, unsigned int activeHangTime);
|
|
virtual void setTimes(unsigned int timeout, unsigned int ackTime);
|
|
virtual void setBeacon(unsigned int time, const wxString& text, bool voice, TEXT_LANG language);
|
|
virtual void setAnnouncement(bool enabled, unsigned int time, const wxString& recordRPT1, const wxString& recordRPT2, const wxString& deleteRPT1, const wxString& deleteRPT2);
|
|
virtual void setOutputs(bool out1, bool out2, bool out3, bool out4);
|
|
virtual void setLogging(bool logging, const wxString& dir);
|
|
virtual void setWhiteList(CCallsignList* list);
|
|
virtual void setBlackList(CCallsignList* list);
|
|
virtual void setGreyList(CCallsignList* list);
|
|
|
|
virtual void shutdown();
|
|
virtual void startup();
|
|
|
|
virtual void command1();
|
|
virtual void command2();
|
|
virtual void command3();
|
|
virtual void command4();
|
|
virtual void command5();
|
|
virtual void command6();
|
|
|
|
virtual CDStarRepeaterStatusData* getStatus();
|
|
|
|
virtual void kill();
|
|
|
|
virtual void *Entry();
|
|
|
|
private:
|
|
wxString m_type;
|
|
CModem* m_modem;
|
|
CRepeaterProtocolHandler* m_protocolHandler;
|
|
bool m_stopped;
|
|
wxString m_rptCallsign;
|
|
CHeaderData* m_txHeader;
|
|
COutputQueue** m_networkQueue;
|
|
unsigned int m_writeNum;
|
|
unsigned int m_readNum;
|
|
unsigned char m_networkSeqNo;
|
|
CTimer m_watchdogTimer;
|
|
CTimer m_registerTimer;
|
|
CTimer m_statusTimer;
|
|
DSTAR_RPT_STATE m_state;
|
|
bool m_tx;
|
|
unsigned int m_space;
|
|
bool m_killed;
|
|
unsigned char* m_lastData;
|
|
CAMBEFEC m_ambe;
|
|
wxStopWatch m_headerTime;
|
|
wxStopWatch m_packetTime;
|
|
unsigned int m_packetCount;
|
|
unsigned int m_packetSilence;
|
|
|
|
#if defined(MQTT)
|
|
CTimer m_mqttStatusTimer;
|
|
#endif
|
|
|
|
void transmitNetworkHeader(CHeaderData* header);
|
|
void transmitNetworkData();
|
|
void transmitNetworkHeader();
|
|
|
|
void receiveModem();
|
|
void receiveNetwork();
|
|
void processNetworkHeader(CHeaderData* header);
|
|
unsigned int processNetworkFrame(unsigned char* data, unsigned int length, unsigned char seqNo);
|
|
void endOfNetworkData();
|
|
void clock(unsigned int ms);
|
|
};
|
|
|
|
#endif
|