mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 09:01:55 +01:00
Colmi R09: Do not try to parse temperature packets without data
This commit is contained in:
parent
a6e4adc442
commit
af10677157
@ -494,6 +494,10 @@ public class ColmiR0xPacketHandler {
|
||||
public static void historicalTemperature(GBDevice device, byte[] value) {
|
||||
ArrayList<ColmiTemperatureSample> temperatureSamples = new ArrayList<>();
|
||||
int length = BLETypeConversions.toUint16(value[2], value[3]);
|
||||
if (length < 50) {
|
||||
LOG.info("Received temperature data packet with length {} while expecting 50. Will not try to parse it.", length);
|
||||
return;
|
||||
}
|
||||
int index = 6; // start of data (day nr, followed by values)
|
||||
int days_ago = -1;
|
||||
while (days_ago != 0 && index - 6 < length) {
|
||||
|
Loading…
Reference in New Issue
Block a user