ios defines and update readme about ios support

pull/4/head
Doug McLain 2 years ago
parent bebc6f81ac
commit 0741252310

@ -3,6 +3,9 @@ This software connects to M17, Fusion (YSF/FCS, DN and VW modes are supported),
This software makes use of software from a number of other open source software projects, including MMDVMHost, MMDVM_CM, 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. This software makes use of software from a number of other open source software projects, including MMDVMHost, MMDVM_CM, 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.
# DroidStar for iOS is no more
Apple recently made iOS SDK 15 the minimum requirement for apps on the app store. XCode 13 is required for this SDK, but macOS 11 is required for this version. My mac is a MacBook Pro 13 2012 which is unsupported by macOS 11, so I will no longer be able to provide an iOS version of DroidStar. I bought this MacBook, a used iphone 6s, and paid for a developer account all out of my own pocket to provide a free version of DroidStar for iOS. Since I have no other use for a mac or an iphone, at this time I have no plans to by new apple hardware.
# DudeStar, DroidStar, and Qt # DudeStar, DroidStar, and Qt
The DudeStar application used the Qt Widgets UI, while DroidStar uses the Qt Quick UI. All of the back end C/C++ source code for both projects has always been identical, but because of the different UI APIs, two repositories had to be maintained for the same project. Even though I prefer the Qt widgets UI over the Qt Quick UI for desktop applications, I have combined both projects into a single entity which is now simply called 'DroidStar'. My dudestar repo has been removed from github, but there are plenty of forks of it on github, in case anyone wishes to continue development of that version. The DudeStar application used the Qt Widgets UI, while DroidStar uses the Qt Quick UI. All of the back end C/C++ source code for both projects has always been identical, but because of the different UI APIs, two repositories had to be maintained for the same project. Even though I prefer the Qt widgets UI over the Qt Quick UI for desktop applications, I have combined both projects into a single entity which is now simply called 'DroidStar'. My dudestar repo has been removed from github, but there are plenty of forks of it on github, in case anyone wishes to continue development of that version.

@ -17,10 +17,9 @@
#include "audioengine.h" #include "audioengine.h"
#include <QDebug> #include <QDebug>
#include <QTimer>
#include <cmath> #include <cmath>
#ifdef Q_OS_MACOS #if defined (Q_OS_MACOS) || defined(Q_OS_IOS)
#define MACHAK 1 #define MACHAK 1
#else #else
#define MACHAK 0 #define MACHAK 0

@ -24,7 +24,6 @@
#include <QAudioOutput> #include <QAudioOutput>
#include <QAudioInput> #include <QAudioInput>
#include <QQueue> #include <QQueue>
#include <QDebug>
#define AUDIO_OUT 1 #define AUDIO_OUT 1
#define AUDIO_IN 0 #define AUDIO_IN 0

