Various fixups

pull/4/head
Doug McLain 2 years ago
parent 21ec14fde7
commit 99c7ec02fd

@ -1,5 +1,9 @@
QT += quick quickcontrols2 network multimedia QT += quick quickcontrols2 network multimedia
android:QT += androidextras
equals(QT_MAJOR_VERSION, 5){
android:QT += androidextras
}
unix:!ios:QT += serialport unix:!ios:QT += serialport
CONFIG += c++11 CONFIG += c++11
LFLAGS += LFLAGS +=

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<manifest package="org.dudetronics.droidstar" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="-- %%INSERT_VERSION_NAME%% --" android:versionCode="68" android:installLocation="auto"> <manifest package="org.dudetronics.droidstar" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="-- %%INSERT_VERSION_NAME%% --" android:versionCode="71" android:installLocation="auto">
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application. <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
@ -13,15 +13,11 @@
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true" android:icon="@drawable/icon"> <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true" android:icon="@drawable/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="unspecified" android:launchMode="singleTop"> <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="unspecified" android:launchMode="singleTop" android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" android:resource="@xml/device_filter"/>
<!-- Application arguments --> <!-- Application arguments -->
<!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ --> <!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ -->
<!-- Application arguments --> <!-- Application arguments -->

@ -18,6 +18,8 @@
package DroidStar; package DroidStar;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import android.content.Intent;
import android.app.PendingIntent;
import android.content.Context; import android.content.Context;
import android.hardware.usb.UsbManager; import android.hardware.usb.UsbManager;
import android.hardware.usb.UsbDeviceConnection; import android.hardware.usb.UsbDeviceConnection;
@ -40,6 +42,10 @@ public class USBSerialWrapper implements SerialInputOutputManagerTest.Listener {
UsbSerialPort m_port; UsbSerialPort m_port;
SerialInputOutputManagerTest usbIoManager; SerialInputOutputManagerTest usbIoManager;
private static final String ACTION_USB_PERMISSION = "org.dudetronics.droidstar.USB_PERMISSION";
//private final ArrayBlockingQueue<PendingUsbPermission> queuedPermissions = new ArrayBlockingQueue<>(100);
//private volatile boolean processingPermission = false;
//private PendingUsbPermission currentPendingPermission;
public USBSerialWrapper() { public USBSerialWrapper() {
this.id = counter; this.id = counter;
@ -146,6 +152,9 @@ public class USBSerialWrapper implements SerialInputOutputManagerTest.Listener {
if (connection == null) { if (connection == null) {
// add UsbManager.requestPermission(driver.getDevice(), ..) handling here // add UsbManager.requestPermission(driver.getDevice(), ..) handling here
PendingIntent mPendingIntent = PendingIntent.getBroadcast(c, 0, new Intent(ACTION_USB_PERMISSION), PendingIntent.FLAG_MUTABLE);
manager.requestPermission(driver.getDevice(), mPendingIntent);
return "No connection, need permission?"; return "No connection, need permission?";
} }

@ -378,7 +378,7 @@ void DCS::transmit()
pcm[i] = 0; pcm[i] = 0;
} }
else{ else{
pcm[i] = tts_audio->samples[m_ttscnt*2] / 2; pcm[i] = tts_audio->samples[m_ttscnt*2] / 8;
m_ttscnt++; m_ttscnt++;
} }
} }

@ -459,7 +459,7 @@ void DMR::transmit()
pcm[i] = 0; pcm[i] = 0;
} }
else{ else{
pcm[i] = tts_audio->samples[m_ttscnt*2] / 2; pcm[i] = tts_audio->samples[m_ttscnt*2] / 8;
m_ttscnt++; m_ttscnt++;
} }
} }

