diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java index f037dc2ef..c337a2e56 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java @@ -581,11 +581,9 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter { private void handleMusicRequest(byte[] value) { byte command = value[3]; - + logger.info("got music command: " + command); MUSIC_WATCH_REQUEST request = MUSIC_WATCH_REQUEST.fromCommandByte(command); - MusicControlRequest r = new MusicControlRequest(MUSIC_PHONE_REQUEST.MUSIC_REQUEST_PLAY_PAUSE); - GBDeviceEventMusicControl deviceEventMusicControl = new GBDeviceEventMusicControl(); deviceEventMusicControl.event = GBDeviceEventMusicControl.Event.PLAY; @@ -597,6 +595,16 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter { deviceEventMusicControl.event = GBDeviceEventMusicControl.Event.PLAYPAUSE; break; } + case MUSIC_REQUEST_NEXT: { + queueWrite(new MusicControlRequest(MUSIC_PHONE_REQUEST.MUSIC_REQUEST_NEXT)); + deviceEventMusicControl.event = GBDeviceEventMusicControl.Event.NEXT; + break; + } + case MUSIC_REQUEST_PREVIOUS: { + queueWrite(new MusicControlRequest(MUSIC_PHONE_REQUEST.MUSIC_REQUEST_PREVIOUS)); + deviceEventMusicControl.event = GBDeviceEventMusicControl.Event.PREVIOUS; + break; + } case MUSIC_REQUEST_LOUDER: { queueWrite(new MusicControlRequest(MUSIC_PHONE_REQUEST.MUSIC_REQUEST_LOUDER)); deviceEventMusicControl.event = GBDeviceEventMusicControl.Event.VOLUMEUP; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/music/MusicControlRequest.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/music/MusicControlRequest.java index cc3846ef3..64930fec5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/music/MusicControlRequest.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/fossil_hr/music/MusicControlRequest.java @@ -33,8 +33,10 @@ public class MusicControlRequest extends FossilRequest { return UUID.fromString("3dda0006-957f-7d4a-34a6-74696673696d"); } - public static enum MUSIC_WATCH_REQUEST{ + public enum MUSIC_WATCH_REQUEST { MUSIC_REQUEST_PLAY_PAUSE((byte) 0x02), + MUSIC_REQUEST_NEXT((byte) 0x03), + MUSIC_REQUEST_PREVIOUS((byte) 0x04), MUSIC_REQUEST_LOUDER((byte) 0x05), MUSIC_REQUEST_QUITER((byte) 0x06), ; @@ -52,10 +54,12 @@ public class MusicControlRequest extends FossilRequest { } } - public static enum MUSIC_PHONE_REQUEST{ + public enum MUSIC_PHONE_REQUEST { MUSIC_REQUEST_SET_PLAYING((byte) 0x00), MUSIC_REQUEST_SET_PAUSED((byte) 0x01), MUSIC_REQUEST_PLAY_PAUSE((byte) 0x02), + MUSIC_REQUEST_NEXT((byte) 0x03), + MUSIC_REQUEST_PREVIOUS((byte) 0x04), MUSIC_REQUEST_LOUDER((byte) 0x05), MUSIC_REQUEST_QUITER((byte) 0x06), ;