@ -81,9 +81,11 @@ Codec::~Codec()
void Codec::ambe_connect_status(bool s) void Codec::ambe_connect_status(bool s)
{ {
if(s){ if(s){
#if !defined(Q_OS_IOS)
m_modeinfo.ambedesc = m_ambedev->get_ambe_description(); m_modeinfo.ambedesc = m_ambedev->get_ambe_description();
m_modeinfo.ambeprodid = m_ambedev->get_ambe_prodid(); m_modeinfo.ambeprodid = m_ambedev->get_ambe_prodid();
m_modeinfo.ambeverstr = m_ambedev->get_ambe_verstring(); m_modeinfo.ambeverstr = m_ambedev->get_ambe_verstring();
#endif
} }
else{ else{
m_modeinfo.ambeprodid = "Connect failed"; m_modeinfo.ambeprodid = "Connect failed";
@ -96,7 +98,9 @@ void Codec::mmdvm_connect_status(bool s)
{ {
if(s){ if(s){
//m_modeinfo.mmdvmdesc = m_modem->get_mmdvm_description(); //m_modeinfo.mmdvmdesc = m_modem->get_mmdvm_description();
#if !defined(Q_OS_IOS)
m_modeinfo.mmdvm = m_modem->get_mmdvm_version(); m_modeinfo.mmdvm = m_modem->get_mmdvm_version();
#endif
} }
else{ else{
m_modeinfo.mmdvm = "Connect failed"; m_modeinfo.mmdvm = "Connect failed";
@ -147,9 +151,11 @@ void Codec::toggle_tx(bool tx)
void Codec::start_tx() void Codec::start_tx()
{ {
#if !defined(Q_OS_IOS)
if(m_hwtx){ if(m_hwtx){
m_ambedev->clear_queue(); m_ambedev->clear_queue();
} }
#endif
m_txcodecq.clear(); m_txcodecq.clear();
m_tx = true; m_tx = true;
m_txcnt = 0; m_txcnt = 0;
@ -191,7 +197,7 @@ bool Codec::load_vocoder_plugin()
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_WIN) #if !defined(Q_OS_ANDROID) && !defined(Q_OS_WIN)
config_path += "/dudetronics"; config_path += "/dudetronics";
#endif #endif
#if defined(Q_OS_ANDROID) #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
QString voc = config_path + "/vocoder_plugin." + QSysInfo::productType() + "." + QSysInfo::currentCpuArchitecture(); QString voc = config_path + "/vocoder_plugin." + QSysInfo::productType() + "." + QSysInfo::currentCpuArchitecture();
#else #else
QString voc = config_path + "/vocoder_plugin." + QSysInfo::kernelType() + "." + QSysInfo::currentCpuArchitecture(); QString voc = config_path + "/vocoder_plugin." + QSysInfo::kernelType() + "." + QSysInfo::currentCpuArchitecture();
@ -236,10 +242,20 @@ bool Codec::load_vocoder_plugin()
return false; return false;
} }
#endif #endif
#else
#if defined(Q_OS_IOS)
if(QFileInfo::exists(voc)){
m_mbevocoder = new VocoderPlugin();
return true;
}
else{
return false;
}
#else #else
m_mbevocoder = new VocoderPlugin(); m_mbevocoder = new VocoderPlugin();
return true; return true;
#endif #endif
#endif
} }
void Codec::deleteLater() void Codec::deleteLater()
@ -249,12 +265,14 @@ void Codec::deleteLater()
//m_ping_timer->stop(); //m_ping_timer->stop();
send_disconnect(); send_disconnect();
delete m_audio; delete m_audio;
#if !defined(Q_OS_IOS)
if(m_hwtx){ if(m_hwtx){
delete m_ambedev; delete m_ambedev;
} }
if(m_modem){ if(m_modem){
delete m_modem; delete m_modem;
} }
#endif
} }
m_modeinfo.count = 0; m_modeinfo.count = 0;
QObject::deleteLater(); QObject::deleteLater();

@ -30,8 +30,10 @@
#include <vocoder_plugin_api.h> #include <vocoder_plugin_api.h>
#endif #endif
#include "audioengine.h" #include "audioengine.h"
#if !defined(Q_OS_IOS)
#include "serialambe.h" #include "serialambe.h"
#include "serialmodem.h" #include "serialmodem.h"
#endif
class Codec : public QObject class Codec : public QObject
{ {
@ -184,8 +186,13 @@ protected:
#endif #endif
QString m_vocoder; QString m_vocoder;
QString m_modemport; QString m_modemport;
#if defined(Q_OS_IOS)
void *m_modem;
void *m_ambedev;
#else
SerialModem *m_modem; SerialModem *m_modem;
SerialAMBE *m_ambedev; SerialAMBE *m_ambedev;
#endif
bool m_hwrx; bool m_hwrx;
bool m_hwtx; bool m_hwtx;
bool m_ipv6; bool m_ipv6;

@ -65,22 +65,26 @@ void DCSCodec::process_udp()
m_hwrx = true; m_hwrx = true;
m_hwtx = true; m_hwtx = true;
m_modeinfo.hw_vocoder_loaded = true; m_modeinfo.hw_vocoder_loaded = true;
#if !defined(Q_OS_IOS)
m_ambedev = new SerialAMBE("DCS"); m_ambedev = new SerialAMBE("DCS");
m_ambedev->connect_to_serial(m_vocoder); m_ambedev->connect_to_serial(m_vocoder);
connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool))); connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool)));
connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe())); connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe()));
#endif
} }
else{ else{
m_hwrx = false; m_hwrx = false;
m_hwtx = false; m_hwtx = false;
} }
if(m_modemport != ""){ if(m_modemport != ""){
#if !defined(Q_OS_IOS)
m_modem = new SerialModem("DCS"); m_modem = new SerialModem("DCS");
m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex); m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex);
m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel); m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel);
m_modem->connect_to_serial(m_modemport); m_modem->connect_to_serial(m_modemport);
connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool))); connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool)));
connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray))); connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray)));
#endif
} }
m_rxtimer = new QTimer(); m_rxtimer = new QTimer();
connect(m_rxtimer, SIGNAL(timeout()), this, SLOT(process_rx_data())); connect(m_rxtimer, SIGNAL(timeout()), this, SLOT(process_rx_data()));
@ -388,7 +392,9 @@ void DCSCodec::transmit()
} }
} }
if(m_hwtx){ if(m_hwtx){
#if !defined(Q_OS_IOS)
m_ambedev->encode(pcm); m_ambedev->encode(pcm);
#endif
if(m_tx && (m_txcodecq.size() >= 9)){ if(m_tx && (m_txcodecq.size() >= 9)){
for(int i = 0; i < 9; ++i){ for(int i = 0; i < 9; ++i){
ambe[i] = m_txcodecq.dequeue(); ambe[i] = m_txcodecq.dequeue();
@ -529,6 +535,7 @@ void DCSCodec::send_frame(uint8_t *ambe)
void DCSCodec::get_ambe() void DCSCodec::get_ambe()
{ {
#if !defined(Q_OS_IOS)
uint8_t ambe[9]; uint8_t ambe[9];
if(m_ambedev->get_ambe(ambe)){ if(m_ambedev->get_ambe(ambe)){
@ -536,6 +543,7 @@ void DCSCodec::get_ambe()
m_txcodecq.append(ambe[i]); m_txcodecq.append(ambe[i]);
} }
} }
#endif
} }
void DCSCodec::process_rx_data() void DCSCodec::process_rx_data()
@ -559,7 +567,9 @@ void DCSCodec::process_rx_data()
for(int i = 0; i < s; ++i){ for(int i = 0; i < s; ++i){
out.append(m_rxmodemq.dequeue()); out.append(m_rxmodemq.dequeue());
} }
#if !defined(Q_OS_IOS)
m_modem->write(out); m_modem->write(out);
#endif
} }
} }
@ -568,12 +578,14 @@ void DCSCodec::process_rx_data()
ambe[i] = m_rxcodecq.dequeue(); ambe[i] = m_rxcodecq.dequeue();
} }
if(m_hwrx){ if(m_hwrx){
#if !defined(Q_OS_IOS)
m_ambedev->decode(ambe); m_ambedev->decode(ambe);
if(m_ambedev->get_audio(pcm)){ if(m_ambedev->get_audio(pcm)){
m_audio->write(pcm, 160); m_audio->write(pcm, 160);
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level());
} }
#endif
} }
else{ else{
if(m_modeinfo.sw_vocoder_loaded){ if(m_modeinfo.sw_vocoder_loaded){

@ -306,22 +306,26 @@ void DMRCodec::setup_connection()
m_hwrx = true; m_hwrx = true;
m_hwtx = true; m_hwtx = true;
m_modeinfo.hw_vocoder_loaded = true; m_modeinfo.hw_vocoder_loaded = true;
#if !defined(Q_OS_IOS)
m_ambedev = new SerialAMBE("DMR"); m_ambedev = new SerialAMBE("DMR");
m_ambedev->connect_to_serial(m_vocoder); m_ambedev->connect_to_serial(m_vocoder);
connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool))); connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool)));
connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe())); connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe()));
#endif
} }
else{ else{
m_hwrx = false; m_hwrx = false;
m_hwtx = false; m_hwtx = false;
} }
if(m_modemport != ""){ if(m_modemport != ""){
#if !defined(Q_OS_IOS)
m_modem = new SerialModem("DMR"); m_modem = new SerialModem("DMR");
m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex); m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex);
m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel); m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel);
m_modem->connect_to_serial(m_modemport); m_modem->connect_to_serial(m_modemport);
connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool))); connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool)));
connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray))); connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray)));
#endif
} }
m_audio = new AudioEngine(m_audioin, m_audioout); m_audio = new AudioEngine(m_audioin, m_audioout);
m_audio->init(); m_audio->init();
@ -468,7 +472,9 @@ void DMRCodec::transmit()
} }
if(m_hwtx){ if(m_hwtx){
#if !defined(Q_OS_IOS)
m_ambedev->encode(pcm); m_ambedev->encode(pcm);
#endif
} }
else{ else{
if(m_modeinfo.sw_vocoder_loaded){ if(m_modeinfo.sw_vocoder_loaded){
@ -896,6 +902,7 @@ void DMRCodec::addDMRAudioSync(uint8_t* data, bool duplex)
void DMRCodec::get_ambe() void DMRCodec::get_ambe()
{ {
#if !defined(Q_OS_IOS)
uint8_t ambe[9]; uint8_t ambe[9];
if(m_ambedev->get_ambe(ambe)){ if(m_ambedev->get_ambe(ambe)){
@ -903,6 +910,7 @@ void DMRCodec::get_ambe()
m_txcodecq.append(ambe[i]); m_txcodecq.append(ambe[i]);
} }
} }
#endif
} }
void DMRCodec::process_rx_data() void DMRCodec::process_rx_data()
@ -927,7 +935,9 @@ void DMRCodec::process_rx_data()
for(int i = 0; i < s; ++i){ for(int i = 0; i < s; ++i){
out.append(m_rxmodemq.dequeue()); out.append(m_rxmodemq.dequeue());
} }
#if !defined(Q_OS_IOS)
m_modem->write(out); m_modem->write(out);
#endif
} }
cnt = 0; cnt = 0;
} }
@ -937,12 +947,14 @@ void DMRCodec::process_rx_data()
ambe[i] = m_rxcodecq.dequeue(); ambe[i] = m_rxcodecq.dequeue();
} }
if(m_hwrx){ if(m_hwrx){
#if !defined(Q_OS_IOS)
m_ambedev->decode(ambe); m_ambedev->decode(ambe);
if(m_ambedev->get_audio(pcm)){ if(m_ambedev->get_audio(pcm)){
m_audio->write(pcm, 160); m_audio->write(pcm, 160);
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level());
} }
#endif
} }
else{ else{
if(m_modeinfo.sw_vocoder_loaded){ if(m_modeinfo.sw_vocoder_loaded){

@ -121,7 +121,7 @@ void DroidStar::discover_devices()
m_modems.append("None"); m_modems.append("None");
m_playbacks.append(AudioEngine::discover_audio_devices(AUDIO_OUT)); m_playbacks.append(AudioEngine::discover_audio_devices(AUDIO_OUT));
m_captures.append(AudioEngine::discover_audio_devices(AUDIO_IN)); m_captures.append(AudioEngine::discover_audio_devices(AUDIO_IN));
#if !defined(Q_OS_IOS)
QMap<QString, QString> l = SerialAMBE::discover_devices(); QMap<QString, QString> l = SerialAMBE::discover_devices();
QMap<QString, QString>::const_iterator i = l.constBegin(); QMap<QString, QString>::const_iterator i = l.constBegin();
@ -130,6 +130,7 @@ void DroidStar::discover_devices()
m_modems.append(i.value()); m_modems.append(i.value());
++i; ++i;
} }
#endif
} }
void DroidStar::download_file(QString f, bool u) void DroidStar::download_file(QString f, bool u)

