diff --git a/CHANGELOG.md b/CHANGELOG.md index bfe380e..3355ff7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ OpenSeizureDetector Android App - Change Log ============================================ + V4.2.7 - BLE2 data source re-start fixed?? V4.2.6 - Fixed problem with notifications in Android 13 - Improved start-up checks for permissions - Improved system re-start after changing settings (but still not perfect!) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2370226..ca2c088 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="140" + android:versionName="4.2.7"> diff --git a/app/src/main/java/uk/org/openseizuredetector/SdDataSourceBLE2.java b/app/src/main/java/uk/org/openseizuredetector/SdDataSourceBLE2.java index addabaa..a1f532f 100644 --- a/app/src/main/java/uk/org/openseizuredetector/SdDataSourceBLE2.java +++ b/app/src/main/java/uk/org/openseizuredetector/SdDataSourceBLE2.java @@ -186,11 +186,13 @@ public class SdDataSourceBLE2 extends SdDataSource { @Override public void onConnectedPeripheral(BluetoothPeripheral peripheral) { Log.i(TAG,"BluetoothCentralManagerCallback.onConnectedPeripheral()"); + mUtil.showToast("Watch Connected"); super.onConnectedPeripheral(peripheral); } @Override public void onConnectionFailed(BluetoothPeripheral peripheral, HciStatus status) { Log.i(TAG,"BluetoothCentralManagerCallback.onConnectionFailed() - attempting to reconnect"); + mUtil.showToast("Failed to Connect to Watch - Retrying"); mBluetoothCentralManager.autoConnectPeripheral(peripheral, peripheralCallback); super.onConnectionFailed(peripheral, status); } @@ -200,10 +202,11 @@ public class SdDataSourceBLE2 extends SdDataSource { Log.i(TAG,"BluetoothCentralManagerCallback.onDisonnectedPeripheral - mShutdown is set, so not reconnecting"); } else { Log.i(TAG,"BluetoothCentralManagerCallback.onDisonnectedPeripheral"); - //Log.i(TAG, "BluetoothCentralManagerCallback.onDisonnectedPeripheral - attempting to re-connect..."); - //bleDisconnect(); - //mShutdown=false; - //mBluetoothCentralManager.autoConnectPeripheral(peripheral, peripheralCallback); + mUtil.showToast("WATCH CONNECTION LOST"); + Log.i(TAG, "BluetoothCentralManagerCallback.onDisonnectedPeripheral - attempting to re-connect..."); + bleDisconnect(); + mShutdown=false; + mBluetoothCentralManager.autoConnectPeripheral(peripheral, peripheralCallback); } super.onDisconnectedPeripheral(peripheral, status); } @@ -534,8 +537,8 @@ public class SdDataSourceBLE2 extends SdDataSource { mShutdown = true; mBlePeripheral.cancelConnection(); - Log.i(TAG, "bleDisconnect() - closing BluetoothCentralManager"); - mBluetoothCentralManager.close(); + //Log.i(TAG, "bleDisconnect() - closing BluetoothCentralManager"); + //mBluetoothCentralManager.close(); } catch (Exception e) { Log.e(TAG,"bleDisconnect() - Error: "+e.getMessage()); mUtil.showToast("Error disconnecting from watch"); @@ -551,6 +554,7 @@ public class SdDataSourceBLE2 extends SdDataSource { super.stop(); try { + mShutdown = true; bleDisconnect(); CurrentTimeService.stopServer(); } catch (Exception e) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5bb015e..3b4d5a8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,7 +2,9 @@ OpenSeizureDetector - "\nV4.2.6 - Fixed issues with Android 13 notifications and BLE data source shutdown. Added support for V2.x of Garmin watch app, Added new BLE2 data source, signal strength and battery level graphs. + "\n + \nV4.2.7 - Finally fixed BLE2 data source re-start after dropping connection? + \nV4.2.6 - Fixed issues with Android 13 notifications and BLE data source shutdown. Added support for V2.x of Garmin watch app, Added new BLE2 data source, signal strength and battery level graphs. \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.