1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-29 13:26:50 +01:00

BUGFIX: use correct preference key to toggle wrist flick on and off. Add: fill function onFindDevice with test commands for the signaling of the watch, if watch is set to buzzer just the buzzer is used, ... and so on.

This commit is contained in:
Sebastian Kranz 2018-09-17 14:43:09 +02:00
parent ecfd83ae65
commit bc20db44f4
2 changed files with 18 additions and 2 deletions

View File

@ -80,6 +80,7 @@ public class ZeTimeConstants {
public static final byte CMD_REMINDERS = (byte) 0x97; public static final byte CMD_REMINDERS = (byte) 0x97;
public static final byte CMD_PUSH_CALENDAR_DAY = (byte) 0x99; public static final byte CMD_PUSH_CALENDAR_DAY = (byte) 0x99;
public static final byte CMD_MUSIC_CONTROL = (byte) 0xD0; public static final byte CMD_MUSIC_CONTROL = (byte) 0xD0;
public static final byte CMD_TEST_SIGNALING = (byte) 0xFA;
// here are the action commands // here are the action commands
public static final byte CMD_REQUEST = (byte) 0x70; public static final byte CMD_REQUEST = (byte) 0x70;
public static final byte CMD_SEND = (byte) 0x71; public static final byte CMD_SEND = (byte) 0x71;

View File

@ -197,7 +197,22 @@ public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport {
@Override @Override
public void onFindDevice(boolean start) { public void onFindDevice(boolean start) {
try {
TransactionBuilder builder = performInitialized("onFindDevice");
byte[] testSignaling = {
ZeTimeConstants.CMD_PREAMBLE,
ZeTimeConstants.CMD_TEST_SIGNALING,
ZeTimeConstants.CMD_SEND,
(byte)0x1,
(byte)0x0,
(byte)(start ? 1 : 0),
ZeTimeConstants.CMD_END
};
sendMsgToWatch(builder, testSignaling);
builder.queue(getQueue());
} catch (IOException e) {
GB.toast(getContext(), "Error on function onFindDevice: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
}
} }
@Override @Override
@ -1528,7 +1543,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport {
private void setDisplayOnMovement(TransactionBuilder builder) private void setDisplayOnMovement(TransactionBuilder builder)
{ {
Prefs prefs = GBApplication.getPrefs(); Prefs prefs = GBApplication.getPrefs();
boolean movement = prefs.getBoolean(ZeTimeConstants.PREF_ACTIVITY_TRACKING, false); boolean movement = prefs.getBoolean(ZeTimeConstants.PREF_HANDMOVE_DISPLAY, false);
byte[] handmove = {ZeTimeConstants.CMD_PREAMBLE, byte[] handmove = {ZeTimeConstants.CMD_PREAMBLE,
ZeTimeConstants.CMD_SWITCH_SETTINGS, ZeTimeConstants.CMD_SWITCH_SETTINGS,