mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-02-01 15:49:10 +00:00
Add connection state
This commit is contained in:
@@ -77,6 +77,8 @@ void BleManager::onDeviceDiscovered(const QBluetoothDeviceInfo &info)
|
||||
deviceInfo.lidOpenCounter = static_cast<quint8>(data[8]);
|
||||
deviceInfo.deviceColor = static_cast<quint8>(data[9]);
|
||||
|
||||
deviceInfo.connectionState = static_cast<DeviceInfo::ConnectionState>(data[10]);
|
||||
|
||||
// Determine primary pod (bit 5 of status) and value flipping
|
||||
bool primaryLeft = (status & 0x20) != 0; // Bit 5: 1 = left primary, 0 = right primary
|
||||
bool areValuesFlipped = !primaryLeft; // Flipped when right pod is primary
|
||||
@@ -119,6 +121,9 @@ void BleManager::onDeviceDiscovered(const QBluetoothDeviceInfo &info)
|
||||
else
|
||||
deviceInfo.lidState = DeviceInfo::LidState::UNKNOWN;
|
||||
|
||||
|
||||
|
||||
|
||||
// Update timestamp
|
||||
deviceInfo.lastSeen = QDateTime::currentDateTime();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user