mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Zepp OS BTBR: Increase buffer size
This commit is contained in:
@@ -46,7 +46,7 @@ public final class BtBRQueue {
|
||||
public static final int HANDLER_SUBJECT_CONNECT = 0;
|
||||
public static final int HANDLER_SUBJECT_PERFORM_TRANSACTION = 1;
|
||||
|
||||
private BluetoothAdapter mBtAdapter = null;
|
||||
private final BluetoothAdapter mBtAdapter;
|
||||
private BluetoothSocket mBtSocket = null;
|
||||
private final GBDevice mGbDevice;
|
||||
private final SocketCallback mCallback;
|
||||
@@ -63,7 +63,7 @@ public final class BtBRQueue {
|
||||
private Thread readThread = new Thread("Read Thread") {
|
||||
@Override
|
||||
public void run() {
|
||||
byte[] buffer = new byte[mBufferSize];
|
||||
final byte[] buffer = new byte[mBufferSize];
|
||||
int nRead;
|
||||
|
||||
LOG.debug("Read thread started, entering loop");
|
||||
@@ -215,7 +215,7 @@ public final class BtBRQueue {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void onConnectionEstablished() {
|
||||
private void onConnectionEstablished() {
|
||||
mCallback.onConnectionEstablished();
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -61,7 +61,11 @@ import nodomain.freeyourgadget.gadgetbridge.util.StringUtils;
|
||||
public class ZeppOsBtbrSupport extends AbstractBTBRDeviceSupport implements ZeppOsCommunicator {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ZeppOsBtbrSupport.class);
|
||||
|
||||
private static final int MAX_MTU = 32768;
|
||||
/**
|
||||
* The highest MTU we have seen is 32768. However, there is some bug in the BtbrQueue where it
|
||||
* will lose some bytes if we read less than the available bytes, so we double the buffer size.
|
||||
*/
|
||||
private static final int MAX_MTU = 2 * 32768;
|
||||
|
||||
private static final byte PACKET_PREAMBLE = 0x55;
|
||||
private static final byte PACKET_TRAILER = (byte) 0xaa;
|
||||
|
||||
Reference in New Issue
Block a user