mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-27 09:01:38 +01:00
Add HuaweiTLV put for double
This commit is contained in:
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());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user