Skip to content

Commit

Permalink
Add Hold button to keep tx online
Browse files Browse the repository at this point in the history
  • Loading branch information
Artemia76 committed Sep 21, 2021
1 parent 27ac2f2 commit 22fbe9b
Show file tree
Hide file tree
Showing 6 changed files with 306 additions and 182 deletions.
45 changes: 42 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# DUDE-Star
# DUDE-Shield
Software to RX/TX D-STAR, DMR, Fusion YSF/FCS, NXDN, P25, M17, and IAX (AllStar client) over UDP

This software is a fork based on initial porject named DUDE-Star, available on github :
https://github.com/nostar/dudestar

This software connects to D-STAR, Fusion, NXDN, P25, M17 reflectors and AllStar nodes (as an IAX2 client) over UDP. It is compatible with all of the AMBE3000 based USB devices out there (ThumbDV, DVstick 30, DVSI, etc). It includes software decoding and encoding support, using experimental open source IMBE/AMBE vocoder software. This software is open source and uses the cross platform C++ library called Qt. It will build and run on Linux, Windows, and Mac OSX.

This software makes use of software from a number of other open source software projects, including MMDVMHost, MMDVM_CM, XLXD, DSDcc, MBELIB, op25 (GNU Radio), mvoice, and others. Not only is software from these projects being used directly, but learning about the various network protocols and encoding/decoding of the various protocols was only possible thanks to the authors of all of these software projects.
Expand Down Expand Up @@ -42,11 +45,31 @@ Port: UDP port of node, usually 4569.

Add DTMF commands like \*3node, \*1node, \*70, etc in the IAX DTMF box and hit send to send the DTMF string. The asterisk (*) character is already added on the Droidstar app, so only input the numeric portion of the command (70 instead of *70, etc). Details on various commands can be found at the AllStar wiki and others.

# Compiling on Windows
The best way to build Dude Shield on windows is to install in order :
- Microsoft Visual Studio Community Edition
https://visualstudio.microsoft.com/fr/

- QT Installer
https://www.qt.io/download-qt-installer

Once each software are installed, you can open DudeShield Project with QtCreator and build the solution

Release are also available on github with a 64bit installer for windows.

# Compiling on MacOS

you need before Xcode from Apple Store to be able build binaries.
Then QT Installer https://www.qt.io/download-qt-installer

# Compiling on Linux
This software is written in C++ on Linux and requires mbelib and QT5, and natually the devel packages to build. With these requirements met, run the following:
This software is written in C++ on Linux and requires QT5, and natually the devel packages to build. With these requirements met, run the following:
```
qmake
mkdir build
cd build
qmake ..
make
sudo make install
```
qmake may have a different name on your distribution i.e. on Fedora it's called qmake-qt5

Expand All @@ -58,6 +81,22 @@ And if pulseaudio is not currently installed:
```
sudo apt-get install pulseaudio
```
# Compiling on Rasperry (Raspbian) with GPIO support

Install and prepare dependencies:
```
sudo apt-get install libqt5multimedia5-plugins libqt5serialport5-dev qtmultimedia5-dev libqt5multimediawidgets5 libqt5multimedia5-plugins libqt5multimedia5 libpigpio-if-dev pigpiod piggpio-tools
sudo systemctl enable pigpiod
sudo systelctl start pigpiod
```
Then in git repository :
```
mkdir build
cd build
qmake ..
sudo make install
```

# Builds
64 and 32 bit Windows builds are available from the releases section. These are statically linked, stand-alone executables, no install required. *NO support for Windows builds, either building or using.*
1 change: 1 addition & 0 deletions dmrcodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ void DMRCodec::stop_tx()
m_tx = false;
}


void DMRCodec::transmit()
{
uint8_t ambe[72];
Expand Down
2 changes: 1 addition & 1 deletion dmrcodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <QObject>
#include <QtNetwork>
#include <QPushButton>
#include "audioengine.h"
#include "serialambe.h"
#include "mbedec.h"
Expand Down Expand Up @@ -123,7 +124,6 @@ private slots:
uint8_t m_ambe[27];
QQueue<char> m_rxambeq;
QQueue<char> m_ambeq;

#ifdef USE_FLITE
cst_voice *voice_slt;
cst_voice *voice_kal;
Expand Down
77 changes: 73 additions & 4 deletions dudeshield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ DudeShield::DudeShield(QWidget *parent) :
m_dmrcc(1),
m_dmrslot(2),
m_dmrcalltype(0),
m_tx_holding(0),
m_tx_hold_mem(0),
m_outlevel(0),
m_rxcnt(0)
{
Expand Down Expand Up @@ -160,7 +162,10 @@ void DudeShield::init_gui()
ui->editTTSTXT->hide();
#endif
ui->pushTX->setAutoFillBackground(true);
ui->pushTX->setStyleSheet("QPushButton:enabled { background-color: rgb(128, 195, 66); color: rgb(0,0,0); } QPushButton:pressed { background-color: rgb(180, 0, 0); color: rgb(0,0,0); }");
ui->pushTX->setStyleSheet("QPushButton:enabled { background-color: rgb(128, 195, 66); color: rgb(0,0,0); }");
ui->pushTX->update();
ui->pushHold->setAutoFillBackground(true);
ui->pushHold->setStyleSheet("QPushButton:enabled { background-color: rgb(128, 195, 66); color: rgb(0,0,0); }");
ui->pushTX->update();
ui->radioMic->setChecked(true);
ui->sliderCodecGain->setRange(100, 800);
Expand All @@ -170,8 +175,9 @@ void DudeShield::init_gui()
ui->sliderMic->setRange(0, 100);
ui->sliderMic->setValue(100);
ui->pushTX->setDisabled(true);
connect(ui->pushTX, SIGNAL(pressed()), this, SIGNAL(on_startTX()));
connect(ui->pushTX, SIGNAL(released()), this, SIGNAL(on_stopTX()));
connect(ui->pushTX, SIGNAL(pressed()), this, SLOT(on_pressTXButton()));
connect(ui->pushTX, SIGNAL(released()), this, SLOT(on_releaseTXButton()));
connect(ui->pushHold, SIGNAL(released()), this, SLOT(on_holdingButton()));
m17rates = new QButtonGroup();
m17rates->addButton(ui->radioButtonM173200, 1);
m17rates->addButton(ui->radioButtonM171600, 0);
Expand Down Expand Up @@ -2526,7 +2532,7 @@ void DudeShield::saveLog()
}
}

