From 033e0be08d7549282673fa733d15d1385993aaf3 Mon Sep 17 00:00:00 2001 From: Tim Gromeyer Date: Sun, 23 Mar 2025 22:15:40 +0100 Subject: [PATCH] Fix case battery level --- linux/ble/blemanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/ble/blemanager.cpp b/linux/ble/blemanager.cpp index bf8171b..3f3376c 100644 --- a/linux/ble/blemanager.cpp +++ b/linux/ble/blemanager.cpp @@ -88,7 +88,7 @@ void BleManager::onDeviceDiscovered(const QBluetoothDeviceInfo &info) int rightNibble = areValuesFlipped ? podsBatteryByte & 0x0F : (podsBatteryByte >> 4) & 0x0F; deviceInfo.leftPodBattery = (leftNibble == 15) ? -1 : leftNibble * 10; deviceInfo.rightPodBattery = (rightNibble == 15) ? -1 : rightNibble * 10; - int caseNibble = (flagsAndCaseBattery >> 4) & 0x0F; // Extracts upper nibble + int caseNibble = flagsAndCaseBattery & 0x0F; // Extracts lower nibble deviceInfo.caseBattery = (caseNibble == 15) ? -1 : caseNibble * 10; // Parse charging statuses from flags (lower 4 bits of data[7])