Commit 694b857
authored
fix(protocol): handle out-of-range battery voltage as unavailable (#516)
Add minimum voltage check in HIDPPDevice::requestBatteryHIDPP to return
BATTERY_UNAVAILABLE when measured voltage is below the device's calibrated
minimum. This prevents spline interpolation on invalid readings from
offline or disconnected headsets.
All HID++ battery calibrations store voltages in descending order, so
calibration.voltages.back() correctly returns the minimum valid voltage.
Affected devices:
- Logitech G633/G635/G733/G933/G935 (LOGITECH_G633 calibration)
- Logitech G533 (LOGITECH_G533 calibration)
- Logitech G535 (LOGITECH_G535 calibration)
- Logitech G PRO Series (LOGITECH_GPRO calibration)1 parent b10c0ed commit 694b857
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
138 | 151 | | |
139 | 152 | | |
140 | 153 | | |
| |||
0 commit comments