void DudeShield::on_cbGPIOON_stateChanged(int arg1)
void DudeShield::on_cbGPIOON_stateChanged(int)
{
if (ui->cbGPIOON->isChecked())
{
Expand All @@ -2540,3 +2546,66 @@ void DudeShield::on_cbGPIOON_stateChanged(int arg1)
ui->cbRXLEDPin->setEnabled(false);
}
}

void DudeShield::on_pressTXButton()
{
m_log->log(tr("TX button pressed"),Qt::magenta,LEVEL_NORMAL);
if (m_tx_holding)
{
if (m_tx_hold_mem)
{
m_tx_holding =false;
m_tx_hold_mem =false;
ui->pushTX->setStyleSheet("QPushButton:enabled { background-color: rgb(128, 195, 66); color: rgb(0,0,0); }");
ui->pushTX->update();
ui->pushHold->setStyleSheet("QPushButton:enabled { background-color: rgb(128, 195, 66); color: rgb(0,0,0); }");
ui->pushHold->update();
emit(on_stopTX());
}
if (!m_tx_hold_mem)
{
m_tx_hold_mem=true;
ui->pushTX->setStyleSheet("QPushButton:enabled { background-color: rgb(180, 0, 0); color: rgb(0,0,0); }");
ui->pushTX->update();
emit(on_startTX());
}
}
else
{
ui->pushTX->setStyleSheet("QPushButton:enabled { background-color: rgb(180, 0, 0); color: rgb(0,0,0); }");
ui->pushTX->update();
emit(on_startTX());
}
}

void DudeShield::on_releaseTXButton()
{
m_log->log(tr("TX button released"),Qt::magenta,LEVEL_NORMAL);
if (!m_tx_holding)
{
ui->pushTX->setStyleSheet("QPushButton:enabled { background-color: rgb(128, 195, 66); color: rgb(0,0,0); }");
ui->pushTX->update();
emit(on_stopTX());
}
}

void DudeShield::on_holdingButton()
{
m_log->log(tr("Holding button pressed"),Qt::magenta,LEVEL_NORMAL);
if (!m_tx_holding)
{
m_tx_holding=true;
ui->pushHold->setStyleSheet("QPushButton:enabled { background-color: rgb(180, 0, 0); color: rgb(0,0,0); }");
ui->pushHold->update();
}
else
{
m_tx_holding=false;
m_tx_hold_mem=false;
ui->pushHold->setStyleSheet("QPushButton:enabled { background-color: rgb(128, 195, 66); color: rgb(0,0,0); }");
ui->pushHold->update();
ui->pushTX->setStyleSheet("QPushButton:enabled { background-color: rgb(128, 195, 66); color: rgb(0,0,0); }");
ui->pushTX->update();
emit(on_stopTX());
}
}
8 changes: 8 additions & 0 deletions dudeshield.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <QLabel>
#include <QKeyEvent>
#include <QSettings>
#include <QPushButton>
#ifdef USE_FLITE
#include <flite/flite.h>
#endif
Expand Down Expand Up @@ -138,6 +139,8 @@ static void _callbackGPIOExt(int pi, unsigned int gpio,unsigned int level, uint3
bool hwtx;
bool hwrx;
bool hw_ambe_present;
bool m_tx_holding;
bool m_tx_hold_mem;
QMap<uint32_t, QString> m_dmrids;
QMap<uint16_t, QString> nxdnids;
const unsigned char header[5] = {0x80,0x44,0x53,0x56,0x54}; //DVSI packet header
Expand Down Expand Up @@ -220,9 +223,14 @@ private slots:

void on_cbGPIOON_stateChanged(int arg1);

void on_pressTXButton();
void on_releaseTXButton();
void on_holdingButton();

signals:
void on_startTX();
void on_stopTX();
void on_holdTX(QPushButton*);

};

Expand Down
Loading

0 comments on commit 22fbe9b

Please sign in to comment.