From: Pauli Virtanen <noreply@github.com>
To: linux-bluetooth@vger.kernel.org
Subject: [bluez/bluez] 140d3a: profiles/battery: handle reversed ordering of CCC ...
Date: Fri, 11 Jul 2025 10:46:05 -0700 [thread overview]
Message-ID: <bluez/bluez/push/refs/heads/981617/000000-140d3a@github.com> (raw)
Branch: refs/heads/981617
Home: https://github.com/bluez/bluez
Commit: 140d3a65108e5c7c3f1fd137c04f437ab5e9159d
https://github.com/bluez/bluez/commit/140d3a65108e5c7c3f1fd137c04f437ab5e9159d
Author: Pauli Virtanen <pav@iki.fi>
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
reply other threads:[~2025-07-11 17:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bluez/bluez/push/refs/heads/981617/000000-140d3a@github.com \
--to=noreply@github.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).