mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-26 09:11:37 +02:00
Mi Watch Lite: fix unencrypted support after refactoring common Xiaomi code
This commit is contained in:
parent
1920968fba
commit
b103b4f3e4
@ -258,7 +258,7 @@ public class XiaomiCharacteristic {
|
||||
buf.putShort((short) 0);
|
||||
buf.put((byte) 0);
|
||||
buf.put((byte) (isEncrypted ? 1 : 0));
|
||||
buf.putShort((short) Math.round(currentSending.length / 247.0));
|
||||
buf.putShort((short) Math.max(1,Math.round(currentSending.length / 247.0)));
|
||||
|
||||
final TransactionBuilder builder = mSupport.createTransactionBuilder("send chunked start");
|
||||
builder.write(bluetoothGattCharacteristic, buf.array());
|
||||
|
@ -67,12 +67,12 @@ public class XiaomiPlaintextSupport extends XiaomiSupport {
|
||||
this.characteristicCommandRead.setEncrypted(false);
|
||||
this.characteristicCommandRead.setHandler(this::handleCommandBytes);
|
||||
this.characteristicCommandWrite = new XiaomiCharacteristic(this, btCharacteristicCommandWrite, authService);
|
||||
this.characteristicCommandRead.setEncrypted(false);
|
||||
this.characteristicCommandWrite.setEncrypted(false);
|
||||
this.characteristicActivityData = new XiaomiCharacteristic(this, btCharacteristicActivityData, authService);
|
||||
this.characteristicActivityData.setHandler(healthService.getActivityFetcher()::addChunk);
|
||||
this.characteristicCommandRead.setEncrypted(false);
|
||||
this.characteristicActivityData.setEncrypted(false);
|
||||
this.characteristicDataUpload = new XiaomiCharacteristic(this, btCharacteristicDataUpload, authService);
|
||||
this.characteristicCommandRead.setEncrypted(false);
|
||||
this.characteristicDataUpload.setEncrypted(false);
|
||||
|
||||
// FIXME why is this needed?
|
||||
getDevice().setFirmwareVersion("...");
|
||||
|
Loading…
Reference in New Issue
Block a user