From 22c367680acd881cb02a88c4eed6759edb10eabb Mon Sep 17 00:00:00 2001 From: "Claude Opus 5.5" Date: Wed, 7 Oct 2026 02:52:24 +0200 Subject: [PATCH] fix(macos): auto-connect Sony ULT WEAR in the SwiftUI app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v0.3.3 ULT WEAR fix changed MacOSBluetoothConnector::getConnectedDevices, but the macOS app connects through HeadphonesBridge.scanAndConnect, which only auto-selects a paired device that is isConnected AND whose name matches WH-/WF-/WI-/MDR-/XB/LinkBuds. "ULT WEAR" matches neither, so the app fell back to IOBluetoothDeviceSelectorController, which lists only discoverable devices and showed an empty list. - add "ULT" to the Sony name prefixes - if no connected match, fall back to any paired device that looks like a Sony headset (BLE/audio-only links report isConnected == NO) Assisted-by: Nikša Barlović Tested-by: Nikša Barlović --- Client/macos/HeadphonesBridge.mm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Client/macos/HeadphonesBridge.mm b/Client/macos/HeadphonesBridge.mm index 4f1b58d3..59bb044c 100644 --- a/Client/macos/HeadphonesBridge.mm +++ b/Client/macos/HeadphonesBridge.mm @@ -124,7 +124,7 @@ - (BOOL)adaptiveVolume { return _hp && _hp->getAdaptiveVolume(); } static BOOL SHCLooksLikeSonyHeadset(NSString *name) { if (name.length == 0) return NO; - NSArray *prefixes = @[@"WH-", @"WF-", @"WI-", @"MDR-", @"XB", @"LinkBuds"]; + NSArray *prefixes = @[@"WH-", @"WF-", @"WI-", @"MDR-", @"XB", @"LinkBuds", @"ULT"]; for (NSString *p in prefixes) { if ([name hasPrefix:p] || [name containsString:p]) return YES; } @@ -141,6 +141,15 @@ - (void)scanAndConnectWithCompletion:(void (^)(BOOL, NSString * _Nullable))compl break; } } + // BLE/audio-only headsets (e.g. ULT WEAR) report isConnected == NO; fall back to any paired Sony headset. + if (!device) { + for (IOBluetoothDevice *paired in [IOBluetoothDevice pairedDevices]) { + if (SHCLooksLikeSonyHeadset([paired name])) { + device = paired; + break; + } + } + } if (!device) { // Fall back to the native picker if we can't auto-identify a connected Sony device.