mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Add HuaweiTLV put for double
This commit is contained in:
committed by
José Rebelo
parent
ee14b5d821
commit
d379b11535
@@ -24,6 +24,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.ByteOrder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -181,6 +182,10 @@ public class HuaweiTLV {
|
|||||||
return put(tag, ByteBuffer.allocate(8).putLong(value).array());
|
return put(tag, ByteBuffer.allocate(8).putLong(value).array());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HuaweiTLV put(int tag, Double value) {
|
||||||
|
return put(tag, ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putDouble(value).array());
|
||||||
|
}
|
||||||
|
|
||||||
public HuaweiTLV put(int tag, int value) {
|
public HuaweiTLV put(int tag, int value) {
|
||||||
return put(tag, ByteBuffer.allocate(4).putInt(value).array());
|
return put(tag, ByteBuffer.allocate(4).putInt(value).array());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user