Skip to content

Commit

Permalink
G5: debug version for new collection method (part 11b)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed Dec 14, 2016
1 parent 9c3e487 commit c10331e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions app/src/main/java/com/eveningoutpost/dexdrip/Models/JoH.java
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,13 @@ public static void doPairingRequest(Context context, BroadcastReceiver broadcast
} catch (Exception e) {
UserError.Log.e(TAG, "Could not set pairing confirmation due to exception: " + e);
if (JoH.ratelimit("failed pair confirmation", 200)) {
JoH.static_toast_long("Failed to pair, may need to do it via Android Settings");
device.createBond(); // for what it is worth
// BluetoothDevice.PAIRING_VARIANT_CONSENT)
if (type == 3) {
JoH.static_toast_long("Please confirm the bluetooth pairing request");
} else {
JoH.static_toast_long("Failed to pair, may need to do it via Android Settings");
device.createBond(); // for what it is worth
}
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ public void onReceive(Context context, Intent intent) {
final BluetoothDevice parcel_device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
// TODO do we need to filter on the last 2 characters of the device name here?
currentBondState = parcel_device.getBondState();
final String bond_state_extra = intent.getStringExtra(BluetoothDevice.EXTRA_BOND_STATE);
final String previous_bond_state_extra = intent.getStringExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE);
final Integer bond_state_extra = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE,-1);
final Integer previous_bond_state_extra = intent.getIntExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE,-1);

Log.d(TAG, "onReceive UPDATE Name " + parcel_device.getName() + " Value " + parcel_device.getAddress()
+ " Bond state " + parcel_device.getBondState() + bondState(parcel_device.getBondState())
Expand Down Expand Up @@ -1326,7 +1326,7 @@ private synchronized void processOnCharacteristicRead (BluetoothGatt gatt,
Log.e(TAG,"Trying ondemand bond with delay!");
isBondedOrBonding = true;
device.createBond();
waitFor(1600);
waitFor(15000); // are we ok to do this on this thread?
Log.e(TAG,"ondemandbond delay finished");
}

Expand Down

0 comments on commit c10331e

Please sign in to comment.