mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-07-07 22:22:00 +02:00
Pebble: implement encodeFindDevice() by simulating a call
This commit is contained in:
parent
39db968e34
commit
1bd32b713a
|
@ -173,7 +173,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
||||||
private MorpheuzSupport mMorpheuzSupport = new MorpheuzSupport(PebbleProtocol.this);
|
private MorpheuzSupport mMorpheuzSupport = new MorpheuzSupport(PebbleProtocol.this);
|
||||||
private WeatherNeatSupport mWeatherNeatSupport = new WeatherNeatSupport(PebbleProtocol.this);
|
private WeatherNeatSupport mWeatherNeatSupport = new WeatherNeatSupport(PebbleProtocol.this);
|
||||||
|
|
||||||
private static byte[] encodeSimpleMessage( short endpoint, byte command ) {
|
private static byte[] encodeSimpleMessage(short endpoint, byte command) {
|
||||||
ByteBuffer buf = ByteBuffer.allocate(LENGTH_PREFIX + LENGTH_SIMPLEMESSAGE);
|
ByteBuffer buf = ByteBuffer.allocate(LENGTH_PREFIX + LENGTH_SIMPLEMESSAGE);
|
||||||
buf.order(ByteOrder.BIG_ENDIAN);
|
buf.order(ByteOrder.BIG_ENDIAN);
|
||||||
buf.putShort(LENGTH_SIMPLEMESSAGE);
|
buf.putShort(LENGTH_SIMPLEMESSAGE);
|
||||||
|
@ -284,6 +284,11 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
||||||
return buf.array();
|
return buf.array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public byte[] encodeFindDevice(boolean start) {
|
||||||
|
return encodeSetCallState("Where are you?", "Gadgetbridge", start ? GBCommand.CALL_INCOMING : GBCommand.CALL_END);
|
||||||
|
}
|
||||||
|
|
||||||
private static byte[] encodeExtensibleNotification(int id, int timestamp, String[] parts) {
|
private static byte[] encodeExtensibleNotification(int id, int timestamp, String[] parts) {
|
||||||
// Calculate length first
|
// Calculate length first
|
||||||
byte attributes_count = 0;
|
byte attributes_count = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user