mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
use actual MTU instead of fixed size for TransactionBuilder.writeChunkedData
This commit is contained in:
committed by
José Rebelo
parent
ae1d5b1f01
commit
9f168fa350
+1
-3
@@ -593,9 +593,7 @@ public abstract class AbstractBTLEMultiDeviceSupport extends AbstractBTLEDeviceS
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current MTU, or 0 if unknown
|
||||
*
|
||||
* @return the current MTU, 0 if unknown
|
||||
* Get the current MTU, or the minimum 23 if unknown
|
||||
*/
|
||||
public int getMTU(int deviceIdx) {
|
||||
validateDeviceIndex(deviceIdx);
|
||||
|
||||
+1
-2
@@ -529,8 +529,7 @@ public abstract class AbstractBTLESingleDeviceSupport extends AbstractBTLEDevice
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current MTU, or 0 if unknown
|
||||
* @return the current MTU, 0 if unknown
|
||||
* Get the current MTU, or the minimum 23 if unknown
|
||||
*/
|
||||
public int getMTU() {
|
||||
return mMTU;
|
||||
|
||||
+1
-1
@@ -389,7 +389,7 @@ public class GenericThermalPrinterSupport extends AbstractBTLESingleDeviceSuppor
|
||||
|
||||
public void send(String taskname, byte[] command) {
|
||||
TransactionBuilder builder = createTransactionBuilder(taskname);
|
||||
builder.writeChunkedData(getCharacteristic(writeCharUUID), command, 123);
|
||||
builder.writeChunkedData(getCharacteristic(writeCharUUID), command, getMTU() - 3);
|
||||
builder.queue();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user