Merge pull request #151 from OpenSeizureDetector/V4.2.x_latch

V4.2.x latch
This commit is contained in:
Graham Jones
2024-03-22 16:09:26 +00:00
committed by GitHub
4 changed files with 15 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
OpenSeizureDetector Android App - Change Log
============================================
V4.2.3b - fixed latched alarms (Issue #146)
V4.2.2 - Added support for PineTime OSD Status reporting.
V4.2.1 - Added support for PineTime wathes using the Bluetooth Data Source
V4.1.0 - Added experimental support for neural network based seizure detector.

Binary file not shown.

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="136"
android:versionName="4.2.2">
android:versionCode="137"
android:versionName="4.2.3b">
<!-- android:allowBackup="false" -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View File

@@ -675,7 +675,7 @@ public class SdServer extends Service implements SdDataReceiver {
mUtil.showToast(getString(R.string.SMSAlarmDisabledNotSendingMsg));
Log.v(TAG, "mSMSAlarm is false - not sending");
}
Log.v(TAG,"calling startLatchTimer()");
startLatchTimer();
}
// Handle fall alarm
@@ -782,7 +782,6 @@ public class SdServer extends Service implements SdDataReceiver {
}
}
// Fault
if ((sdData.alarmState) == 4 || (sdData.alarmState == 7) || (sdData.mHRFaultStanding) || (sdData.mHrFrozenFaultStanding)) {
sdData.alarmPhrase = "FAULT";
@@ -1007,15 +1006,20 @@ public class SdServer extends Service implements SdDataReceiver {
private void startLatchTimer() {
if (mLatchAlarms) {
if (mLatchAlarmTimer != null) {
Log.v(TAG, "startLatchTimer -timer already running - cancelling it");
Log.i(TAG, "startLatchTimer -timer already running - cancelling it");
mLatchAlarmTimer.cancel();
mLatchAlarmTimer = null;
}
Log.v(TAG, "startLatchTimer() - starting alarm latch release timer to time out in " + mLatchAlarmPeriod + " sec");
Log.i(TAG, "startLatchTimer() - starting alarm latch release timer to time out in " + mLatchAlarmPeriod + " sec");
// set timer to timeout after mLatchAlarmPeriod, and Tick() function to be called every second.
mLatchAlarmTimer =
new LatchAlarmTimer(mLatchAlarmPeriod * 1000, 1000);
mLatchAlarmTimer.start();
// We need to start the timer on the UI thread to get it to work for some reason - I don't know why!
runOnUiThread(new Runnable() {
public void run() {
mLatchAlarmTimer =
new LatchAlarmTimer(mLatchAlarmPeriod * 1000, 1000);
mLatchAlarmTimer.start();
}
});
} else {
Log.v(TAG, "startLatchTimer() - Latch Alarms disabled - not doing anything");
}
@@ -1457,7 +1461,7 @@ public class SdServer extends Service implements SdDataReceiver {
// called after startTime ms.
@Override
public void onFinish() {
Log.v(TAG, "LatchAlarmTimer.onFinish()");
Log.i(TAG, "LatchAlarmTimer.onFinish()");
// Do the equivalent of accept alarm push button.
acceptAlarm();
}