mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-02-10 19:52:24 +00:00
[Linux] ble - fix charging state was inverted
This commit is contained in:
@@ -220,9 +220,9 @@ private slots:
|
|||||||
|
|
||||||
// Parse charging status and case battery level (byte 7)
|
// Parse charging status and case battery level (byte 7)
|
||||||
quint8 statusByte = static_cast<quint8>(data[7]);
|
quint8 statusByte = static_cast<quint8>(data[7]);
|
||||||
deviceInfo.caseCharging = (statusByte & 0x02) != 0;
|
deviceInfo.caseCharging = (statusByte & 0x02) == 0;
|
||||||
deviceInfo.rightCharging = (statusByte & 0x04) != 0;
|
deviceInfo.rightCharging = (statusByte & 0x04) == 0;
|
||||||
deviceInfo.leftCharging = (statusByte & 0x08) != 0;
|
deviceInfo.leftCharging = (statusByte & 0x08) == 0;
|
||||||
deviceInfo.caseBattery = ((statusByte >> 4) & 0x0F) * 10; // Scale to 0-100
|
deviceInfo.caseBattery = ((statusByte >> 4) & 0x0F) * 10; // Scale to 0-100
|
||||||
|
|
||||||
// Byte 8 is the lid open counter
|
// Byte 8 is the lid open counter
|
||||||
|
|||||||
Reference in New Issue
Block a user