mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Pebble: try to fix pebble time regession
This commit is contained in:
+8
-2
@@ -188,7 +188,7 @@ class PebbleIoThread extends GBDeviceIoThread {
|
|||||||
deviceAddress = gbDevice.getVolatileAddress();
|
deviceAddress = gbDevice.getVolatileAddress();
|
||||||
}
|
}
|
||||||
BluetoothDevice btDevice = mBtAdapter.getRemoteDevice(deviceAddress);
|
BluetoothDevice btDevice = mBtAdapter.getRemoteDevice(deviceAddress);
|
||||||
if (btDevice.getType() == BluetoothDevice.DEVICE_TYPE_LE || btDevice.getType() == BluetoothDevice.DEVICE_TYPE_DUAL) {
|
if (btDevice.getType() == BluetoothDevice.DEVICE_TYPE_LE) {
|
||||||
LOG.info("This is a Pebble 2 or Pebble-LE/Pebble Time LE, will use BLE");
|
LOG.info("This is a Pebble 2 or Pebble-LE/Pebble Time LE, will use BLE");
|
||||||
mInStream = new PipedInputStream();
|
mInStream = new PipedInputStream();
|
||||||
mOutStream = new PipedOutputStream();
|
mOutStream = new PipedOutputStream();
|
||||||
@@ -201,7 +201,7 @@ class PebbleIoThread extends GBDeviceIoThread {
|
|||||||
for (ParcelUuid uuid : uuids) {
|
for (ParcelUuid uuid : uuids) {
|
||||||
LOG.info("found service UUID {}", uuid);
|
LOG.info("found service UUID {}", uuid);
|
||||||
}
|
}
|
||||||
|
if (uuids.length > 1) {
|
||||||
final UUID UuidSDP = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb");
|
final UUID UuidSDP = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb");
|
||||||
mBtSocket = btDevice.createRfcommSocketToServiceRecord(UuidSDP);
|
mBtSocket = btDevice.createRfcommSocketToServiceRecord(UuidSDP);
|
||||||
|
|
||||||
@@ -210,6 +210,12 @@ class PebbleIoThread extends GBDeviceIoThread {
|
|||||||
mBtSocket.connect();
|
mBtSocket.connect();
|
||||||
mInStream = mBtSocket.getInputStream();
|
mInStream = mBtSocket.getInputStream();
|
||||||
mOutStream = mBtSocket.getOutputStream();
|
mOutStream = mBtSocket.getOutputStream();
|
||||||
|
} else {
|
||||||
|
LOG.info("This seems to be a 2025 Pebble will use BLE");
|
||||||
|
mInStream = new PipedInputStream();
|
||||||
|
mOutStream = new PipedOutputStream();
|
||||||
|
mPebbleLESupport = new PebbleLESupport(this.getContext(), gbDevice, btDevice, (PipedInputStream) mInStream, (PipedOutputStream) mOutStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (((PebbleCoordinator) gbDevice.getDeviceCoordinator()).isBackgroundJsEnabled(gbDevice)) {
|
if (((PebbleCoordinator) gbDevice.getDeviceCoordinator()).isBackgroundJsEnabled(gbDevice)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user