1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-24 01:03:20 +02:00

Log BLE PHY

to see if it can give any clue on #330.
This commit is contained in:
Erik Johansson
2018-10-06 20:40:52 +02:00
parent 79bf719215
commit 1929a75462

View File

@@ -639,6 +639,10 @@ public abstract class BluetoothCommunication {
stopLeScan(); stopLeScan();
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
gatt.readPhy();
}
connectionEstablished = true; connectionEstablished = true;
setBtStatus(BT_STATUS_CODE.BT_CONNECTION_ESTABLISHED); setBtStatus(BT_STATUS_CODE.BT_CONNECTION_ESTABLISHED);
@@ -698,6 +702,16 @@ public abstract class BluetoothCommunication {
setBtMachineState(BT_MACHINE_STATE.BT_INIT_STATE); setBtMachineState(BT_MACHINE_STATE.BT_INIT_STATE);
} }
@Override
public void onPhyRead(BluetoothGatt gatt, int txPhy, int rxPhy, int status) {
Timber.d("Current PHY read: TX=%d, RX=%d, status=%d", txPhy, rxPhy, status);
}
@Override
public void onPhyUpdate(BluetoothGatt gatt, int txPhy, int rxPhy, int status) {
Timber.d("PHY update: TX=%d, RX=%d, status=%d", txPhy, rxPhy, status);
}
private void postDelayedHandleRequests() { private void postDelayedHandleRequests() {
// Wait a short while before starting the next operation as suggested // Wait a short while before starting the next operation as suggested
// on the android.jlelse.eu link above. // on the android.jlelse.eu link above.