[PATCH BlueZ 0/1] Fix com.bluez.battery1 randomly missing percentage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For more than a year, I often found that the
org.bluez.Battery1 dbus interface randomly failed to
obtain the battery level of some devices.

When this happens, it is always accompanied by a
"Trying to update an unregistered battery" log.

Finally, I found a bug in battery.c:parse_battery_level().
Except when called for the first time, it will wait
until the battery percentage changes before updating
the value in the dbus interface.

For BLE devices, changes in battery percentage will
take a long time, which is enough for the device
to disconnect/reconnect multiple times due to
sleep/wake-up. And every reconnection has a chance to
cause "Trying to update an unregistered battery".

This is a new version of the previous patch, fixes
the style problem.
> id: 20240723082843.184915-1-YanceyChiew () gmail ! com

Yancey Chiew (1):
  profiles/battery: Fix batt random lose percentage

 profiles/battery/battery.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

-- 
2.45.2





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux