From 10b5c571bb220e7fff96e7605261698a6d004cd7 Mon Sep 17 00:00:00 2001 From: danielegobbetti Date: Sun, 7 Feb 2016 16:44:16 +0100 Subject: [PATCH] Use Kilometers as distance unit --- .../service/devices/pebble/PebbleIoThread.java | 1 + .../service/devices/pebble/PebbleProtocol.java | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java index ab7e2306..3cda3144 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java @@ -573,6 +573,7 @@ public class PebbleIoThread extends GBDeviceIoThread { if (uri.equals(Uri.parse("fake://health"))) { write(mPebbleProtocol.encodeActivateHealth(true)); + write(mPebbleProtocol.encodeSaneDistanceUnit()); return; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java index 17bcf549..b888e75e 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java @@ -712,6 +712,14 @@ public class PebbleProtocol extends GBDeviceProtocol { return encodeBlobdb("activityPreferences", command, BLOBDB_HEALTH, blob); } + public byte[] encodeSaneDistanceUnit() { + byte[] blob; + byte command; + command = BLOBDB_INSERT; + blob = new byte[]{0x00}; + return encodeBlobdb("unitsDistance", command, BLOBDB_HEALTH, blob); + } + public byte[] encodeReportDataLogSessions() { return encodeSimpleMessage(ENDPOINT_DATALOG, DATALOG_REPORTSESSIONS); }