diff --git a/README.md b/README.md index 9840779..145f521 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 @@ -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.* diff --git a/dmrcodec.cpp b/dmrcodec.cpp index e04898a..23b17d5 100644 --- a/dmrcodec.cpp +++ b/dmrcodec.cpp @@ -413,6 +413,7 @@ void DMRCodec::stop_tx() m_tx = false; } + void DMRCodec::transmit() { uint8_t ambe[72]; diff --git a/dmrcodec.h b/dmrcodec.h index a107135..b581219 100644 --- a/dmrcodec.h +++ b/dmrcodec.h @@ -20,6 +20,7 @@ #include #include +#include #include "audioengine.h" #include "serialambe.h" #include "mbedec.h" @@ -123,7 +124,6 @@ private slots: uint8_t m_ambe[27]; QQueue m_rxambeq; QQueue m_ambeq; - #ifdef USE_FLITE cst_voice *voice_slt; cst_voice *voice_kal; diff --git a/dudeshield.cpp b/dudeshield.cpp index e956625..171a221 100644 --- a/dudeshield.cpp +++ b/dudeshield.cpp @@ -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) { @@ -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); @@ -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); @@ -2526,7 +2532,7 @@ void DudeShield::saveLog() } } -void DudeShield::on_cbGPIOON_stateChanged(int arg1) +void DudeShield::on_cbGPIOON_stateChanged(int) { if (ui->cbGPIOON->isChecked()) { @@ -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()); + } +} diff --git a/dudeshield.h b/dudeshield.h index 9e41c5b..062c0eb 100644 --- a/dudeshield.h +++ b/dudeshield.h @@ -24,6 +24,7 @@ #include #include #include +#include #ifdef USE_FLITE #include #endif @@ -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 m_dmrids; QMap nxdnids; const unsigned char header[5] = {0x80,0x44,0x53,0x56,0x54}; //DVSI packet header @@ -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*); }; diff --git a/dudeshield.ui b/dudeshield.ui index 411110c..3b6457c 100644 --- a/dudeshield.ui +++ b/dudeshield.ui @@ -6,8 +6,8 @@ 0 0 - 340 - 471 + 353 + 526 @@ -35,8 +35,8 @@ Main - - + + 0 @@ -44,36 +44,19 @@ - Mic Gain + - - - - - - - - - - - - - + + - TTS1 + Module - - - - - - - - + + 0 @@ -81,12 +64,19 @@ - RPTR1 + URCALL - - + + + + IAX DTMF + + + + + 0 @@ -98,44 +88,37 @@ - - + + - Mute + Mode - - - - Codec output gain adjust. This is not an audio device volume control. 0 = no adjustment to codec output. - - - Qt::Horizontal - - - QSlider::NoTicks + + + + + 0 + 0 + - - - - - TTS2 + Volume - - + + - Mode + Private - - - - Qt::Horizontal + + + + Send @@ -149,6 +132,9 @@ + + + @@ -156,11 +142,8 @@ - - - - - + + 0 @@ -172,21 +155,35 @@ - - + + - + 0 0 - Volume + Mic Gain - - + + + + + + + + + + + + + + + + 0 @@ -194,19 +191,12 @@ - - - - - - - - Private + RPTR2 - - + + 0 @@ -214,31 +204,40 @@ - MYCALL + StreamID - - + + - SWRX + TTS2 - - + + - Module + Codec Gain - - + + + + + 0 + 0 + + - TTS3 + + + + @@ -246,18 +245,8 @@ - - - - Audio capture device gain adjust . - - - Qt::Horizontal - - - - - + + 0 @@ -265,26 +254,19 @@ - Talkgroup - - - - - - - Mute + SWTX - - - - Codec Gain + + + + Qt::Horizontal - - + + 0 @@ -292,22 +274,25 @@ - SWTX + RPTR1 - - + + - + Codec output gain adjust. This is not an audio device volume control. 0 = no adjustment to codec output. - - TX + + Qt::Horizontal + + + QSlider::NoTicks - - + + 0 @@ -315,17 +300,14 @@ - RPTR2 + - - - - - 50 - 16777215 - + + + + SWRX @@ -342,21 +324,18 @@ - - - - - 0 - 0 - - + + + + + - URCALL + Mute - - + + 0 @@ -364,12 +343,19 @@ - StreamID + MYCALL - - + + + + 2 + + + + + 0 @@ -381,56 +367,77 @@ - - - - - 0 - 0 - + + + + + 50 + 16777215 + + + + + - + Mute - - - - - 0 - 0 - + + + + TTS1 + + + + - + TTS3 - - - - 2 + + + + Audio capture device gain adjust . - + + Qt::Horizontal + + - - + + + + + 0 + 0 + + - IAX DTMF + Talkgroup - - + + + + + + + TX + + - - + + - Send + Hold TX @@ -453,9 +460,9 @@ 0 - -316 - 303 - 704 + 0 + 350 + 768