@ -231,12 +231,14 @@ void M17Codec::process_udp()
m_modeinfo.status = CONNECTED_RW; m_modeinfo.status = CONNECTED_RW;
if(m_modemport != ""){ if(m_modemport != ""){
#if !defined(Q_OS_IOS)
m_modem = new SerialModem("M17"); m_modem = new SerialModem("M17");
m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex); m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex);
m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel); m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel);
m_modem->connect_to_serial(m_modemport); m_modem->connect_to_serial(m_modemport);
connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool))); connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool)));
connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray))); connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray)));
#endif
} }
#ifndef USE_EXTERNAL_CODEC2 #ifndef USE_EXTERNAL_CODEC2
m_c2 = new CCodec2(true); m_c2 = new CCodec2(true);
@ -366,12 +368,14 @@ void M17Codec::hostname_lookup(QHostInfo i)
void M17Codec::mmdvm_direct_connect() void M17Codec::mmdvm_direct_connect()
{ {
if(m_modemport != ""){ if(m_modemport != ""){
#if !defined(Q_OS_IOS)
m_modem = new SerialModem("M17"); m_modem = new SerialModem("M17");
m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex); m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex);
m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel); m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel);
m_modem->connect_to_serial(m_modemport); m_modem->connect_to_serial(m_modemport);
connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool))); connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool)));
connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray))); connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray)));
#endif
if(m_modeinfo.status == CONNECTING){ if(m_modeinfo.status == CONNECTING){
m_modeinfo.status = CONNECTED_RW; m_modeinfo.status = CONNECTED_RW;
} }
@ -946,7 +950,9 @@ void M17Codec::process_rx_data()
for(int i = 0; i < s; ++i){ for(int i = 0; i < s; ++i){
out.append(m_rxmodemq.dequeue()); out.append(m_rxmodemq.dequeue());
} }
#if !defined(Q_OS_IOS)
m_modem->write(out); m_modem->write(out);
#endif
} }
cnt = 0; cnt = 0;
} }

