|
|
@ -174,13 +174,13 @@ void DroidStar::file_downloaded(QString filename)
|
|
|
|
emit update_log("Updated " + filename);
|
|
|
|
emit update_log("Updated " + filename);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(filename == "dplus.txt" && m_protocol == "REF"){
|
|
|
|
if(filename == "dplus.txt" && m_protocol == "REF"){
|
|
|
|
process_ref_hosts();
|
|
|
|
process_dstar_hosts(m_protocol);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(filename == "dextra.txt" && m_protocol == "XRF"){
|
|
|
|
else if(filename == "dextra.txt" && m_protocol == "XRF"){
|
|
|
|
process_xrf_hosts();
|
|
|
|
process_dstar_hosts(m_protocol);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(filename == "dcs.txt" && m_protocol == "DCS"){
|
|
|
|
else if(filename == "dcs.txt" && m_protocol == "DCS"){
|
|
|
|
process_dcs_hosts();
|
|
|
|
process_dstar_hosts(m_protocol);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(filename == "YSFHosts.txt" && m_protocol == "YSF"){
|
|
|
|
else if(filename == "YSFHosts.txt" && m_protocol == "YSF"){
|
|
|
|
process_ysf_hosts();
|
|
|
|
process_ysf_hosts();
|
|
|
@ -344,7 +344,16 @@ void DroidStar::process_connect()
|
|
|
|
m_mode = Mode::create_mode(m_protocol);
|
|
|
|
m_mode = Mode::create_mode(m_protocol);
|
|
|
|
m_modethread = new QThread;
|
|
|
|
m_modethread = new QThread;
|
|
|
|
m_mode->moveToThread(m_modethread);
|
|
|
|
m_mode->moveToThread(m_modethread);
|
|
|
|
m_mode->init(m_callsign, m_dmrid, nxdnid, m_module, m_refname, m_host, m_port, m_ipv6, vocoder, modem, m_capture, m_playback, m_mdirect);
|
|
|
|
|
|
|
|
|
|
|
|
if(m_protocol == "IAX"){
|
|
|
|
|
|
|
|
m_mode->set_iax_params(m_iaxuser, m_iaxpassword, m_iaxnode, m_iaxhost, m_iaxport);
|
|
|
|
|
|
|
|
m_mode->init(m_callsign, m_dmrid, nxdnid, m_module, m_refname, m_iaxhost, m_iaxport, m_ipv6, vocoder, modem, m_capture, m_playback, m_mdirect);
|
|
|
|
|
|
|
|
connect(this, SIGNAL(send_dtmf(QByteArray)), m_mode, SLOT(send_dtmf(QByteArray)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
m_mode->init(m_callsign, m_dmrid, nxdnid, m_module, m_refname, m_host, m_port, m_ipv6, vocoder, modem, m_capture, m_playback, m_mdirect);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_mode->set_modem_flags(rxInvert, txInvert, pttInvert, useCOSAsLockout, duplex);
|
|
|
|
m_mode->set_modem_flags(rxInvert, txInvert, pttInvert, useCOSAsLockout, duplex);
|
|
|
|
m_mode->set_modem_params(m_modemBaud.toUInt(), rxfreq, txfreq, m_modemTxDelay.toInt(), m_modemRxLevel.toFloat(), m_modemRFLevel.toFloat(), ysfTXHang, m_modemCWIdTxLevel.toFloat(), m_modemDstarTxLevel.toFloat(), m_modemDMRTxLevel.toFloat(), m_modemYSFTxLevel.toFloat(), m_modemP25TxLevel.toFloat(), m_modemNXDNTxLevel.toFloat(), pocsagTXLevel, m17TXLevel);
|
|
|
|
m_mode->set_modem_params(m_modemBaud.toUInt(), rxfreq, txfreq, m_modemTxDelay.toInt(), m_modemRxLevel.toFloat(), m_modemRFLevel.toFloat(), ysfTXHang, m_modemCWIdTxLevel.toFloat(), m_modemDstarTxLevel.toFloat(), m_modemDMRTxLevel.toFloat(), m_modemYSFTxLevel.toFloat(), m_modemP25TxLevel.toFloat(), m_modemNXDNTxLevel.toFloat(), pocsagTXLevel, m17TXLevel);
|
|
|
|
|
|
|
|
|
|
|
@ -393,6 +402,7 @@ void DroidStar::process_connect()
|
|
|
|
connect(this, SIGNAL(slot_changed(int)), m_mode, SLOT(slot_changed(int)));
|
|
|
|
connect(this, SIGNAL(slot_changed(int)), m_mode, SLOT(slot_changed(int)));
|
|
|
|
connect(this, SIGNAL(cc_changed(int)), m_mode, SLOT(cc_changed(int)));
|
|
|
|
connect(this, SIGNAL(cc_changed(int)), m_mode, SLOT(cc_changed(int)));
|
|
|
|
emit dmr_tgid_changed(m_dmr_destid);
|
|
|
|
emit dmr_tgid_changed(m_dmr_destid);
|
|
|
|
|
|
|
|
emit dmrpc_state_changed(m_pc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_protocol == "M17"){
|
|
|
|
if(m_protocol == "M17"){
|
|
|
@ -403,11 +413,6 @@ void DroidStar::process_connect()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_protocol == "IAX"){
|
|
|
|
|
|
|
|
m_mode->set_iax_params(m_iaxuser, m_iaxpassword, m_iaxnode, m_iaxhost, m_iaxport);
|
|
|
|
|
|
|
|
connect(this, SIGNAL(send_dtmf(QByteArray)), m_mode, SLOT(send_dtmf(QByteArray)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_modethread->start();
|
|
|
|
m_modethread->start();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -461,34 +466,16 @@ void DroidStar::process_host_change(const QString &h)
|
|
|
|
|
|
|
|
|
|
|
|
void DroidStar::process_mode_change(const QString &m)
|
|
|
|
void DroidStar::process_mode_change(const QString &m)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_protocol = m;
|
|
|
|
m_protocol = m;
|
|
|
|
if(m == "REF"){
|
|
|
|
if((m == "REF") || (m == "DCS") || (m == "XRF")){
|
|
|
|
process_ref_hosts();
|
|
|
|
process_dstar_hosts(m);
|
|
|
|
m_label1 = "MYCALL";
|
|
|
|
m_label1 = "MYCALL";
|
|
|
|
m_label2 = "URCALL";
|
|
|
|
m_label2 = "URCALL";
|
|
|
|
m_label3 = "RPTR1";
|
|
|
|
m_label3 = "RPTR1";
|
|
|
|
m_label4 = "RPTR2";
|
|
|
|
m_label4 = "RPTR2";
|
|
|
|
m_label5 = "Stream ID";
|
|
|
|
m_label5 = "Stream ID";
|
|
|
|
m_label6 = "User txt";
|
|
|
|
m_label6 = "User txt";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m == "DCS"){
|
|
|
|
|
|
|
|
process_dcs_hosts();
|
|
|
|
|
|
|
|
m_label1 = "MYCALL";
|
|
|
|
|
|
|
|
m_label2 = "URCALL";
|
|
|
|
|
|
|
|
m_label3 = "RPTR1";
|
|
|
|
|
|
|
|
m_label4 = "RPTR2";
|
|
|
|
|
|
|
|
m_label5 = "Stream ID";
|
|
|
|
|
|
|
|
m_label6 = "User txt";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(m == "XRF"){
|
|
|
|
|
|
|
|
process_xrf_hosts();
|
|
|
|
|
|
|
|
m_label1 = "MYCALL";
|
|
|
|
|
|
|
|
m_label2 = "URCALL";
|
|
|
|
|
|
|
|
m_label3 = "RPTR1";
|
|
|
|
|
|
|
|
m_label4 = "RPTR2";
|
|
|
|
|
|
|
|
m_label5 = "Stream ID";
|
|
|
|
|
|
|
|
m_label6 = "User txt";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(m == "YSF"){
|
|
|
|
if(m == "YSF"){
|
|
|
|
process_ysf_hosts();
|
|
|
|
process_ysf_hosts();
|
|
|
|
m_label1 = "Gateway";
|
|
|
|
m_label1 = "Gateway";
|
|
|
@ -697,128 +684,60 @@ void DroidStar::update_custom_hosts(QString h)
|
|
|
|
m_localhosts = m_settings->value("LOCALHOSTS").toString();
|
|
|
|
m_localhosts = m_settings->value("LOCALHOSTS").toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DroidStar::process_ref_hosts()
|
|
|
|
void DroidStar::process_dstar_hosts(QString m)
|
|
|
|
{
|
|
|
|
|
|
|
|
m_hostmap.clear();
|
|
|
|
|
|
|
|
m_hostsmodel.clear();
|
|
|
|
|
|
|
|
QFileInfo check_file(config_path + "/dplus.txt");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(check_file.exists() && check_file.isFile()){
|
|
|
|
|
|
|
|
QFile f(config_path + "/dplus.txt");
|
|
|
|
|
|
|
|
if(f.open(QIODevice::ReadOnly)){
|
|
|
|
|
|
|
|
while(!f.atEnd()){
|
|
|
|
|
|
|
|
QString l = f.readLine();
|
|
|
|
|
|
|
|
if(l.at(0) == '#'){
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
QStringList ll = l.split('\t');
|
|
|
|
|
|
|
|
if(ll.size() > 1){
|
|
|
|
|
|
|
|
m_hostmap[ll.at(0).simplified()] = ll.at(1).simplified() + ",20001";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_customhosts = m_localhosts.split('\n');
|
|
|
|
|
|
|
|
for (const auto& i : qAsConst(m_customhosts)){
|
|
|
|
|
|
|
|
QStringList line = i.simplified().split(' ');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(line.at(0) == "REF"){
|
|
|
|
|
|
|
|
m_hostmap[line.at(1).simplified()] = line.at(2).simplified() + "," + line.at(3).simplified();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QMap<QString, QString>::const_iterator i = m_hostmap.constBegin();
|
|
|
|
|
|
|
|
while (i != m_hostmap.constEnd()) {
|
|
|
|
|
|
|
|
m_hostsmodel.append(i.key());
|
|
|
|
|
|
|
|
++i;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
f.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
download_file("/dplus.txt");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DroidStar::process_dcs_hosts()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_hostmap.clear();
|
|
|
|
|
|
|
|
m_hostsmodel.clear();
|
|
|
|
|
|
|
|
QFileInfo check_file(config_path + "/dcs.txt");
|
|
|
|
|
|
|
|
if(check_file.exists() && check_file.isFile()){
|
|
|
|
|
|
|
|
QFile f(config_path + "/dcs.txt");
|
|
|
|
|
|
|
|
if(f.open(QIODevice::ReadOnly)){
|
|
|
|
|
|
|
|
while(!f.atEnd()){
|
|
|
|
|
|
|
|
QString l = f.readLine();
|
|
|
|
|
|
|
|
if(l.at(0) == '#'){
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
QStringList ll = l.split('\t');
|
|
|
|
|
|
|
|
if(ll.size() > 1){
|
|
|
|
|
|
|
|
m_hostmap[ll.at(0).simplified()] = ll.at(1).simplified() + ",30051";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_customhosts = m_localhosts.split('\n');
|
|
|
|
|
|
|
|
for (const auto& i : qAsConst(m_customhosts)){
|
|
|
|
|
|
|
|
QStringList line = i.simplified().split(' ');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(line.at(0) == "DCS"){
|
|
|
|
|
|
|
|
m_hostmap[line.at(1).simplified()] = line.at(2).simplified() + "," + line.at(3).simplified();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QMap<QString, QString>::const_iterator i = m_hostmap.constBegin();
|
|
|
|
|
|
|
|
while (i != m_hostmap.constEnd()) {
|
|
|
|
|
|
|
|
m_hostsmodel.append(i.key());
|
|
|
|
|
|
|
|
++i;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
f.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
download_file("/dcs.txt");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DroidStar::process_xrf_hosts()
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_hostmap.clear();
|
|
|
|
m_hostmap.clear();
|
|
|
|
m_hostsmodel.clear();
|
|
|
|
m_hostsmodel.clear();
|
|
|
|
QFileInfo check_file(config_path + "/dextra.txt");
|
|
|
|
QString filename, port;
|
|
|
|
if(check_file.exists() && check_file.isFile()){
|
|
|
|
if(m == "REF"){
|
|
|
|
QFile f(config_path + "/dextra.txt");
|
|
|
|
filename = "dplus.txt";
|
|
|
|
if(f.open(QIODevice::ReadOnly)){
|
|
|
|
port = "20001";
|
|
|
|
while(!f.atEnd()){
|
|
|
|
}
|
|
|
|
QString l = f.readLine();
|
|
|
|
else if(m == "DCS"){
|
|
|
|
if(l.at(0) == '#'){
|
|
|
|
filename = "dcs.txt";
|
|
|
|
continue;
|
|
|
|
port = "30051";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
QStringList ll = l.split('\t');
|
|
|
|
else if(m == "XRF"){
|
|
|
|
if(ll.size() > 1){
|
|
|
|
filename = "dextra.txt";
|
|
|
|
m_hostmap[ll.at(0).simplified()] = ll.at(1).simplified() + ",30001";
|
|
|
|
port = "30001";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QFileInfo check_file(config_path + "/" + filename);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(check_file.exists() && check_file.isFile()){
|
|
|
|
|
|
|
|
QFile f(config_path + "/" + filename);
|
|
|
|
|
|
|
|
if(f.open(QIODevice::ReadOnly)){
|
|
|
|
|
|
|
|
while(!f.atEnd()){
|
|
|
|
|
|
|
|
QString l = f.readLine();
|
|
|
|
|
|
|
|
if(l.at(0) == '#'){
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
QStringList ll = l.split('\t');
|
|
|
|
|
|
|
|
if(ll.size() > 1){
|
|
|
|
|
|
|
|
m_hostmap[ll.at(0).simplified()] = ll.at(1).simplified() + "," + port;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_customhosts = m_localhosts.split('\n');
|
|
|
|
m_customhosts = m_localhosts.split('\n');
|
|
|
|
for (const auto& i : qAsConst(m_customhosts)){
|
|
|
|
for (const auto& i : qAsConst(m_customhosts)){
|
|
|
|
QStringList line = i.simplified().split(' ');
|
|
|
|
QStringList line = i.simplified().split(' ');
|
|
|
|
|
|
|
|
|
|
|
|
if(line.at(0) == "XRF"){
|
|
|
|
if(line.at(0) == m){
|
|
|
|
m_hostmap[line.at(1).simplified()] = line.at(2).simplified() + "," + line.at(3).simplified();
|
|
|
|
m_hostmap[line.at(1).simplified()] = line.at(2).simplified() + "," + line.at(3).simplified();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QMap<QString, QString>::const_iterator i = m_hostmap.constBegin();
|
|
|
|
QMap<QString, QString>::const_iterator i = m_hostmap.constBegin();
|
|
|
|
while (i != m_hostmap.constEnd()) {
|
|
|
|
while (i != m_hostmap.constEnd()) {
|
|
|
|
m_hostsmodel.append(i.key());
|
|
|
|
m_hostsmodel.append(i.key());
|
|
|
|
++i;
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
f.close();
|
|
|
|
f.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
else{
|
|
|
|
download_file("/dextra.txt");
|
|
|
|
download_file("/" + filename);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DroidStar::process_ysf_hosts()
|
|
|
|
void DroidStar::process_ysf_hosts()
|
|
|
@ -856,7 +775,6 @@ void DroidStar::process_ysf_hosts()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
f.close();
|
|
|
|
f.close();
|
|
|
|
//process_fcs_rooms();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
else{
|
|
|
|
download_file("/YSFHosts.txt");
|
|
|
|
download_file("/YSFHosts.txt");
|
|
|
|