IOBluetooth

RSS for tag

Gain user-space access to Bluetooth devices using IOBluetooth.

Posts under IOBluetooth tag

35 Posts

Post

Replies

Boosts

Views

Activity

My user can't pair bluetooth peripheral, due to device lost in SYSTEM BLUETOOTH PREPHERAL LIST
[sysdiagnose_2025.10.01_18-29-27+0800_iPhone-OS_iPhone_23A341] I got sysdiagnose from my app user.He can't pair his bluetooth peripheral. in the sysdiagnose,I found this: device AC:7A:94:85:47:F4 is already paired, with a different irk (old:F5 C9 4F 5A 4E BE D0 20 0A 1F F7 DC 3A 89 E0 3A new 4A 8A 00 4C FF D0 CE 7B 61 13 FA B3 84 F4 65 29 ). Unpair first and then restart pairing. (status=65535) but there is no device in his iphone's SYSTEM BLUETOOTH PREPHERAL LIST. I don't know how to delete the irk info when you can't find it in SYSTEM BLUETOOTH PREPHERAL LIST. PLEASE answer me. THANKS.
1
0
70
2d
AirPods with H2 and studio-quality recording - how to replicate Camera video capture
Using an iPhone Pro 12 running iOS 26.0.1, with AirPods Pro 3. Camera app does capture video with what seems to be "Studio Quality Recording". Am trying to replicate that SQR with my own Camera like app, and while I can pull audio in from the APP3 mic, and my video capture app is recording a 48,000Hz high-bitrate video, the audio still sounds non-SQR. I'm seeing bluetoothA2DP , bluetoothLE , bluetoothHFP as portType, and not sure if SQR depends on one of those? Is there sample code demonstrating a SQR capture? Nevermind video and camera, just audio even? Also, I don't understand what SQR is doing between the APP3 and the iPhone. What codec is that? What bitrate is that? If I capture video using Capture and inspect the audio stream I see mono 74.14 kbit/s MPEG-4 AAC, 48000 Hz. But I assume that's been recompressed and not really giving me any insight into the APP3 H2 transmission?
1
0
70
2d
HID Braille keyboard support on iPhone 6S
Hello, I am working on a Braille keyboard by using HID approach. Current the device works with iPhone 11 and SE3. However, when tested in iPhone 6s with iOS 15, although the device can be connected and recognized as Braille device in VoiceOver screen, the phone shows no response to key press report. Would there be any requirement at points such as HID descriptor for iPhone 6s support on Braille device? If iPhone 6s does not support such devices, what is the minimum system requirements? Thank you!
1
1
1.4k
3w
How can I get a cover-art image via Bluetooth BIP
I want to get Cover-Art Image over Bluetooth. From the SDP Discover iPhoneSE, it support Cover-Art Feature. I connect and config OBEX Channel with L2CAP ERTM, it is successful. I send connect_request the OBEX Connect, the iPhone always no any response, and l2cap s-frame response from iPhone always failed. From the Apple Developer, it need Apple Authentication Chip. Is it still necessary now? Are there any other ways to obtain album pictures?
0
0
59
Jun ’25
IOBluetoothHandsFreeDevice API confusion
I wonder how one would use IOBluetoothHandsFree APIs to interact from macOS app with a bluetooth device that implements bluetooth hands free profile. My current observation is as follows: IOBluetoothDevice object representing the device correctly identifies it as a hands free device, i.e.: there is a proper record in services array, that matches the kBluetoothSDPUUID16ServiceClassHandsFree uuid, the IOBluetoothDevice handsFreeDevice property returns 1 Attempt to create IOBluetoothHandsFreeDevice using IOBluetoothDevice as described above (i.e. [[IOBluetoothHandsFreeDevice alloc] initWithDevice: myIOBluetoothDeviceThatHasHandsFreeDevicePropertySetTo1 delegate: self]) results in the following output in debugger console: SRS-XB20 is not a hands free device but trying anyways. Subsequent call to connect on an object constructed as above results in the following stream of messages: API MISUSE: <CBClassicPeer: 0x1442447b0 6D801974-5457-9ECE-0A9B-8343EC4F60AA, SRS-XB20, connected, Paired, b8:d5:0b:03:62:70, devType: 19, PID: 0x1582, VID: 0x0039> Invalid RFCOMM CID -[IOBluetoothRFCOMMChannel setupRFCOMMChannelForDevice] No channel <IOBluetoothRFCOMMChannel: 0x600003e5de00 SRS-XB20, b8-d5-0b-03-62-70, CID: 0, UUID: 110F > AddInstanceForFactory: No factory registered for id <CFUUID 0x600000b5e3e0> F8BB1C28-BAE8-11D6-9C31-00039315CD46 -[IOBluetoothRFCOMMChannel setupRFCOMMChannelForDevice] No channel <IOBluetoothRFCOMMChannel: 0x600003e5de00 SRS-XB20, b8-d5-0b-03-62-70, CID: 0, UUID: 110F > API MISUSE: <CBClassicPeer: 0x1442447b0 6D801974-5457-9ECE-0A9B-8343EC4F60AA, SRS-XB20, connected, Paired, b8:d5:0b:03:62:70, devType: 19, PID: 0x1582, VID: 0x0039> Invalid RFCOMM CID Note that this device's handsFreeServiceRecord looks as follows: ServiceName: Hands-free unit RFCOMM ChannelID: 1 Attributes: { 0 = "uint32(65539)"; 256 = "string(Hands-free unit)"; 9 = "{ { uuid32(00 00 11 1e), uint32(262) } }"; 785 = "uint32(63)"; 1 = "uuid32(00 00 11 1e)"; 6 = "{ uint32(25966), uint32(106), uint32(256) }"; 4 = "{ { uuid32(00 00 01 00) }, { uuid32(00 00 00 03), uint32(1) } }"; } and explicit attempt to open RFCOMM channel no 1 ends like this: WARNING: Unknown error: 911 Failed to open RFCOMM channel -[IOBluetoothRFCOMMChannel setupRFCOMMChannelForDevice] No channel <IOBluetoothRFCOMMChannel: 0x6000002036c0 SRS-XB20, b8-d5-0b-03-62-70, CID: 1, UUID: 111E > AddInstanceForFactory: No factory registered for id <CFUUID 0x600003719260> F8BB1C28-BAE8-11D6-9C31-00039315CD46 -[IOBluetoothRFCOMMChannel waitforChanneOpen] CID:1 - timed out waiting to open -[IOBluetoothDevice openRFCOMMChannelSync:withChannelID:delegate:] CID:1 error -536870212 call returned: -536870212
0
0
84
Jun ’25
`sdpQueryComplete:status:` not being called
I try to refresh the SDP data for a Bluetooth device that has reconnected. So when I receive connect notification I call -[IOBluetoothDevice performSDPQuery:] passing object, that should receive the query completion call. What I observe is that sdpQueryComplete:status: is not being called, buit calling performSDPQuery causes additional connect notification to be dispatched. Running this under debugger results in some weird log line: [IOBluetooth] **** This currently won't trigger SDP delegate I run this code on Sequoia 15.5
2
0
64
May ’25
How can I prevent virtual location from affecting the security of my app
Hello, I have noticed that some users have modified their real location through an app called "MGU" to bypass my app's security checks. I want to know how to protect my app and detect users using virtual location. I have reproduced the process of virtual positioning here: Insert a plug-in through the interface at the bottom of the phone and connect it via Bluetooth on the phone Set the desired positioning target on the "MGU" app Turn off your phone's WiFi, network, and location for 10 seconds, then turn it back on At this point, virtual positioning is successful. Please assist me in troubleshooting this issue and inform me of the principle of implementing virtual positioning in this app and how to prevent it. The following is the screen recording of virtual positioning operation: https://flowus.cn/share/145b3232-26c3-4ea3-b3ff-4aad1495eb4d
1
0
94
Apr ’25
NSLocalizedDescription = \"Peer removed pairing information\";
After hardware and mobile phone hid mode pairing, the first connection is successful, after a while disconnect and reconnect,APP monitoring Bluetooth error NSLocalizedDescription = "Peer removed pairing information"; Failed to connect Hardware engineers detect the pairing information and find that the local pairing information of the iPhone has changed, which is a non-mandatory phenomenon
1
0
106
Apr ’25
BLE timeout issue when connecting two devices on iOS 18 (but not iOS 16)
Hi, We’re developing a BLE peripheral device and encountered a connection issue when connecting two devices (Device A and Device B) simultaneously to an iOS device. Problem: On iOS 18, we are experiencing occasional BLE timeouts and disconnections when both devices are connected at the same time. On iOS 16, we did not encounter this issue under the same conditions. What we’ve tried: Adjusted the connection interval from 30ms to 15ms. This seems to have improved stability somewhat. However, we still observe intermittent timeout/disconnection issues. Questions: Are there any known changes in BLE connection handling or timing constraints in iOS 18? Are there recommended connection parameter settings (interval, latency, timeout, etc.) for multi-device BLE connections in iOS? Is there a way to debug or log more details about the disconnection reasons on the iOS side? Any guidance or suggestions would be greatly appreciated.
0
0
80
Apr ’25
Bluetooth
你好,有个问题想请教一下: 我们的app是一款与CGM实时血糖相关的app,app支持在后台通过蓝牙跟CGM血糖设备保持连接。 现在遇到一个问题: 首先,app在后台运行期间,蓝牙是开启状态的,跟CGM设备也是连接的状态。 某个时刻,监听到蓝牙的状态突然从 poweredOn 变为了 resetting ,然后蓝牙又恢复了,状态变为了 poweredOn 这时候,问题出现了:之前连接的那个CGM血糖设备一直无法扫描到了!! 我想问一下: 什么情况下,蓝牙状态会变为resetting 蓝牙状态恢复为poweredOn后,之前连接的那个CGM血糖设备一直无法扫描到了,为什么?我要怎么做才能恢复,重新扫描到之前连接的这个设备?
1
0
69
Mar ’25
CarPlay shows black screen on my car for first connection if iOS version larger than 17.5
iPhone: iPhone 12 pro max, iOS:18.3.1 Step: Connect CarPlay to my car, after connection success, CarPlay screen is black. This issue only happens of first time connection; I have asked OEM factory, they told me because of my iOS version is larger than 17.5, and above this version, will have this issue. So, I need your help to figure problem and update in new version.
0
0
294
Mar ’25
watchOS 10.2 Bluetooth in the background often disconnects
My watch APP needs to keep Bluetooth connected with peripherals whether it is in the foreground or background, but the results of my test show that the connection in the background is very unstable, sometimes you can keep the Bluetooth on for a day, but sometimes it will be disconnected 50 times a day, and every time it is disconnected, I will immediately initiate a reconnection, it is certain that there is no problem with the peripheral Bluetooth, because I have another iOS device that has been stably connected to the peripheral, I want to know what causes this instability, and if there is any solution, if someone can provide relevant advice, I will be very grateful
2
1
929
Mar ’25
PHPickerViewController No Auto Focus
The issue is, I cannot auto acquire bluetooth keyboard focus in PHPickerViewController after enabling 'Full Keyboard Access' in my IPhone 14 with iOS version 18.3.1. The keyboard focus in PHPickerViewController will show, however, after I tapped on the blank space of the PHPickerViewController. How to make the focus on at the first place then? I'm using UINavigationController and calling setNavigationBarHidden(true, animated: false). Then I use this controller to present PHPickerViewController using some configuration setup below. self.configuration = PHPickerConfiguration() configuration.filter = .any(of: filters) configuration.selectionLimit = selectionLimit if #available(iOS 15.0, *), allowOrdering { configuration.selection = .ordered } configuration.preferredAssetRepresentationMode = .current Finally I set the delegate to PHPickerViewController and call UINavigationController.present(PHPickerViewController, animated: true) to render it. Also I notice animation showing in first video then disappear.
2
0
264
Mar ’25
Bluetooth peripheral factory reset
Hi, I'm developing a bluetooth peripheral. During factory reset I generate a new IRK and drop any bond information it has. When I then try to bond again with the device iOS returns bonding failed with 0x08 (unspecified reason). I assume that iOS somehow still thinks my reset device is the same as the device it has already bonded with. What information about the device is it using to draw this conclusion? Bonding works if I remove the "pre-reset" peripheral from the iOS list of bluetooth devices. Regards
1
0
184
Mar ’25
Playing audio live from Bluetooth headset on iPhone speaker
Hi guys, I am having issue in live-streaming audio from Bluetooth headset and playing it live on the iPhone speaker. I am able to redirect audio back to the headset but this is not what I want. The issue happens when I am trying to override output - the iPhone switches to speaker but also switches a microphone. This is example of the code: import AVFoundation class AudioRecorder { let player: AVAudioPlayerNode let engine:AVAudioEngine let audioSession:AVAudioSession let audioSessionOutput:AVAudioSession init() { self.player = AVAudioPlayerNode() self.engine = AVAudioEngine() self.audioSession = AVAudioSession.sharedInstance() self.audioSessionOutput = AVAudioSession() do { try self.audioSession.setCategory(AVAudioSession.Category.playAndRecord, options: [.defaultToSpeaker]) try self.audioSessionOutput.setCategory(AVAudioSession.Category.playAndRecord, options: [.allowBluetooth]) // enables Bluetooth HFP profile try self.audioSession.setMode(AVAudioSession.Mode.default) try self.audioSession.setActive(true) // try self.audioSession.overrideOutputAudioPort(.speaker) // doens't work } catch { print(error) } let input = self.engine.inputNode self.engine.attach(self.player) let bus = 0 let inputFormat = input.inputFormat(forBus: bus) self.engine.connect(self.player, to: engine.mainMixerNode, format: inputFormat) input.installTap(onBus: bus, bufferSize: 512, format: inputFormat) { (buffer, time) -> Void in self.player.scheduleBuffer(buffer) print(buffer) } } public func start() { try! self.engine.start() self.player.play() } public func stop() { self.player.stop() self.engine.stop() } } I am not sure if this is a bug or not. Can somebody point me into the right direction? I there a way to design a custom audio routing? I would also appreciate some good documentation besides AVFoundation docs.
0
0
274
Mar ’25