@ -116,6 +116,7 @@ void DroidStar::reset_connect_status()
process_connect(); process_connect();
} }
} }
#endif #endif
void DroidStar::discover_devices() void DroidStar::discover_devices()
@ -255,14 +256,6 @@ void DroidStar::process_connect()
MicPermission::check_permission(); MicPermission::check_permission();
#endif #endif
if( (m_callsign.size() < 4) ||
(m_dmrid < 250000) ||
(m_callsign != m_dmrids[m_dmrid]))
{
emit connect_status_changed(4);
return;
}
if(m_protocol == "REF"){ if(m_protocol == "REF"){
m_refname = m_saved_refhost; m_refname = m_saved_refhost;
} }
@ -644,7 +637,7 @@ void DroidStar::process_settings()
m_latitude = m_settings->value("DMRLAT", "0").toString().simplified(); m_latitude = m_settings->value("DMRLAT", "0").toString().simplified();
m_longitude = m_settings->value("DMRLONG", "0").toString().simplified(); m_longitude = m_settings->value("DMRLONG", "0").toString().simplified();
m_location = m_settings->value("DMRLOC").toString().simplified(); m_location = m_settings->value("DMRLOC").toString().simplified();
m_description = m_settings->value("DMRDESC", "DroidStar").toString().simplified(); m_description = m_settings->value("DMRDESC", "").toString().simplified();
m_freq = m_settings->value("DMRFREQ", "438800000").toString().simplified(); m_freq = m_settings->value("DMRFREQ", "438800000").toString().simplified();
m_url = m_settings->value("DMRURL", "www.qrz.com").toString().simplified(); m_url = m_settings->value("DMRURL", "www.qrz.com").toString().simplified();
m_swid = m_settings->value("DMRSWID", "20200922").toString().simplified(); m_swid = m_settings->value("DMRSWID", "20200922").toString().simplified();
@ -1410,6 +1403,18 @@ void DroidStar::update_data(Mode::MODEINFO info)
} }
QString t = QDateTime::fromMSecsSinceEpoch(info.ts).toString("yyyy.MM.dd hh:mm:ss.zzz"); QString t = QDateTime::fromMSecsSinceEpoch(info.ts).toString("yyyy.MM.dd hh:mm:ss.zzz");
if((m_protocol == "DMR") || (m_protocol == "P25") || (m_protocol == "NXDN")){
if(info.stream_state == Mode::STREAM_NEW){
emit update_log(t + " " + m_protocol + " RX started id: " + " srcid: " + QString::number(info.srcid) + " dstid: " + QString::number(info.dstid));
}
if(info.stream_state == Mode::STREAM_END){
emit update_log(t + " " + m_protocol + " RX ended id: " + " srcid: " + QString::number(info.srcid) + " dstid: " + QString::number(info.dstid));
}
if(info.stream_state == Mode::STREAM_LOST){
emit update_log(t + " " + m_protocol + " RX lost id: " + " srcid: " + QString::number(info.srcid) + " dstid: " + QString::number(info.dstid));
}
}
else{
if(info.stream_state == Mode::STREAM_NEW){ if(info.stream_state == Mode::STREAM_NEW){
emit update_log(t + " " + m_protocol + " RX started id: " + QString::number(info.streamid, 16) + " src: " + info.src + " dst: " + info.gw2); emit update_log(t + " " + m_protocol + " RX started id: " + QString::number(info.streamid, 16) + " src: " + info.src + " dst: " + info.gw2);
} }
@ -1419,6 +1424,7 @@ void DroidStar::update_data(Mode::MODEINFO info)
if(info.stream_state == Mode::STREAM_LOST){ if(info.stream_state == Mode::STREAM_LOST){
emit update_log(t + " " + m_protocol + " RX lost id: " + QString::number(info.streamid, 16) + " src: " + info.src + " dst: " + info.gw2); emit update_log(t + " " + m_protocol + " RX lost id: " + QString::number(info.streamid, 16) + " src: " + info.src + " dst: " + info.gw2);
} }
}
emit update_data(); emit update_data();
} }

@ -798,7 +798,7 @@ void IAX::transmit()
pcm[i] = 0; pcm[i] = 0;
} }
else{ else{
pcm[i] = tts_audio->samples[m_ttscnt*2] / 2; pcm[i] = tts_audio->samples[m_ttscnt*2] / 8;
m_ttscnt++; m_ttscnt++;
} }
} }

