Branch: refs/heads/986817 Home: https://github.com/bluez/bluez Commit: 6f89e9308eef4342944214a7d3ee1ff875aa3756 https://github.com/bluez/bluez/commit/6f89e9308eef4342944214a7d3ee1ff875aa3756 Author: Pauli Virtanen <pav@xxxxxx> Date: 2025-07-29 (Tue, 29 Jul 2025) Changed paths: M profiles/battery/battery.c Log Message: ----------- profiles/battery: handle reversed ordering of CCC and value Order of batt_io_value_cb() and batt_io_ccc_written_cb() may be reverse. This causes device to appear with 0% or missing battery percentage, because batt->percentage is set on the ignored update so the initial update is lost. Fix by saving new initial value, if battery is not registered. Also downgrade warning to debug message. Also check data length before parsing it. Log (Sony Linkbuds S): src/shared/att.c:can_read_data() (chan 0x7c31eea05c50) ATT PDU received: 0x1b profiles/battery/battery.c:parse_battery_level() Battery Level updated: 87% profiles/battery/battery.c:parse_battery_level() Trying to update an unregistered battery src/battery.c:btd_battery_register() path = /org/bluez/hci1/dev_CF_D2_4D_EE_A2_1A src/battery.c:btd_battery_register() registered Battery object: /org/bluez/hci1/dev_CF_D2_4D_EE_A2_1A profiles/battery/battery.c:batt_io_ccc_written_cb() Battery Level: notification enabled To unsubscribe from these emails, change your notification settings at https://github.com/bluez/bluez/settings/notifications