mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-25 08:05:55 +01:00
Huawei: Little cleanups in P2P service
This commit is contained in:
parent
ed49f6d323
commit
609a673dae
@ -302,7 +302,7 @@ public class HuaweiP2PCalendarService extends HuaweiBaseP2PService {
|
||||
|
||||
byte[] dataBytes = data.getBytes(StandardCharsets.UTF_8);
|
||||
ByteBuffer sendData = ByteBuffer.allocate(dataBytes.length + 8); // 8 is data header
|
||||
// NOTE: minor version is short in response but in this case it writes as integer
|
||||
//NOTE: minor version is short in response but in this case it writes as integer
|
||||
sendData.putInt(minorVersion);
|
||||
sendData.putInt(dataBytes.length);
|
||||
sendData.put(dataBytes);
|
||||
@ -487,6 +487,5 @@ public class HuaweiP2PCalendarService extends HuaweiBaseP2PService {
|
||||
} catch (HuaweiPacket.MissingTagException e) {
|
||||
LOG.error("P2P handle packet: tag is missing");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -274,8 +274,6 @@ public class HuaweiP2PDataDictionarySyncService extends HuaweiBaseP2PService {
|
||||
for (HuaweiTLV l1 : l.getObjects(0x87)) {
|
||||
for (HuaweiTLV ll : l1.getObjects(0x88)) {
|
||||
int type = ll.getInteger(0x9);
|
||||
// 10 - Double - data
|
||||
// 11 - String - metadata
|
||||
if (ll.contains(0xa))
|
||||
dataValues.add(new DictData.DictDataValue(type, (byte) 0xa, ll.getBytes(0xa)));
|
||||
if (ll.contains(0xb))
|
||||
|
@ -75,7 +75,7 @@ public class HuaweiP2PTrackService extends HuaweiBaseP2PService {
|
||||
header.putInt(counter.getNext()); // message id
|
||||
header.flip();
|
||||
|
||||
ByteBuffer packet = ByteBuffer.allocate(36 + data.length);
|
||||
ByteBuffer packet = ByteBuffer.allocate(HEADER_LENGTH + data.length);
|
||||
packet.put(header.array());
|
||||
packet.put(data);
|
||||
packet.flip();
|
||||
|
Loading…
Reference in New Issue
Block a user