@ -746,7 +746,7 @@ void M17::transmit()
pcm[i] = 0; pcm[i] = 0;
} }
else{ else{
pcm[i] = tts_audio->samples[ttscnt*2] / 2; pcm[i] = tts_audio->samples[ttscnt*2] / 8;
ttscnt++; ttscnt++;
} }
} }

@ -40,11 +40,6 @@ ApplicationWindow {
palette.windowText: "white" palette.windowText: "white"
palette.highlight: "steelblue" palette.highlight: "steelblue"
MessageDialog {
id: idcheckDialog
title: "Invalid credentials"
text: "A valid callsign and DMR ID are required to use Dudestar on any mode, and they must match. If you have entered a valid DMR ID that matches the entered callsign, and you are still seeing this message, then you either have to click update ID files button or wait until your DMR ID is added to the ID file and try again."
}
MessageDialog { MessageDialog {
id: errorDialog id: errorDialog
title: "Error" title: "Error"

@ -255,7 +255,7 @@ void NXDN::transmit()
pcm[i] = 0; pcm[i] = 0;
} }
else{ else{
pcm[i] = tts_audio->samples[m_ttscnt*2] / 2; pcm[i] = tts_audio->samples[m_ttscnt*2] / 8;
m_ttscnt++; m_ttscnt++;
} }
} }
@ -305,13 +305,14 @@ void NXDN::send_frame()
temp_nxdn = get_frame(); temp_nxdn = get_frame();
txdata.append((char *)temp_nxdn, 43); txdata.append((char *)temp_nxdn, 43);
m_udp->writeDatagram(txdata, m_address, m_modeinfo.port); m_udp->writeDatagram(txdata, m_address, m_modeinfo.port);
#ifdef DEBUG
fprintf(stderr, "SEND:%d: ", txdata.size()); fprintf(stderr, "SEND:%lli: ", txdata.size());
for(int i = 0; i < txdata.size(); ++i){ for(int i = 0; i < txdata.size(); ++i){
fprintf(stderr, "%02x ", (uint8_t)txdata.data()[i]); fprintf(stderr, "%02x ", (uint8_t)txdata.data()[i]);
} }
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fflush(stderr); fflush(stderr);
#endif
} }
else{ else{
fprintf(stderr, "NXDN TX stopped\n"); fprintf(stderr, "NXDN TX stopped\n");

@ -246,7 +246,7 @@ void P25::transmit()
pcm[i] = 0; pcm[i] = 0;
} }
else{ else{
pcm[i] = tts_audio->samples[m_ttscnt*2] / 2; pcm[i] = tts_audio->samples[m_ttscnt*2] / 8;
m_ttscnt++; m_ttscnt++;
} }
} }

@ -430,7 +430,7 @@ void REF::transmit()
pcm[i] = 0; pcm[i] = 0;
} }
else{ else{
pcm[i] = tts_audio->samples[m_ttscnt*2] / 2; pcm[i] = tts_audio->samples[m_ttscnt*2] / 8;
m_ttscnt++; m_ttscnt++;
} }
} }

@ -383,7 +383,7 @@ void XRF::transmit()
pcm[i] = 0; pcm[i] = 0;
} }
else{ else{
pcm[i] = tts_audio->samples[m_ttscnt*2] / 2; pcm[i] = tts_audio->samples[m_ttscnt*2] / 8;
m_ttscnt++; m_ttscnt++;
} }
} }

@ -738,7 +738,7 @@ void YSF::transmit()
pcm[i] = 0; pcm[i] = 0;
} }
else{ else{
pcm[i] = tts_audio->samples[m_ttscnt*2] / 2; pcm[i] = tts_audio->samples[m_ttscnt*2] / 8;
m_ttscnt++; m_ttscnt++;
} }
} }

Loading…
Cancel
Save