V3.1.13 - Fixed problem with network datasource not responding to FAULT conditions correctly

This commit is contained in:
Graham Jones
2020-02-16 19:30:14 +00:00
parent 8a09fe45cc
commit 3e9000c52a
48 changed files with 16 additions and 10 deletions

View File

@@ -133,9 +133,10 @@ public class SdData implements Parcelable {
simpleSpec[i] = specArr.optInt(i);
}
haveData = true;
Log.v(TAG, "fromJSON(): sdData = " + this.toString());
return true;
} catch (Exception e) {
Log.v(TAG, "fromJSON() - error parsing result");
Log.v(TAG, "fromJSON() - error parsing result"+e.toString());
haveData = false;
return false;
}

View File

@@ -132,6 +132,7 @@ public class SdDataSourceNetwork extends SdDataSource {
sdData.alarmPhrase = "Warning - No Connection to Server";
Log.v(TAG,"doInBackground(): No Connection to Server - sdData = "+sdData.toString());
} else {
Log.v(TAG,"doInBackground - result = "+result);
sdData.fromJSON(result);
// Populate mSdData using the received data.
sdData.serverOK = true;
@@ -200,9 +201,9 @@ public class SdDataSourceNetwork extends SdDataSource {
// a string.
private String downloadUrl(String myurl) throws IOException {
InputStream is = null;
// Only display the first 500 characters of the retrieved
// Only retrieve the first 2048 characters of the retrieved
// web page content.
int len = 500;
int len = 2048;
try {
URL url = new URL(myurl);
@@ -214,7 +215,7 @@ public class SdDataSourceNetwork extends SdDataSource {
// Starts the query
conn.connect();
int response = conn.getResponseCode();
Log.d(TAG, "The response is: " + response);
Log.d(TAG, "downloadUrl(): The response is: " + response);
is = conn.getInputStream();
// Convert the InputStream into a string

View File

@@ -644,11 +644,13 @@ public class SdServer extends Service implements SdDataReceiver {
logData();
}
// Called by SdDataSource when a fault condition is detected.
public void onSdDataFault(SdData sdData) {
Log.v(TAG, "onSdDataFault()");
mSdData = sdData;
mSdData.alarmState = 4; // set fault alarm state.
mSdData.alarmPhrase = "FAULT";
mSdData.alarmStanding = false;
if (webServer != null) webServer.setSdData(mSdData);
if (mAudibleFaultWarning) {

View File

@@ -408,6 +408,7 @@ public class StartupActivity extends Activity {
+ "http://openseizuredetector.org.uk, or the app Facebook page at https://www.facebook.com/openseizuredetector. "
+ "so I can get in touch if necessary.\nThank you! Graham \ngraham@openseizuredetector.org.uk "
+ "\n\nChanges in this version:"
+ "\n V3.1.13 - Fixed ERR-400 display on garmin watch and associated problem with network datasource fault alerting."
+ "\n V3.1.11 - Fixed issue that Nework data source did not display heart rate data"
+ "\n V3.1.10 - Provided a user option to treat a null heart rate as a fault or an alarm condition"
+ "\n V3.1.9 - Fixed issue with Garmin Seizure Detector not producing warnings. Added fault pips for missing heart rate data if heart rate alarm active"
@@ -440,6 +441,7 @@ public class StartupActivity extends Activity {
+ "http://openseizuredetector.org.uk, or the app Facebook page at https://www.facebook.com/openseizuredetector. "
+ "so I can get in touch if necessary.\nThank you! Graham \ngraham@openseizuredetector.org.uk "
+ "\n\nChanges in this version:"
+ "\n V3.1.13 - Fixed ERR-400 display on garmin watch and associated problem with network datasource fault alerting."
+ "\n V3.1.11 - Fixed issue that Nework data source did not display heart rate data"
+ "\n V3.1.10 - Provided a user option to treat a null heart rate as a fault or an alarm condition"
+ "\n V3.1.9 - Fixed issue with Garmin Seizure Detector not producing warnings. Added fault pips for missing heart rate data if heart rate alarm active"