diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/QHybridSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/QHybridSupport.java index 132d0dce0..8f22b2495 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/QHybridSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/QHybridSupport.java @@ -45,6 +45,7 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.Bat import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.DownloadFileRequest; import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.EraseFileRequest; import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.FileRequest; +import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.GetCountdownSettingsRequest; import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.GetCurrentStepCountRequest; import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.GetStepGoalRequest; import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.GetVibrationStrengthRequest; @@ -134,7 +135,8 @@ public class QHybridSupport extends QHybridBaseSupport { GetCurrentStepCountRequest.class, OTAEnterRequest.class, GoalTrackingGetRequest.class, - ActivityPointGetRequest.class + ActivityPointGetRequest.class, + GetCountdownSettingsRequest.class }; for (Class c : classes) { try { @@ -302,7 +304,8 @@ public class QHybridSupport extends QHybridBaseSupport { // queueWrite(new OTAEraseRequest(0)); // queueWrite(new OTAResetRequest()); // new UploadFileRequest((short)00, new byte[]{0x01, 0x00, 0x08, 0x01, 0x01, 0x0C, 0x00, (byte)0xBD, 0x01, 0x30, 0x71, (byte)0xFF, 0x05, 0x00, 0x01, 0x00}); - queueWrite(new ActivityPointGetRequest()); + // queueWrite(new ActivityPointGetRequest()); + queueWrite(new GetCountdownSettingsRequest()); } public void overwriteButtons() { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/GetCountdownSettingsRequest.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/GetCountdownSettingsRequest.java new file mode 100644 index 000000000..b0c5092f6 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/requests/GetCountdownSettingsRequest.java @@ -0,0 +1,25 @@ +package nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests; + +import android.bluetooth.BluetoothGattCharacteristic; + +import java.nio.ByteBuffer; + +public class GetCountdownSettingsRequest extends Request { + @Override + public byte[] getStartSequence() { + return new byte[]{1, 19, 1}; + } + + @Override + public void handleResponse(BluetoothGattCharacteristic characteristic) { + byte[] value = characteristic.getValue(); + if(value.length != 14){ + return; + } + ByteBuffer buffer = ByteBuffer.wrap(value); + int startTime = buffer.getInt(3); + int endTime = buffer.getInt(7); + short offset = buffer.getShort(11); + short progress = buffer.getShort(13); + } +}