From bc368a788b5b26fd04e0a0c98fefc30ab9212ff2 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 20 Apr 2017 21:40:06 +0200 Subject: [PATCH] Pebble: fix protocol encoding bugs of timeline pin, add location --- .../gadgetbridge/service/devices/pebble/PebbleProtocol.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 50280d00f..49ac74ff4 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 @@ -527,6 +527,7 @@ public class PebbleProtocol extends GBDeviceProtocol { default: iconId = PebbleIconID.TIMELINE_CALENDAR; attributes.add(new Pair<>(3, (Object) calendarEventSpec.description)); + attributes.add(new Pair<>(11, (Object) calendarEventSpec.location)); } return encodeTimelinePin(new UUID(GB_UUID_MASK | calendarEventSpec.type, id), calendarEventSpec.timestamp, (short) (calendarEventSpec.durationInSeconds / 60), iconId, attributes); @@ -851,13 +852,14 @@ public class PebbleProtocol extends GBDeviceProtocol { layout_id = 0x02; } icon_id |= 0x80000000; - byte attributes_count = 2; + byte attributes_count = 1; byte actions_count = 0; - int attributes_length = 10; + int attributes_length = 7; for (Pair pair : attributes) { if (pair.first == null || pair.second == null) continue; + attributes_count++; if (pair.second instanceof Integer) { attributes_length += 7; } else if (pair.second instanceof Byte) {