IOBluetooth

RSS for tag

Gain user-space access to Bluetooth devices using IOBluetooth.

Posts under IOBluetooth tag

190 Posts

Post

Replies

Boosts

Views

Activity

VisionOS Bluetooth usage
Hi! I have previously developed an app that established a Bluetooth connection between two devices (two iPads). Now, I want to port the client-side app to VisionPro. Similar to the iPad app, I have supplemented my info.plist file with the following line: NSBluetoothAlwaysUsageDescription Uses BLE to communicate with devices. Despite this, when I launch the app on VisionPro, the prompt to use Bluetooth does not appear. What could be the issue? What additional settings do I need to configure to enable Bluetooth usage?
1
0
967
Mar ’24
What is the thread safety status of the IOBluetooth framework?
[Q] What is the thread safety status of the IOBluetooth framework? Is it possible call any class from the IOBluetooth framework from a secondary thread? I haven't found so far information about this in the documentation and the only pieces of info you can find through a google search say the framework is not thread safe but these are old pieces of info.
3
0
1.7k
Feb ’24
IOBluetooth: discovering if my (classic) bluetooth headset is "connected" to macOS
I want my program to behave differently if a specific bluetooth headset is "connected" to the system. By "connected" I mean that it is: paired with the system appears on a list of audio output in Settings (not necessarily selected as default output) appears on "My Devices" list in Bluetooth preference pane with "Connected" status. I want this to determine "availability" of the device, i.e. likehood that establishing an active connection will succeed. Apparently IOBluetooth does not offer API to easily achieve this... I've tried: [IOBluetooth pairedDevices] to iterate though paired device list. This one correctly returns IOBluetoothDevice object representing my device. When I call [IOBluetoothDevice isConnected] it returns false even though device is listed as "connected" on My Devices list in Bluetooth settings. If I leave the headset at original place, go with my mac to a physically different location and call getLastInqiuryUpdate or recentAccessDate, both return current time, even though the headset is not in range for several days now. So I'm looking to determine the headset "connected" state the same way Bluetooth Settings pane does it and without making an active connection attempt.
0
1
825
Feb ’24
Issues with Bluetooth Streaming Speed and GATT Operations Post-Sonoma Update
Hello everyone, I've developed an application using ElectronJS and NodeJS, utilizing the Web Bluetooth API for connecting to and streaming data from peripherals. Initially, this was built and tested on macOS Ventura, where everything worked as expected. However, I've encountered a couple of issues post the Sonoma update. Issue 1: Slower Streaming Speed Post-Sonoma Update After updating to Sonoma, the streaming speed from peripherals significantly decreased. This is perplexing because the app continues to perform well on Ventura. To troubleshoot, I even developed a version using Rust with the btleplug library, hoping for improved Bluetooth performance. However, this did not lead to any noticeable difference; both the Electron and Rust versions perform nearly the same. Has anyone experienced similar issues or knows what might be causing this slowdown? Issue 2: GATT Operation Error Resolved, but Streaming Speed Affected On Ventura, one specific command consistently failed with a GATT operation error. Interestingly, post-Sonoma update, this command works without error, but this seems to have affected the streaming speed. The improved GATT operation seems to come at the cost of decreased streaming performance. Is there a known connection between these two aspects, or has anyone observed a similar trade-off? I'm looking for insights or suggestions to resolve these issues, particularly the streaming speed degradation post-Sonoma. The application needs to maintain consistent performance across different macOS versions, and these discrepancies are quite challenging. Thank you in advance for your help and insights! Best regards,
0
0
723
Jan ’24
Bluetooth LE Secure Connection issues
I am developing an App that uses BLE to connect to third-party devices. Considering information security, perform a LE Secure Connection before BLE connection. But we encountered an issue: after uninstalling the App and reinstalling it, the paired device cannot be connected again. This requires to ignore this device in Settings to continue using it. But we can't do this, it's not friendly to our customers. So, I would like to ask the developers here if they know how to solve this issue. Thank you
1
0
761
Jan ’24
objectC, swift, swiftUI, Bluetooth classic, Bluetooth Low Energy, IOS deploy version? Users Number?
objectC program: iOS all : iPhone ~ swift program. : iOS 13 ~ : iPhone 6s ~ swiftUI Program : iOS 13 ~ : iPhone 6s ~ bluetooth classic : ~ iPhone 4s Bluetooth Low Engery : iPhone 5 ~ are All above content right? i am making iOS app with swiftUI app, and Bluetooth Low Energy. after making app, i found that my app can run on greater than iOS13 , iPhone 6s. how many is ther number of above iPhone6s User ?
0
0
811
Dec ’23
Protocol availability inconsistencies related to modern serial layers
I am currently writing a iPadOS application to act as a companion to the desktop version that controls a piece of hardware via a USB CDC serial connection. Due to modern iPads having USB-C ports for the last 2 years and the ability to attach certain USB devices via adaptors since the origin of the 30pin doc connector I would expect protocol availability to be fairly complete. So then why is it that the headers required to use USB CDC serial don't exist and if you make them yourself you need to use illegal symbols so you can't upload it to App Store connect. Where as USB CDC ethernet has full support along with Bluetooth RFCOMM (rs232 serial over bluetooth) and even USB MIDI given that midi is a superset of serial. So why isn't there a USB CDC serial kit/api/even just allowing a data stream to the TTY/CU port? If there is a way please tell me what it is and point me to the documentation.
11
0
6.5k
Dec ’23
How to make sound output from Bluetooth instead of speakers in IOS 17
When I set the AVAudioSessionCategory avAudioSessionCategory: AVAudioSessionCategory.playAndRecord, sound to come out of the built-in speaker instead of Bluetooth headphones。ios17 。It is normal in IOS 16 or 15 final session = await AudioSession.instance; await session.configure(AudioSessionConfiguration( avAudioSessionCategory: AVAudioSessionCategory.playAndRecord, avAudioSessionCategoryOptions:AVAudioSessionCategoryOptions.allowBluetooth | AVAudioSessionCategoryOptions.allowBluetoothA2dp, avAudioSessionMode: AVAudioSessionMode.defaultMode, avAudioSessionRouteSharingPolicy: AVAudioSessionRouteSharingPolicy.defaultPolicy, avAudioSessionSetActiveOptions: AVAudioSessionSetActiveOptions.none, androidAudioAttributes: const AndroidAudioAttributes( contentType: AndroidAudioContentType.music, flags: AndroidAudioFlags.none, usage: AndroidAudioUsage.media, ), androidAudioFocusGainType: AndroidAudioFocusGainType.gain, androidWillPauseWhenDucked: true, )); How to make sound output from Bluetooth instead of speakers in IOS 17? How to make sound output from Bluetooth instead of speakers in IOS 17?
1
0
856
Dec ’23
Bluetooth issue of macOS Ventura
Always failed to add IOBluetoothSDPServiceRecord in macOS Ventura As the title said, after I called the method "publishedServiceRecordWithDictionary", the Bluetooth XPC connection would always be interrupted and reset. The same code that I run in macOS Monterey is well executed without any warning. And I got the following logs : [CoreBluetooth] XPC connection interrupted, resetting [IOBluetooth] Failed to add service record [CoreBluetooth] XPC connection interrupted, resetting [CoreBluetooth] XPC connection interrupted, resetting [CoreBluetooth] XPC connection interrupted, resetting [CoreBluetooth] XPC connection interrupted, resetting
8
1
3.4k
Nov ’23
Calling IOBluetoothSDPServiceRecord.publishedServiceRecord crashes bluetoothd
Hi, I have an App KeyPad that lets you use your mac keyboard as a bluetooth keyboard for your iPhone, TV, iPad, another Mac, Windows PC. https://apps.apple.com/us/app/keypad-bluetooth-keyboard/id1491684442?mt=12 Ever since the release of MacOS Ventura this app is no longer working. I have raised feedback report in december, and there is no activity on it. FB11869248 Essentially if I call publishedServiceRecord with a 16bit UUID in "0001 - ServiceClassIDList" the bluetoothd crashes and kills all bluetooth connections (Mouse, keyboard, headset...everything) and then reconnects. This is 100% reproducible. What is interesting is that if a user installs my App on MacOS Monterey, it works, and if they upgrade to MacOS Ventura, it will continue to work. But if they install it new in Ventura it will not work. Even more interesting, because my app was installed in Monterey, all OTHER similar apps will work on Ventura. I suspect that this is some sort of permission issue but I am not getting any support. Anybody see something similar. Sam
1
0
1.2k
Nov ’23
CUPS Bluetooth Printer issue with Mac OS Sonoma 14 & 14.1
I am trying to print using CUPS and my own backend, Bluetooth, but it is failing on macOS Sonoma. The backend I built don’t have permission to perform Bluetooth communication or get a list of Paired devices. I granted permissions to /usr/libexec/cups/backend/ from System Settings -> Privacy and Security -> Bluetooth, but that did not solve the problem. When I run only the backend I created, the permission dialog appears and I can print, but when I try to print from CUPS, it does not appear and fails to print. The print queue still shows "Ready to print" and the job remains. Printing succeeds with USB and LAN, but only with Bluetooth. Printing succeeds on 13.6 and earlier, problem occurs on 14 and 14.1. Please let me know how to give permission to my backend.
0
0
926
Oct ’23
iOS 17.1 Not Supporting Bluetooth Devices
Does the new iOS 17.1 not support bluetooth devices anymore? I have a set of Bose head phones that I use all day when I work. I used to be able to listen to podcasts, audiobooks and pdf's using VoiceDream. Now, the apps don't work w/ the headphones. They work when not using the headphones, but only the phone works with the headphones. is there a work around?
2
0
944
Oct ’23
Why is BLE easily disconnected after pairing in cellular networks on iOS 17.3.1
Why is BLE easily disconnected after pairing in cellular networks on iOS 17.3.1, and this situation does not occur in WLAN
Replies
0
Boosts
0
Views
739
Activity
Mar ’24
VisionOS Bluetooth usage
Hi! I have previously developed an app that established a Bluetooth connection between two devices (two iPads). Now, I want to port the client-side app to VisionPro. Similar to the iPad app, I have supplemented my info.plist file with the following line: NSBluetoothAlwaysUsageDescription Uses BLE to communicate with devices. Despite this, when I launch the app on VisionPro, the prompt to use Bluetooth does not appear. What could be the issue? What additional settings do I need to configure to enable Bluetooth usage?
Replies
1
Boosts
0
Views
967
Activity
Mar ’24
Get Magic Mouse battery level programmatically.
I need a Swift function to obtain the Magic Mouse battery level. I am working on an app to display the battery level in the Status Bar. I have the Status Bar code working. Functions for the Wireless keyboard and Track Pad would also be helpful.
Replies
0
Boosts
0
Views
679
Activity
Feb ’24
Scheduler periodic 15 min
Hi, I am developing a service that reads data from wearable devices. It should launch the scheduler every 15 min, but however sometimes there is a delay of 1 - 5 minutes, there are days that the scheduler does not run between 23:00 to 7 am, I am using BGAppRefreshTaskRequest. Can someone give me a hand?
Replies
1
Boosts
0
Views
843
Activity
Feb ’24
What is the thread safety status of the IOBluetooth framework?
[Q] What is the thread safety status of the IOBluetooth framework? Is it possible call any class from the IOBluetooth framework from a secondary thread? I haven't found so far information about this in the documentation and the only pieces of info you can find through a google search say the framework is not thread safe but these are old pieces of info.
Replies
3
Boosts
0
Views
1.7k
Activity
Feb ’24
IOBluetooth: discovering if my (classic) bluetooth headset is "connected" to macOS
I want my program to behave differently if a specific bluetooth headset is "connected" to the system. By "connected" I mean that it is: paired with the system appears on a list of audio output in Settings (not necessarily selected as default output) appears on "My Devices" list in Bluetooth preference pane with "Connected" status. I want this to determine "availability" of the device, i.e. likehood that establishing an active connection will succeed. Apparently IOBluetooth does not offer API to easily achieve this... I've tried: [IOBluetooth pairedDevices] to iterate though paired device list. This one correctly returns IOBluetoothDevice object representing my device. When I call [IOBluetoothDevice isConnected] it returns false even though device is listed as "connected" on My Devices list in Bluetooth settings. If I leave the headset at original place, go with my mac to a physically different location and call getLastInqiuryUpdate or recentAccessDate, both return current time, even though the headset is not in range for several days now. So I'm looking to determine the headset "connected" state the same way Bluetooth Settings pane does it and without making an active connection attempt.
Replies
0
Boosts
1
Views
825
Activity
Feb ’24
Handling data from bluetooth device
Hi, I am inquiring in regard to how to handle data from a bluetooth device. The device would send data in JSON format to a Mac via bluetooth, and I would need to constantly refresh or fetch data from the device in real time. How would I go about this? Any help would be greatly appreciated. Thank you.
Replies
1
Boosts
0
Views
882
Activity
Jan ’24
Update on API for Airpods Pro
Looking to see if there's been any update with Airpods Pro having an API that developers can use to create new features on top of the earbud.
Replies
0
Boosts
0
Views
707
Activity
Jan ’24
Issues with Bluetooth Streaming Speed and GATT Operations Post-Sonoma Update
Hello everyone, I've developed an application using ElectronJS and NodeJS, utilizing the Web Bluetooth API for connecting to and streaming data from peripherals. Initially, this was built and tested on macOS Ventura, where everything worked as expected. However, I've encountered a couple of issues post the Sonoma update. Issue 1: Slower Streaming Speed Post-Sonoma Update After updating to Sonoma, the streaming speed from peripherals significantly decreased. This is perplexing because the app continues to perform well on Ventura. To troubleshoot, I even developed a version using Rust with the btleplug library, hoping for improved Bluetooth performance. However, this did not lead to any noticeable difference; both the Electron and Rust versions perform nearly the same. Has anyone experienced similar issues or knows what might be causing this slowdown? Issue 2: GATT Operation Error Resolved, but Streaming Speed Affected On Ventura, one specific command consistently failed with a GATT operation error. Interestingly, post-Sonoma update, this command works without error, but this seems to have affected the streaming speed. The improved GATT operation seems to come at the cost of decreased streaming performance. Is there a known connection between these two aspects, or has anyone observed a similar trade-off? I'm looking for insights or suggestions to resolve these issues, particularly the streaming speed degradation post-Sonoma. The application needs to maintain consistent performance across different macOS versions, and these discrepancies are quite challenging. Thank you in advance for your help and insights! Best regards,
Replies
0
Boosts
0
Views
723
Activity
Jan ’24
Bluetooth LE Secure Connection issues
I am developing an App that uses BLE to connect to third-party devices. Considering information security, perform a LE Secure Connection before BLE connection. But we encountered an issue: after uninstalling the App and reinstalling it, the paired device cannot be connected again. This requires to ignore this device in Settings to continue using it. But we can't do this, it's not friendly to our customers. So, I would like to ask the developers here if they know how to solve this issue. Thank you
Replies
1
Boosts
0
Views
761
Activity
Jan ’24
objectC, swift, swiftUI, Bluetooth classic, Bluetooth Low Energy, IOS deploy version? Users Number?
objectC program: iOS all : iPhone ~ swift program. : iOS 13 ~ : iPhone 6s ~ swiftUI Program : iOS 13 ~ : iPhone 6s ~ bluetooth classic : ~ iPhone 4s Bluetooth Low Engery : iPhone 5 ~ are All above content right? i am making iOS app with swiftUI app, and Bluetooth Low Energy. after making app, i found that my app can run on greater than iOS13 , iPhone 6s. how many is ther number of above iPhone6s User ?
Replies
0
Boosts
0
Views
811
Activity
Dec ’23
Protocol availability inconsistencies related to modern serial layers
I am currently writing a iPadOS application to act as a companion to the desktop version that controls a piece of hardware via a USB CDC serial connection. Due to modern iPads having USB-C ports for the last 2 years and the ability to attach certain USB devices via adaptors since the origin of the 30pin doc connector I would expect protocol availability to be fairly complete. So then why is it that the headers required to use USB CDC serial don't exist and if you make them yourself you need to use illegal symbols so you can't upload it to App Store connect. Where as USB CDC ethernet has full support along with Bluetooth RFCOMM (rs232 serial over bluetooth) and even USB MIDI given that midi is a superset of serial. So why isn't there a USB CDC serial kit/api/even just allowing a data stream to the TTY/CU port? If there is a way please tell me what it is and point me to the documentation.
Replies
11
Boosts
0
Views
6.5k
Activity
Dec ’23
Bluetooth RFCOMM server example for macOS
Hello, I have found an example of Bluetooth RFCOMM client for macOS on GitHub. I search now an example of Bluetooth RFCOMM server for macOS. Thanks.
Replies
0
Boosts
0
Views
1k
Activity
Dec ’23
Bluetooth RFCOMM client and server on macOS
Hello, I try to create a Bluetooth RFCOMM client and server on macOS, I tried using this project on GitHub but I have this message : The device does not have the necessary services. and it's impossible to connect to the device. do you know an example project that working ? Thanks
Replies
0
Boosts
0
Views
718
Activity
Dec ’23
How to make sound output from Bluetooth instead of speakers in IOS 17
When I set the AVAudioSessionCategory avAudioSessionCategory: AVAudioSessionCategory.playAndRecord, sound to come out of the built-in speaker instead of Bluetooth headphones。ios17 。It is normal in IOS 16 or 15 final session = await AudioSession.instance; await session.configure(AudioSessionConfiguration( avAudioSessionCategory: AVAudioSessionCategory.playAndRecord, avAudioSessionCategoryOptions:AVAudioSessionCategoryOptions.allowBluetooth | AVAudioSessionCategoryOptions.allowBluetoothA2dp, avAudioSessionMode: AVAudioSessionMode.defaultMode, avAudioSessionRouteSharingPolicy: AVAudioSessionRouteSharingPolicy.defaultPolicy, avAudioSessionSetActiveOptions: AVAudioSessionSetActiveOptions.none, androidAudioAttributes: const AndroidAudioAttributes( contentType: AndroidAudioContentType.music, flags: AndroidAudioFlags.none, usage: AndroidAudioUsage.media, ), androidAudioFocusGainType: AndroidAudioFocusGainType.gain, androidWillPauseWhenDucked: true, )); How to make sound output from Bluetooth instead of speakers in IOS 17? How to make sound output from Bluetooth instead of speakers in IOS 17?
Replies
1
Boosts
0
Views
856
Activity
Dec ’23
Bluetooth issue of macOS Ventura
Always failed to add IOBluetoothSDPServiceRecord in macOS Ventura As the title said, after I called the method "publishedServiceRecordWithDictionary", the Bluetooth XPC connection would always be interrupted and reset. The same code that I run in macOS Monterey is well executed without any warning. And I got the following logs : [CoreBluetooth] XPC connection interrupted, resetting [IOBluetooth] Failed to add service record [CoreBluetooth] XPC connection interrupted, resetting [CoreBluetooth] XPC connection interrupted, resetting [CoreBluetooth] XPC connection interrupted, resetting [CoreBluetooth] XPC connection interrupted, resetting
Replies
8
Boosts
1
Views
3.4k
Activity
Nov ’23
Calling IOBluetoothSDPServiceRecord.publishedServiceRecord crashes bluetoothd
Hi, I have an App KeyPad that lets you use your mac keyboard as a bluetooth keyboard for your iPhone, TV, iPad, another Mac, Windows PC. https://apps.apple.com/us/app/keypad-bluetooth-keyboard/id1491684442?mt=12 Ever since the release of MacOS Ventura this app is no longer working. I have raised feedback report in december, and there is no activity on it. FB11869248 Essentially if I call publishedServiceRecord with a 16bit UUID in "0001 - ServiceClassIDList" the bluetoothd crashes and kills all bluetooth connections (Mouse, keyboard, headset...everything) and then reconnects. This is 100% reproducible. What is interesting is that if a user installs my App on MacOS Monterey, it works, and if they upgrade to MacOS Ventura, it will continue to work. But if they install it new in Ventura it will not work. Even more interesting, because my app was installed in Monterey, all OTHER similar apps will work on Ventura. I suspect that this is some sort of permission issue but I am not getting any support. Anybody see something similar. Sam
Replies
1
Boosts
0
Views
1.2k
Activity
Nov ’23
CUPS Bluetooth Printer issue with Mac OS Sonoma 14 & 14.1
I am trying to print using CUPS and my own backend, Bluetooth, but it is failing on macOS Sonoma. The backend I built don’t have permission to perform Bluetooth communication or get a list of Paired devices. I granted permissions to /usr/libexec/cups/backend/ from System Settings -> Privacy and Security -> Bluetooth, but that did not solve the problem. When I run only the backend I created, the permission dialog appears and I can print, but when I try to print from CUPS, it does not appear and fails to print. The print queue still shows "Ready to print" and the job remains. Printing succeeds with USB and LAN, but only with Bluetooth. Printing succeeds on 13.6 and earlier, problem occurs on 14 and 14.1. Please let me know how to give permission to my backend.
Replies
0
Boosts
0
Views
926
Activity
Oct ’23
iOS 17.1 Not Supporting Bluetooth Devices
Does the new iOS 17.1 not support bluetooth devices anymore? I have a set of Bose head phones that I use all day when I work. I used to be able to listen to podcasts, audiobooks and pdf's using VoiceDream. Now, the apps don't work w/ the headphones. They work when not using the headphones, but only the phone works with the headphones. is there a work around?
Replies
2
Boosts
0
Views
944
Activity
Oct ’23
Streaming from an BT SPP device
I am trying to read/write from/to a Bluetooth device that has SPP(Serial port profile) from Python in Mac OSX. Could you recommend any good library to do so? I have been trying for long but the solutions I have tried does not work. Any help would be greatly appreciated!
Replies
2
Boosts
0
Views
793
Activity
Oct ’23