1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 04:46:51 +01:00

adapt HuamiSupport to updated BLE Time handling

This commit is contained in:
uli 2022-11-21 13:14:31 +01:00 committed by Gitea
parent 5097327234
commit 6cf079e55b

View File

@ -427,9 +427,7 @@ public abstract class HuamiSupport extends AbstractBTLEDeviceSupport implements
public HuamiSupport setCurrentTimeWithService(TransactionBuilder builder) { public HuamiSupport setCurrentTimeWithService(TransactionBuilder builder) {
GregorianCalendar now = BLETypeConversions.createCalendar(); GregorianCalendar now = BLETypeConversions.createCalendar();
byte[] head = BLETypeConversions.calendarToRawBytes(now); final byte[] bytes = getTimeBytes(now, TimeUnit.MINUTES);
byte[] tail = new byte[] { 0, BLETypeConversions.mapTimeZone(now, BLETypeConversions.TZ_FLAG_INCLUDE_DST_IN_TZ) };
byte[] bytes = BLETypeConversions.join(head, tail);
builder.write(getCharacteristic(GattCharacteristic.UUID_CHARACTERISTIC_CURRENT_TIME), bytes); builder.write(getCharacteristic(GattCharacteristic.UUID_CHARACTERISTIC_CURRENT_TIME), bytes);
return this; return this;
} }