From 3fae1accb1d7204fa9e56ecf95e9c30e2f7b1843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Fri, 18 Aug 2023 08:53:51 +0100 Subject: [PATCH] Zepp OS: Send calendar event location --- .../huami/zeppos/services/ZeppOsCalendarService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/zeppos/services/ZeppOsCalendarService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/zeppos/services/ZeppOsCalendarService.java index 9be8c429a..02aa527e5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/zeppos/services/ZeppOsCalendarService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/zeppos/services/ZeppOsCalendarService.java @@ -122,6 +122,9 @@ public class ZeppOsCalendarService extends AbstractZeppOsService { } if (version == 3) { + if (calendarEventSpec.location != null) { + length += calendarEventSpec.location.getBytes(StandardCharsets.UTF_8).length; + } // Extra null byte at the end length++; } @@ -169,7 +172,10 @@ public class ZeppOsCalendarService extends AbstractZeppOsService { // TODO: Description here if (version == 3) { - buf.put((byte) 0x00); // ? + if (calendarEventSpec.location != null) { + buf.put(calendarEventSpec.location.getBytes(StandardCharsets.UTF_8)); + } + buf.put((byte) 0x00); } write("add calendar event", buf.array());