1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-16 10:24:03 +02:00

Pebble: fix decoding of byte and short appmessage data (when a native handler is present)

This commit is contained in:
Andreas Shimokawa 2017-01-01 17:58:34 +01:00
parent f25605f5a1
commit 507e58922f

View File

@ -1733,7 +1733,13 @@ public class PebbleProtocol extends GBDeviceProtocol {
switch (type) { switch (type) {
case TYPE_INT: case TYPE_INT:
case TYPE_UINT: case TYPE_UINT:
if (length == 1) {
dict.add(new Pair<Integer, Object>(key, buf.get()));
} else if (length == 2) {
dict.add(new Pair<Integer, Object>(key, buf.getShort()));
} else {
dict.add(new Pair<Integer, Object>(key, buf.getInt())); dict.add(new Pair<Integer, Object>(key, buf.getInt()));
}
break; break;
case TYPE_CSTRING: case TYPE_CSTRING:
case TYPE_BYTEARRAY: case TYPE_BYTEARRAY: