Re-enabled auto reconnection in BLE2 data source - seems to be working well after several disconnect-reconnect cycles.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
OpenSeizureDetector Android App - Change Log
|
OpenSeizureDetector Android App - Change Log
|
||||||
============================================
|
============================================
|
||||||
|
V4.2.7 - BLE2 data source re-start fixed??
|
||||||
V4.2.6 - Fixed problem with notifications in Android 13
|
V4.2.6 - Fixed problem with notifications in Android 13
|
||||||
- Improved start-up checks for permissions
|
- Improved start-up checks for permissions
|
||||||
- Improved system re-start after changing settings (but still not perfect!)
|
- Improved system re-start after changing settings (but still not perfect!)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:versionCode="139"
|
android:versionCode="140"
|
||||||
android:versionName="4.2.6">
|
android:versionName="4.2.7">
|
||||||
<!-- android:allowBackup="false" -->
|
<!-- android:allowBackup="false" -->
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||||
|
|
||||||
|
|||||||
@@ -186,11 +186,13 @@ public class SdDataSourceBLE2 extends SdDataSource {
|
|||||||
@Override
|
@Override
|
||||||
public void onConnectedPeripheral(BluetoothPeripheral peripheral) {
|
public void onConnectedPeripheral(BluetoothPeripheral peripheral) {
|
||||||
Log.i(TAG,"BluetoothCentralManagerCallback.onConnectedPeripheral()");
|
Log.i(TAG,"BluetoothCentralManagerCallback.onConnectedPeripheral()");
|
||||||
|
mUtil.showToast("Watch Connected");
|
||||||
super.onConnectedPeripheral(peripheral);
|
super.onConnectedPeripheral(peripheral);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onConnectionFailed(BluetoothPeripheral peripheral, HciStatus status) {
|
public void onConnectionFailed(BluetoothPeripheral peripheral, HciStatus status) {
|
||||||
Log.i(TAG,"BluetoothCentralManagerCallback.onConnectionFailed() - attempting to reconnect");
|
Log.i(TAG,"BluetoothCentralManagerCallback.onConnectionFailed() - attempting to reconnect");
|
||||||
|
mUtil.showToast("Failed to Connect to Watch - Retrying");
|
||||||
mBluetoothCentralManager.autoConnectPeripheral(peripheral, peripheralCallback);
|
mBluetoothCentralManager.autoConnectPeripheral(peripheral, peripheralCallback);
|
||||||
super.onConnectionFailed(peripheral, status);
|
super.onConnectionFailed(peripheral, status);
|
||||||
}
|
}
|
||||||
@@ -200,10 +202,11 @@ public class SdDataSourceBLE2 extends SdDataSource {
|
|||||||
Log.i(TAG,"BluetoothCentralManagerCallback.onDisonnectedPeripheral - mShutdown is set, so not reconnecting");
|
Log.i(TAG,"BluetoothCentralManagerCallback.onDisonnectedPeripheral - mShutdown is set, so not reconnecting");
|
||||||
} else {
|
} else {
|
||||||
Log.i(TAG,"BluetoothCentralManagerCallback.onDisonnectedPeripheral");
|
Log.i(TAG,"BluetoothCentralManagerCallback.onDisonnectedPeripheral");
|
||||||
//Log.i(TAG, "BluetoothCentralManagerCallback.onDisonnectedPeripheral - attempting to re-connect...");
|
mUtil.showToast("WATCH CONNECTION LOST");
|
||||||
//bleDisconnect();
|
Log.i(TAG, "BluetoothCentralManagerCallback.onDisonnectedPeripheral - attempting to re-connect...");
|
||||||
//mShutdown=false;
|
bleDisconnect();
|
||||||
//mBluetoothCentralManager.autoConnectPeripheral(peripheral, peripheralCallback);
|
mShutdown=false;
|
||||||
|
mBluetoothCentralManager.autoConnectPeripheral(peripheral, peripheralCallback);
|
||||||
}
|
}
|
||||||
super.onDisconnectedPeripheral(peripheral, status);
|
super.onDisconnectedPeripheral(peripheral, status);
|
||||||
}
|
}
|
||||||
@@ -534,8 +537,8 @@ public class SdDataSourceBLE2 extends SdDataSource {
|
|||||||
mShutdown = true;
|
mShutdown = true;
|
||||||
mBlePeripheral.cancelConnection();
|
mBlePeripheral.cancelConnection();
|
||||||
|
|
||||||
Log.i(TAG, "bleDisconnect() - closing BluetoothCentralManager");
|
//Log.i(TAG, "bleDisconnect() - closing BluetoothCentralManager");
|
||||||
mBluetoothCentralManager.close();
|
//mBluetoothCentralManager.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG,"bleDisconnect() - Error: "+e.getMessage());
|
Log.e(TAG,"bleDisconnect() - Error: "+e.getMessage());
|
||||||
mUtil.showToast("Error disconnecting from watch");
|
mUtil.showToast("Error disconnecting from watch");
|
||||||
@@ -551,6 +554,7 @@ public class SdDataSourceBLE2 extends SdDataSource {
|
|||||||
super.stop();
|
super.stop();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
mShutdown = true;
|
||||||
bleDisconnect();
|
bleDisconnect();
|
||||||
CurrentTimeService.stopServer();
|
CurrentTimeService.stopServer();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">OpenSeizureDetector</string>
|
<string name="app_name">OpenSeizureDetector</string>
|
||||||
<string name="changelog">
|
<string name="changelog">
|
||||||
"\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.4 - Fault alarm rather than crash if bluetooth system crashes.
|
||||||
\nV4.2.3 - Bug Fixes (heart rate alarm and latched alarm issues)
|
\nV4.2.3 - Bug Fixes (heart rate alarm and latched alarm issues)
|
||||||
\nV4.2 - Added support for PineTime Watches using Bluetooth data source.
|
\nV4.2 - Added support for PineTime Watches using Bluetooth data source.
|
||||||
|
|||||||
Reference in New Issue
Block a user