1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 12:56:49 +01:00

Added command to clear the DB on pebble.

This commit is contained in:
danielegobbetti 2015-12-19 20:52:44 +01:00
parent 4b29d63d4e
commit 5026cf269f

View File

@ -648,7 +648,24 @@ public class PebbleProtocol extends GBDeviceProtocol {
return buf.array();
}
private byte[] encodeTimelinePin(int id, int timestamp, short duration, int icon_id, String title) {
//TODO: works for fw 3.8 but untested for anything else
private byte[] encodeClearDB() {
int length = 4;
ByteBuffer buf = ByteBuffer.allocate(LENGTH_PREFIX + length);
buf.order(ByteOrder.BIG_ENDIAN);
buf.putShort((short) length);
buf.putShort(ENDPOINT_BLOBDB);
buf.order(ByteOrder.LITTLE_ENDIAN);
buf.put(BLOBDB_CLEAR);
buf.putShort((short) mRandom.nextInt()); // token
buf.put(BLOBDB_PIN);
return buf.array();
}
public byte[] encodeTimelinePin(int id, int timestamp, short duration, int icon_id, String title) {
final short TIMELINE_PIN_LENGTH = 46;
icon_id |= 0x80000000;