mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-24 08:37:32 +01:00
TLW64: Support further device settings
* inactivity alarm * others are unclear
This commit is contained in:
parent
5c40e71355
commit
8a3174dabd
@ -35,6 +35,7 @@ public final class TLW64Constants {
|
||||
public static final byte CMD_FACTORY_RESET = (byte) 0xad;
|
||||
public static final byte CMD_NOTIFICATION = (byte) 0xc1;
|
||||
public static final byte CMD_ICON = (byte) 0xc3;
|
||||
public static final byte CMD_DEVICE_SETTINGS = (byte) 0xd3;
|
||||
|
||||
// Notifications
|
||||
public static final byte NOTIFICATION_HEADER = (byte) 0x01;
|
||||
|
@ -173,6 +173,9 @@ public class TLW64Support extends AbstractBTLEDeviceSupport {
|
||||
case TLW64Constants.CMD_ICON:
|
||||
LOG.info("Icon is displayed");
|
||||
return true;
|
||||
case TLW64Constants.CMD_DEVICE_SETTINGS:
|
||||
LOG.info("Device settings updated");
|
||||
return true;
|
||||
default:
|
||||
LOG.warn("Unhandled characteristic change: " + characteristicUUID + " code: " + Arrays.toString(data));
|
||||
return true;
|
||||
@ -529,6 +532,17 @@ public class TLW64Support extends AbstractBTLEDeviceSupport {
|
||||
}
|
||||
|
||||
builder.write(ctrlCharacteristic, userBytes);
|
||||
|
||||
// device settings
|
||||
builder.write(ctrlCharacteristic, new byte[]{
|
||||
TLW64Constants.CMD_DEVICE_SETTINGS,
|
||||
(byte) 0x00, // 1 - turns on inactivity alarm
|
||||
(byte) 0x3c, // unknown, sniffed by original app
|
||||
(byte) 0x02, // unknown, sniffed by original app
|
||||
(byte) 0x03, // unknown, sniffed by original app
|
||||
(byte) 0x01, // unknown, sniffed by original app
|
||||
(byte) 0x00 // unknown, sniffed by original app
|
||||
});
|
||||
}
|
||||
|
||||
private void showIcon(int iconId) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user