Skip to content

Commit 37c1c82

Browse files
committed
add hardware bandwidth option
1 parent a8be329 commit 37c1c82

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
applicationId "com.jvdegithub.aiscatcher"
1111
minSdk 22
1212
targetSdk 32
13-
versionCode 24
14-
versionName '0.24'
13+
versionCode 25
14+
versionName '0.25'
1515

1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
externalNativeBuild {

app/src/main/java/com/jvdegithub/aiscatcher/Settings.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ static void setDefault(Context context) {
6060
preferences.edit().putString("rTUNER", "Auto").commit();
6161
preferences.edit().putBoolean("rBIASTEE", false).commit();
6262
preferences.edit().putString("rFREQOFFSET", "0").commit();
63+
preferences.edit().putBoolean("rBANDWIDTH", false).commit();
6364

6465
preferences.edit().putString("tRATE", "240K").commit();
6566
preferences.edit().putString("tTUNER", "Auto").commit();
@@ -201,6 +202,8 @@ static public boolean Apply(Context context) {
201202
return false;
202203
if (!SetDeviceInteger(new String[]{"mLINEARITY", "sGAIN"}, context)) return false;
203204

205+
if(!SetRTLbandwidth(context)) return false;
206+
204207
if (!SetUDPoutput("u1", context)) return false;
205208
if (!SetUDPoutput("u2", context)) return false;
206209
return true;
@@ -241,6 +244,17 @@ static private boolean SetDevice(String[] settings, Context context) {
241244
return true;
242245
}
243246

247+
static private boolean SetRTLbandwidth(Context context)
248+
{
249+
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
250+
boolean b = preferences.getBoolean("rBANDWIDTH", false);
251+
if(b) {
252+
if (AisCatcherJava.applySetting("r", "BW", "192000") != 0)
253+
return false;
254+
}
255+
return true;
256+
}
257+
244258
static private boolean SetDeviceBoolean(String[] settings, String st, String sf, Context context) {
245259
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
246260

app/src/main/jni/JNI/AIScatcherNDK.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ Java_com_jvdegithub_aiscatcher_AisCatcherJava_InitNative(JNIEnv *env, jclass ins
270270
javaVersion = env->GetVersion();
271271
javaClass = (jclass) env->NewGlobalRef(instance);
272272

273-
callbackConsole(env, "AIS-Catcher " VERSION "-24\n");
273+
callbackConsole(env, "AIS-Catcher " VERSION "-25\n");
274274
memset(&statistics, 0, sizeof(statistics));
275275

276276
return 0;
@@ -334,6 +334,7 @@ Java_com_jvdegithub_aiscatcher_AisCatcherJava_Run(JNIEnv *env, jclass) {
334334

335335
const int TIME_INTERVAL = 1000;
336336
const int TIME_MAX = (TIME_CONSTRAINT * 1000) / TIME_INTERVAL;
337+
const TAG tag;
337338

338339
try {
339340
callbackConsole(env, "Creating output channels\n");
@@ -344,6 +345,7 @@ Java_com_jvdegithub_aiscatcher_AisCatcherJava_Run(JNIEnv *env, jclass) {
344345
}
345346

346347
callbackConsole(env, "Starting device\n");
348+
device->setTag(tag);
347349
device->Play();
348350

349351
stop = false;

app/src/main/res/xml/preferences.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
android:summary="Frequency Correction"
4141
android:title="Frequency Correction (PPM)"/>
4242

43+
<SwitchPreferenceCompat
44+
android:key="rBANDWIDTH"
45+
android:summary="Use device bandwidth filter"
46+
android:defaultValue="False"
47+
android:title="RTL bandwidth filter"/>
4348

4449
</PreferenceCategory>
4550

0 commit comments

Comments
 (0)