Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH bluez] device: fix loss BREDR info when merge duplicate device
@ 2026-10-10  6:55 Ye He
  2026-10-10  9:52 ` [bluez] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Ye He @ 2026-10-10  6:55 UTC (permalink / raw)
  To: Linux Bluetooth; +Cc: Ye He

Two device objects for the same device in case it has
first been discovered over BREDR and has a private
address when discovered over LE for the next time.
The merge logic doesn't create a new BREDR bearer.
Makes the application loss connection info of BREDR.

Signed-off-by: Ye He <ye.he@amlogic.com>
---
 src/device.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/device.c b/src/device.c
index 8fdef14489540e64b95e7e75d153d532811af611..9b36d01d4cb8fa6f866409901bcbd9ae2d86a886 100644
--- a/src/device.c
+++ b/src/device.c
@@ -5456,9 +5456,22 @@ void device_merge_duplicate(struct btd_device *dev, struct btd_device *dup)
 {
 	GSList *l;
 
-	DBG("");
+	DBG("dev path '%s', dup dev path '%s'", dev->path, dup->path);
+
+	/* copy state */
+	dev->bredr_state = dup->bredr_state;
+	dev->bredr = btd_bearer_new(dev, BDADDR_BREDR);
+	DBG("connected %d, paired %d, bonded %d",
+			dev->bredr_state.connected, dev->bredr_state.paired,
+			dev->bredr_state.bonded);
 
-	dev->bredr = dup->bredr;
+	/* emit bearer properties */
+	if (dev->bredr_state.connected)
+		btd_bearer_connected(dev->bredr, 0);
+	if (dev->bredr_state.paired)
+		btd_bearer_paired(dev->bredr);
+	if (dev->bredr_state.bonded)
+		btd_bearer_bonded(dev->bredr);
 
 	dev->trusted = dup->trusted;
 	dev->blocked = dup->blocked;

---
base-commit: 7428ca2df9356363079db0f48412c20cbdb9471f
change-id: 20260505-device-merge-dd823b9f7dd9

Best regards,
-- 
Ye He <ye.he@amlogic.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [bluez] device: fix loss BREDR info when merge duplicate device
  2026-10-10  6:55 [PATCH bluez] device: fix loss BREDR info when merge duplicate device Ye He
@ 2026-10-10  9:52 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-10-10  9:52 UTC (permalink / raw)
  To: linux-bluetooth, ye.he

[-- Attachment #1: Type: text/plain, Size: 3145 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1182833/

---Test result---

Test Summary:
CheckPatch                    PASS      0.31 seconds
GitLint                       PASS      0.22 seconds
BuildEll                      PASS      15.21 seconds
BluezMake                     PASS      279.65 seconds
CheckSmatch                   PASS      214.98 seconds
bluezmakeextell               PASS      70.40 seconds
TestFunctional                FAIL      993.87 seconds
IncrementalBuild              PASS      274.63 seconds
ScanBuild                     PASS      787.75 seconds

Details
##############################
Test: TestFunctional - FAIL
Desc: Run test-functional
Output:
FAIL functional.test_bluetoothctl::test_bluetoothctl_pair_bredr[hosts15-vm2]: pytest_bluezenv.rpc.RemoteError: <pexpect.popen_spawn.PopenSpawn object at 0x7f62564b2510>
    searcher: searcher_re:
        0: re.compile(b'Changing pairable on succeeded')
    <pexpect.popen_spawn.PopenSpawn object at 0x7f62564b2510>
    searcher: searcher_re:
        0: re.compile(b'Changing pairable on succeeded')
    Remote traceback:
        Traceback (most recent call last):
          File "/usr/local/lib/python3.14/dist-packages/pytest_bluezenv/../pytest_bluezenv/rpc.py", line 102, in server_stream
            result = method(*msg["a"], **msg["kw"])
          File "/usr/local/lib/python3.14/dist-packages/pytest_bluezenv/../pytest_bluezenv/env.py", line 256, in call_plugin
            return getattr(self.plugins[name], method)(*a, **kw)
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
          File "/usr/local/lib/python3.14/dist-packages/pytest_bluezenv/../pytest_bluezenv/host_plugins.py", line 502, in expect
            ret = self.ctl.expect(*a, **kw)
          File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 354, in expect
            return self.expect_list(compiled_pattern_list,
                   ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
                    timeout, searchwindowsize, async_)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 383, in expect_list
            return exp.expect_loop(timeout)
                   ~~~~~~~~~~~~~~~^^^^^^^^^
          File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 181, in expect_loop
            return self.timeout(e)
                   ~~~~~~~~~~~~^^^
          File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 144, in timeout
            raise exc
        pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x7f62564b2510>
        searcher: searcher_re:
            0: re.compile(b'Changing pairable on succeeded')
        <pexpect.popen_spawn.PopenSpawn object at 0x7f62564b2510>
        searcher: searcher_re:
            0: re.compile(b'Changing pairable on succeeded')


https://github.com/bluez/bluez/pull/2656

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-10  9:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-10  6:55 [PATCH bluez] device: fix loss BREDR info when merge duplicate device Ye He
2026-10-10  9:52 ` [bluez] " bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox