Branch: refs/heads/981617 Home: https://github.com/bluez/bluez Commit: 140d3a65108e5c7c3f1fd137c04f437ab5e9159d https://github.com/bluez/bluez/commit/140d3a65108e5c7c3f1fd137c04f437ab5e9159d Author: Pauli Virtanen <pav@xxxxxx> Date: 2025-07-11 (Fri, 11 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