[Linux] ble - fix charging state was inverted

This commit is contained in:
Tim Gromeyer
2025-03-09 20:38:44 +01:00
parent 4438cdae6f
commit 6fa8b5d611

View File

@@ -220,9 +220,9 @@ private slots:
// Parse charging status and case battery level (byte 7)
quint8 statusByte = static_cast<quint8>(data[7]);
deviceInfo.caseCharging = (statusByte & 0x02) != 0;
deviceInfo.rightCharging = (statusByte & 0x04) != 0;
deviceInfo.leftCharging = (statusByte & 0x08) != 0;
deviceInfo.caseCharging = (statusByte & 0x02) == 0;
deviceInfo.rightCharging = (statusByte & 0x04) == 0;
deviceInfo.leftCharging = (statusByte & 0x08) == 0;
deviceInfo.caseBattery = ((statusByte >> 4) & 0x0F) * 10; // Scale to 0-100
// Byte 8 is the lid open counter