V4.2.4 - fault rather than crash if bluetooth system crashes.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
OpenSeizureDetector Android App - Change Log
|
||||
============================================
|
||||
|
||||
V4.2.4 - Added checks and a FAULT condition for Bluetooth errors in Bluetooth Data Source
|
||||
V4.2.3 - Uses 3d accelerometer data to calculate magnitude if vector magnitude is not sent from data source.
|
||||
- fixed latched alarms (Issue #146)
|
||||
- fixed HR alarms selection issue (#153)
|
||||
|
||||
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:versionCode="138"
|
||||
android:versionName="4.2.4b">
|
||||
android:versionName="4.2.4">
|
||||
<!-- android:allowBackup="false" -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
|
||||
@@ -368,7 +368,20 @@ public class SdDataSourceBLE extends SdDataSource {
|
||||
* @param gattCharacteristic - the characteristic to be read.
|
||||
*/
|
||||
private void executeReadCharacteristic(BluetoothGattCharacteristic gattCharacteristic) {
|
||||
if (gattCharacteristic != null) {
|
||||
if (gattCharacteristic == null) {
|
||||
Log.i(TAG, "ExecuteReadCharacteristic() - gatCharacteristic is null, so not doing anything");
|
||||
mUtil.showToast("ERROR: gatCharacteristic is null - this should not happen");
|
||||
mSdDataReceiver.onSdDataFault(mSdData);
|
||||
return;
|
||||
}
|
||||
if (mBluetoothGatt == null) {
|
||||
Log.e(TAG, "executeReadCharacteristic() - mBluetoothGatt is null - Characteristic=" + gattCharacteristic.getUuid().toString());
|
||||
mUtil.showToast("ERROR: mGatCharacteristic is null - this should not happen");
|
||||
mSdDataReceiver.onSdDataFault(mSdData);
|
||||
return;
|
||||
}
|
||||
|
||||
// To get here both gatCharacteristic and mBluetoothGatt must be non-null
|
||||
boolean retVal = mBluetoothGatt.readCharacteristic(gattCharacteristic);
|
||||
if (retVal) {
|
||||
Log.d(TAG, "executeReadCharacteristic - read initiated successfully");
|
||||
@@ -381,9 +394,6 @@ public class SdDataSourceBLE extends SdDataSource {
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
} else {
|
||||
Log.i(TAG,"ExecuteReadCharacteristic() - gatCharacteristic is null, so not doing anything");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -391,12 +401,26 @@ public class SdDataSourceBLE extends SdDataSource {
|
||||
* of a given characteristic.
|
||||
* Because only one BLE operation can be taking place at a time, it may fail, in which case
|
||||
* the read is re-tried after a 100ms delay.
|
||||
*
|
||||
* @param gattCharacteristic - the characteristic to be read.
|
||||
* @param valBytes[] - array of bytes to send
|
||||
* @param nBytes - number of bytes to send.
|
||||
*/
|
||||
private void executeWriteCharacteristic(BluetoothGattCharacteristic gattCharacteristic, byte[] valBytes) {
|
||||
if (gattCharacteristic != null) {
|
||||
if (gattCharacteristic == null) {
|
||||
Log.i(TAG, "ExecuteWriteCharacteristic() - gatCharacteristic is null, so not doing anything");
|
||||
mUtil.showToast("ERROR: gatCharacteristic is null - this should not happen");
|
||||
mSdDataReceiver.onSdDataFault(mSdData);
|
||||
return;
|
||||
}
|
||||
if (mBluetoothGatt == null) {
|
||||
Log.e(TAG, "executeWriteCharacteristic() - mBluetoothGatt is null - Characteristic=" + gattCharacteristic.getUuid().toString());
|
||||
mUtil.showToast("ERROR: mGatCharacteristic is null - this should not happen");
|
||||
mSdDataReceiver.onSdDataFault(mSdData);
|
||||
return;
|
||||
}
|
||||
|
||||
// To get here both gatCharacteristic and mBluetoothGatt must be non-null
|
||||
gattCharacteristic.setValue(valBytes);
|
||||
boolean retVal = mBluetoothGatt.writeCharacteristic(gattCharacteristic);
|
||||
if (retVal) {
|
||||
@@ -410,9 +434,6 @@ public class SdDataSourceBLE extends SdDataSource {
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
} else {
|
||||
Log.i(TAG,"ExecuteWriteCharacteristic() - gatCharacteristic is null, so not doing anything");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
<resources>
|
||||
<string name="app_name">OpenSeizureDetector</string>
|
||||
<string name="changelog">
|
||||
"\n
|
||||
\nV4.2.1 - Added support for PineTime Watches using Bluetooth data source.
|
||||
"\nV4.2.4 - Fault alarm rather than crash if bluetooth system crashes.
|
||||
\nV4.2.3 - Bug Fixes (heart rate alarm and latched alarm issues)
|
||||
\nV4.2 - Added support for PineTime Watches using Bluetooth data source.
|
||||
\n - Added new, swipeable user interface to simplify the main screen..
|
||||
"</string>
|
||||
<string name="UpgradeMsg">
|
||||
|
||||
Reference in New Issue
Block a user