Fixed issue where web server would send data to the analysis routines even if data source is not set to Garmin, causing conflicts with the selected data source.

This commit is contained in:
Graham Jones
2022-02-21 12:23:31 +00:00
parent 3656b74733
commit 39ea02020f
3 changed files with 25 additions and 7 deletions

13
RELEASE_NOTES.md Normal file
View File

@@ -0,0 +1,13 @@
OpenSeizureDetector Android App - RELEASE NOTES
==============================================
Version 4.0.0
- Logs all seizure detector data to local database
- Adds 'Data Sharing' functionality to upload data to remote database and edit events to say if they are false alarms or genuine seizures
- Settings screens tidied up (removed some unnecessary options to simplify settings)
- Added check of whether the App is being 'Optimised' for battery usage by the Android System
- Fixed problem where the web server receiving data will send it to the analysis routines, even if the data source is not set to Garmin.
- for example if you set the data source to phone, but ran OSD on a garmin watch, the data would oscillate between phone and watch
data
-

View File

@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="uk.org.openseizuredetector" package="uk.org.openseizuredetector"
android:versionCode="92" android:versionCode="92"
android:versionName="4.0.0i"> android:versionName="4.0.0j">
<!-- android:allowBackup="false" --> <!-- android:allowBackup="false" -->
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View File

@@ -104,13 +104,18 @@ public class SdWebServer extends NanoHTTPD {
Log.v(TAG, " files=" + files.toString()); Log.v(TAG, " files=" + files.toString());
String postData = files.get("postData"); String postData = files.get("postData");
Log.v(TAG, " postData=" + postData); Log.v(TAG, " postData=" + postData);
// Send the data to the SdDataSource so the app can pick it up. if (mSdServer.mSdDataSourceName.equals("Garmin")) {
if (parameters.get("dataObj") != null) { // Send the data to the SdDataSource so the app can pick it up.
Log.v(TAG,"passing parameters to data source"); if (parameters.get("dataObj") != null) {
answer = mSdServer.mSdDataSource.updateFromJSON(parameters.get("dataObj").toString()); Log.v(TAG, "passing parameters to data source");
answer = mSdServer.mSdDataSource.updateFromJSON(parameters.get("dataObj").toString());
} else {
Log.v(TAG, "Passing postData to data source");
answer = mSdServer.mSdDataSource.updateFromJSON(files.get("postData"));
}
} else { } else {
Log.v(TAG,"Passing postData to data source"); Log.i(TAG,"Web server received data, but datasource is not set to 'Garmin' - Ignoring");
answer = mSdServer.mSdDataSource.updateFromJSON(files.get("postData")); mUtil.showToast("Web server received data, but datasource is not set to 'Garmin' - Ignoring");
} }
break; break;
default: default: