From f42899d9101ac54a91d51ac99836bfb326aecbb2 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sun, 19 Jun 2016 12:17:19 +0200 Subject: [PATCH] Pebble: on FW 2.x do not send extended music info and do not send playstate I don't think they are supported and I cannot test. --- .../gadgetbridge/service/devices/pebble/PebbleProtocol.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 1a882db11..f722544f9 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 @@ -1108,6 +1108,10 @@ public class PebbleProtocol extends GBDeviceProtocol { } public byte[] encodeSetMusicState(byte state, int position, int playRate, byte shuffle, byte repeat) { + if (mFwMajor < 3) { + return null; + } + byte playState; switch (state) { @@ -1143,7 +1147,7 @@ public class PebbleProtocol extends GBDeviceProtocol { @Override public byte[] encodeSetMusicInfo(String artist, String album, String track, int duration, int trackCount, int trackNr) { String[] parts = {artist, album, track}; - if (duration == 0) { + if (duration == 0 || mFwMajor < 3) { return encodeMessage(ENDPOINT_MUSICCONTROL, MUSICCONTROL_SETMUSICINFO, 0, parts); } else { // Calculate length first