File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
app/src/main/java/com/maxieds/chameleonminilivedebugger Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public BluetoothBroadcastReceiver() {
5858 btGattConn = null ;
5959 }
6060
61- private static final boolean PRINT_SERVICES_LIST_TO_LOG = false ;
61+ private static final boolean PRINT_SERVICES_LIST_TO_LOG = true ;
6262 private static final boolean PRINT_SERVICES_LIST_FULL = false ;
6363
6464 public static void printServicesSummaryListToLog (BluetoothGatt btGatt ) {
@@ -93,7 +93,7 @@ public static void printServicesSummaryListToLog(BluetoothGatt btGatt) {
9393 }
9494
9595 public static final int DISCOVER_SVCS_ATTEMPT_COUNT = 10 ;
96- public static final long CHECK_DISCOVER_SVCS_INTERVAL = 60000L ;
96+ public static final long CHECK_DISCOVER_SVCS_INTERVAL = 7500L ;
9797
9898 @ SuppressLint ("MissingPermission" )
9999 public void onReceive (Context context , Intent intent ) {
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ This program (The Chameleon Mini Live Debugger) is free software written by
3434import android .os .Handler ;
3535import android .os .Looper ;
3636import android .os .ParcelUuid ;
37+ import android .widget .Toast ;
3738
3839import androidx .annotation .NonNull ;
3940
@@ -589,11 +590,14 @@ public void run() {
589590 disconnectDevice ();
590591 stopConnectingDevices ();
591592 startConnectingDevices ();
593+ } else if (!btGattRef .discoverServices ()) {
594+ Utils .displayToastMessage ("Discovering bluetooth services. Prepare to wait ..." , Toast .LENGTH_LONG );
595+ discoverServicesHandler .postDelayed (this , BluetoothBroadcastReceiver .CHECK_DISCOVER_SVCS_INTERVAL );
592596 } else if (configureGattConnector ()) {
593597 BluetoothBroadcastReceiver .printServicesSummaryListToLog (btGattRef );
594598 notifyBluetoothBLEDeviceConnected ();
595599 } else {
596- btGattRef . discoverServices ( );
600+ Utils . displayToastMessage ( "Discovering bluetooth services. Prepare to wait ..." , Toast . LENGTH_LONG );
597601 discoverServicesHandler .postDelayed (this , BluetoothBroadcastReceiver .CHECK_DISCOVER_SVCS_INTERVAL );
598602 }
599603 }
You can’t perform that action at this time.
0 commit comments