@ -25,6 +25,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
//QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);

@ -84,10 +84,12 @@ void NXDNCodec::process_udp()
m_hwrx = true; m_hwrx = true;
m_hwtx = true; m_hwtx = true;
m_modeinfo.hw_vocoder_loaded = true; m_modeinfo.hw_vocoder_loaded = true;
#if !defined(Q_OS_IOS)
m_ambedev = new SerialAMBE("NXDN"); m_ambedev = new SerialAMBE("NXDN");
m_ambedev->connect_to_serial(m_vocoder); m_ambedev->connect_to_serial(m_vocoder);
connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool))); connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool)));
connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe())); connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe()));
#endif
} }
else{ else{
m_hwrx = false; m_hwrx = false;
@ -310,7 +312,9 @@ void NXDNCodec::transmit()
} }
if(m_hwtx){ if(m_hwtx){
#if !defined(Q_OS_IOS)
m_ambedev->encode(pcm); m_ambedev->encode(pcm);
#endif
} }
else{ else{
if(m_modeinfo.sw_vocoder_loaded){ if(m_modeinfo.sw_vocoder_loaded){
@ -655,6 +659,7 @@ void NXDNCodec::encode_crc6(uint8_t *d, uint8_t len)
void NXDNCodec::get_ambe() void NXDNCodec::get_ambe()
{ {
#if !defined(Q_OS_IOS)
uint8_t ambe[7]; uint8_t ambe[7];
if(m_ambedev->get_ambe(ambe)){ if(m_ambedev->get_ambe(ambe)){
@ -662,6 +667,7 @@ void NXDNCodec::get_ambe()
m_txcodecq.append(ambe[i]); m_txcodecq.append(ambe[i]);
} }
} }
#endif
} }
void NXDNCodec::process_rx_data() void NXDNCodec::process_rx_data()
@ -683,12 +689,14 @@ void NXDNCodec::process_rx_data()
ambe[i] = m_rxcodecq.dequeue(); ambe[i] = m_rxcodecq.dequeue();
} }
if(m_hwrx){ if(m_hwrx){
#if !defined(Q_OS_IOS)
m_ambedev->decode(ambe); m_ambedev->decode(ambe);
if(m_ambedev->get_audio(pcm)){ if(m_ambedev->get_audio(pcm)){
m_audio->write(pcm, 160); m_audio->write(pcm, 160);
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level());
} }
#endif
} }
else{ else{
if(m_modeinfo.sw_vocoder_loaded){ if(m_modeinfo.sw_vocoder_loaded){

@ -94,22 +94,26 @@ void REFCodec::process_udp()
m_hwrx = true; m_hwrx = true;
m_hwtx = true; m_hwtx = true;
m_modeinfo.hw_vocoder_loaded = true; m_modeinfo.hw_vocoder_loaded = true;
#if !defined(Q_OS_IOS)
m_ambedev = new SerialAMBE("REF"); m_ambedev = new SerialAMBE("REF");
m_ambedev->connect_to_serial(m_vocoder); m_ambedev->connect_to_serial(m_vocoder);
connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool))); connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool)));
connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe())); connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe()));
#endif
} }
else{ else{
m_hwrx = false; m_hwrx = false;
m_hwtx = false; m_hwtx = false;
} }
if(m_modemport != ""){ if(m_modemport != ""){
#if !defined(Q_OS_IOS)
m_modem = new SerialModem("REF"); m_modem = new SerialModem("REF");
m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex); m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex);
m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel); m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel);
m_modem->connect_to_serial(m_modemport); m_modem->connect_to_serial(m_modemport);
connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool))); connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool)));
connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray))); connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray)));
#endif
} }
m_rxtimer = new QTimer(); m_rxtimer = new QTimer();
connect(m_rxtimer, SIGNAL(timeout()), this, SLOT(process_rx_data())); connect(m_rxtimer, SIGNAL(timeout()), this, SLOT(process_rx_data()));
@ -442,7 +446,9 @@ void REFCodec::transmit()
} }
if(m_hwtx){ if(m_hwtx){
#if !defined(Q_OS_IOS)
m_ambedev->encode(pcm); m_ambedev->encode(pcm);
#endif
if(m_tx && (m_txcodecq.size() >= 9)){ if(m_tx && (m_txcodecq.size() >= 9)){
for(int i = 0; i < 9; ++i){ for(int i = 0; i < 9; ++i){
ambe[i] = m_txcodecq.dequeue(); ambe[i] = m_txcodecq.dequeue();
@ -633,6 +639,7 @@ void REFCodec::send_frame(uint8_t *ambe)
void REFCodec::get_ambe() void REFCodec::get_ambe()
{ {
#if !defined(Q_OS_IOS)
uint8_t ambe[9]; uint8_t ambe[9];
if(m_ambedev->get_ambe(ambe)){ if(m_ambedev->get_ambe(ambe)){
@ -640,6 +647,7 @@ void REFCodec::get_ambe()
m_txcodecq.append(ambe[i]); m_txcodecq.append(ambe[i]);
} }
} }
#endif
} }
void REFCodec::process_rx_data() void REFCodec::process_rx_data()
@ -672,12 +680,14 @@ void REFCodec::process_rx_data()
ambe[i] = m_rxcodecq.dequeue(); ambe[i] = m_rxcodecq.dequeue();
} }
if(m_hwrx){ if(m_hwrx){
#if !defined(Q_OS_IOS)
m_ambedev->decode(ambe); m_ambedev->decode(ambe);
if(m_ambedev->get_audio(pcm)){ if(m_ambedev->get_audio(pcm)){
m_audio->write(pcm, 160); m_audio->write(pcm, 160);
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level());
} }
#endif
} }
else{ else{
if(m_modeinfo.sw_vocoder_loaded){ if(m_modeinfo.sw_vocoder_loaded){

@ -65,18 +65,22 @@ void XRFCodec::process_udp()
m_hwrx = true; m_hwrx = true;
m_hwtx = true; m_hwtx = true;
m_modeinfo.hw_vocoder_loaded = true; m_modeinfo.hw_vocoder_loaded = true;
#if !defined(Q_OS_IOS)
m_ambedev = new SerialAMBE("XRF"); m_ambedev = new SerialAMBE("XRF");
m_ambedev->connect_to_serial(m_vocoder); m_ambedev->connect_to_serial(m_vocoder);
connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool))); connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool)));
connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe())); connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe()));
#endif
} }
if(m_modemport != ""){ if(m_modemport != ""){
#if !defined(Q_OS_IOS)
m_modem = new SerialModem("XRF"); m_modem = new SerialModem("XRF");
m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex); m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex);
m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel); m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel);
m_modem->connect_to_serial(m_modemport); m_modem->connect_to_serial(m_modemport);
connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool))); connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool)));
connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray))); connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray)));
#endif
} }
m_rxtimer = new QTimer(); m_rxtimer = new QTimer();
connect(m_rxtimer, SIGNAL(timeout()), this, SLOT(process_rx_data())); connect(m_rxtimer, SIGNAL(timeout()), this, SLOT(process_rx_data()));
@ -393,7 +397,9 @@ void XRFCodec::transmit()
} }
} }
if(m_hwtx){ if(m_hwtx){
#if !defined(Q_OS_IOS)
m_ambedev->encode(pcm); m_ambedev->encode(pcm);
#endif
if(m_tx && (m_txcodecq.size() >= 9)){ if(m_tx && (m_txcodecq.size() >= 9)){
for(int i = 0; i < 9; ++i){ for(int i = 0; i < 9; ++i){
ambe[i] = m_txcodecq.dequeue(); ambe[i] = m_txcodecq.dequeue();
@ -566,6 +572,7 @@ void XRFCodec::send_frame(uint8_t *ambe)
void XRFCodec::get_ambe() void XRFCodec::get_ambe()
{ {
#if !defined(Q_OS_IOS)
uint8_t ambe[9]; uint8_t ambe[9];
if(m_ambedev->get_ambe(ambe)){ if(m_ambedev->get_ambe(ambe)){
@ -573,6 +580,7 @@ void XRFCodec::get_ambe()
m_txcodecq.append(ambe[i]); m_txcodecq.append(ambe[i]);
} }
} }
#endif
} }
void XRFCodec::process_rx_data() void XRFCodec::process_rx_data()
@ -596,7 +604,9 @@ void XRFCodec::process_rx_data()
for(int i = 0; i < s; ++i){ for(int i = 0; i < s; ++i){
out.append(m_rxmodemq.dequeue()); out.append(m_rxmodemq.dequeue());
} }
#if !defined(Q_OS_IOS)
m_modem->write(out); m_modem->write(out);
#endif
} }
} }
@ -605,12 +615,14 @@ void XRFCodec::process_rx_data()
ambe[i] = m_rxcodecq.dequeue(); ambe[i] = m_rxcodecq.dequeue();
} }
if(m_hwrx){ if(m_hwrx){
#if !defined(Q_OS_IOS)
m_ambedev->decode(ambe); m_ambedev->decode(ambe);
if(m_ambedev->get_audio(pcm)){ if(m_ambedev->get_audio(pcm)){
m_audio->write(pcm, 160); m_audio->write(pcm, 160);
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level());
} }
#endif
} }
else{ else{
if(m_modeinfo.sw_vocoder_loaded){ if(m_modeinfo.sw_vocoder_loaded){

@ -147,10 +147,12 @@ void YSFCodec::process_udp()
m_hwrx = true; m_hwrx = true;
m_hwtx = true; m_hwtx = true;
m_modeinfo.hw_vocoder_loaded = true; m_modeinfo.hw_vocoder_loaded = true;
#if !defined(Q_OS_IOS)
m_ambedev = new SerialAMBE("YSF"); m_ambedev = new SerialAMBE("YSF");
m_ambedev->connect_to_serial(m_vocoder); m_ambedev->connect_to_serial(m_vocoder);
connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool))); connect(m_ambedev, SIGNAL(connected(bool)), this, SLOT(ambe_connect_status(bool)));
connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe())); connect(m_ambedev, SIGNAL(data_ready()), this, SLOT(get_ambe()));
#endif
} }
else{ else{
m_hwrx = false; m_hwrx = false;
@ -158,12 +160,14 @@ void YSFCodec::process_udp()
} }
if(m_modemport != ""){ if(m_modemport != ""){
#if !defined(Q_OS_IOS)
m_modem = new SerialModem("YSF"); m_modem = new SerialModem("YSF");
m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex); m_modem->set_modem_flags(m_rxInvert, m_txInvert, m_pttInvert, m_useCOSAsLockout, m_duplex);
m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel); m_modem->set_modem_params(m_baud, m_rxfreq, m_txfreq, m_txDelay, m_rxLevel, m_rfLevel, m_ysfTXHang, m_cwIdTXLevel, m_dstarTXLevel, m_dmrTXLevel, m_ysfTXLevel, m_p25TXLevel, m_nxdnTXLevel, m_pocsagTXLevel, m_m17TXLevel);
m_modem->connect_to_serial(m_modemport); m_modem->connect_to_serial(m_modemport);
connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool))); connect(m_modem, SIGNAL(connected(bool)), this, SLOT(mmdvm_connect_status(bool)));
connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray))); connect(m_modem, SIGNAL(modem_data_ready(QByteArray)), this, SLOT(process_modem_data(QByteArray)));
#endif
} }
m_audio = new AudioEngine(m_audioin, m_audioout); m_audio = new AudioEngine(m_audioin, m_audioout);
@ -689,7 +693,9 @@ void YSFCodec::transmit()
} }
} }
if(m_hwtx && !m_txfullrate){ if(m_hwtx && !m_txfullrate){
#if !defined(Q_OS_IOS)
m_ambedev->encode(pcm); m_ambedev->encode(pcm);
#endif
} }
else{ else{
if(m_txfullrate){ if(m_txfullrate){
@ -730,16 +736,18 @@ void YSFCodec::send_frame()
if(m_tx){ if(m_tx){
m_modeinfo.stream_state = TRANSMITTING; m_modeinfo.stream_state = TRANSMITTING;
if(!m_txcnt){ if(!m_txcnt){
encode_header(); encode_header();
} }
else{ else{
m_txfullrate ? encode_vw() : encode_dv2(); m_txfullrate ? encode_vw() : encode_dv2();
} }
++m_txcnt;
frame_size = ::memcmp(m_ysfFrame, "YSFD", 4) ? 130 : 155; frame_size = ::memcmp(m_ysfFrame, "YSFD", 4) ? 130 : 155;
txdata.append((char *)m_ysfFrame, frame_size); txdata.append((char *)m_ysfFrame, frame_size);
m_udp->writeDatagram(txdata, m_address, m_modeinfo.port); m_udp->writeDatagram(txdata, m_address, m_modeinfo.port);
++m_txcnt;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "SEND:%d: ", txdata.size()); fprintf(stderr, "SEND:%d: ", txdata.size());
for(int i = 0; i < txdata.size(); ++i){ for(int i = 0; i < txdata.size(); ++i){
@ -1287,6 +1295,7 @@ void YSFCodec::writeVDMode2Data(uint8_t* data, const uint8_t* dt)
void YSFCodec::get_ambe() void YSFCodec::get_ambe()
{ {
#if !defined(Q_OS_IOS)
uint8_t ambe[7]; uint8_t ambe[7];
if(m_ambedev->get_ambe(ambe)){ if(m_ambedev->get_ambe(ambe)){
@ -1294,6 +1303,7 @@ void YSFCodec::get_ambe()
m_txcodecq.append(ambe[i]); m_txcodecq.append(ambe[i]);
} }
} }
#endif
} }
void YSFCodec::process_rx_data() void YSFCodec::process_rx_data()
@ -1317,7 +1327,9 @@ void YSFCodec::process_rx_data()
for(int i = 0; i < s; ++i){ for(int i = 0; i < s; ++i){
out.append(m_rxmodemq.dequeue()); out.append(m_rxmodemq.dequeue());
} }
#if !defined(Q_OS_IOS)
m_modem->write(out); m_modem->write(out);
#endif
} }
cnt = 0; cnt = 0;
} }
@ -1336,12 +1348,14 @@ void YSFCodec::process_rx_data()
ambe[i] = m_rxcodecq.dequeue(); ambe[i] = m_rxcodecq.dequeue();
} }
if(m_hwrx){ if(m_hwrx){
#if !defined(Q_OS_IOS)
m_ambedev->decode(ambe); m_ambedev->decode(ambe);
if(m_ambedev->get_audio(pcm)){ if(m_ambedev->get_audio(pcm)){
m_audio->write(pcm, 160); m_audio->write(pcm, 160);
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level());
} }
#endif
} }
else{ else{
if(m_modeinfo.sw_vocoder_loaded){ if(m_modeinfo.sw_vocoder_loaded){

Loading…
Cancel
Save