IOBluetooth

RSS for tag

Gain user-space access to Bluetooth devices using IOBluetooth.

Posts under IOBluetooth tag

190 Posts

Post

Replies

Boosts

Views

Activity

Background ble
I want to send encrypted data from ble (as central) to another device (as peripheral). Now when app is open everything is all good, but what to do if app is in background? Do I have to buy smaller version of advertising id from BLE SIG? OR Is there any way I can send data in background? Or Is there any unique characteristics or services other than BLE ADDRESS that iPhone always advertises when iOS Bluetooth is turned on, so that I can check on that condition and allow entry to user (as application is for smart door lock.)
0
0
1k
Jan ’22
Can Customize Bluetooth HID usage page/usage be accessed by application on macOS?
We developed a bluetooth keyboard with classical bluetooth, and used usage page 0x01 and usage 0x03 for OTA firmware update, and I wrote an appliction on Windows 10 and everything works as expect. I am trying to wrote same application on macOS Big Sur 11.6.1 with XCode 13.2.1, but I found that DeviceMatchingCallback was triggered only once with usage page 0x01 and usage 0x06, which is keyboard usage page/usage pairs, any other usage page/usage pairs such as 0x01/0x03, 0x0C/0x01 didn't trigger DeviceMatchingCallback. So my question is: can customize usage page/usage of bluetooth hid be accessed by application?
0
0
709
Jan ’22
CoreBluetooth stopped working in my app
Hello, I am the developer of an app that is published on the App Store. This app connects to Bluetooth devices to read their battery levels. However, it seems that CoreBluetooth, which is used to discover and connect to devices, has completely stopped working on macOS Monterey. The delegate methods are no longer triggered. When I start my app I see the following messages in the output area: [CoreBluetooth] No name or address The Console app shows a lot of this messages: error 14:56:23.730415+0200 bluetoothd Server.Core sdp attributes is empty I don't know if this is related in any case. Are there any new entitlements or something like that? I did not change any single line and on Big Sur, everything works fine. A customer of mine, which also uses the beta version, already contacted me, so this seems to be a general issue - at least with my app? The app also works fine on Big Sur for the customer.
4
0
5.2k
Jan ’22
Bluetooth Headphones Crackling and Popping
My Bluetooth headphones are cracking and popping. This topic is on a lot of forums but I haven't found any fixes. Some of them are quite old. There is a really long run on this forum in fact years however there's not a fix for me. I did have success with reset the Bluetooth module this morning and it cleared up the distracting noises. I/m back on my computer this ever working in Logic Pro X and it's back. ANY HELP would be greatly appreciated. Thank You in advance. I have a late 2105 iMac Big Sur 11.4 Graphics: ADM Radeon R9 M390 2 GB 32 GB RAM
1
0
1.1k
Dec ’21
Background scanning not working without having last peripheral in iOS?
I trying to connect peripheral using UUID in the background, It's working only when i interact with advertising beacon first time at foreground then my app went background its working background and lock mode also if First time my app is away from advertising beacon i put my app at background then will come near to advertising beacon it's not working. in console, they came last peripheral not found as that error will come, my question is: is this possible to scan or connect Bluetooth using UUID for the first time without the app opening? i already tried that solutions also : https://stackoverflow.com/questions/53299770/ios-ble-device-paired-while-app-is-in-background-or-killed-or-suspend https://stackoverflow.com/questions/32140863/ios-diddiscoverperipheral-not-called-in-background-mode https://stackoverflow.com/questions/58235920/diddiscoverperipheral-not-working-sometimes-on-background https://stackoverflow.com/questions/42090795/not-able-to-search-my-ble-device-which-is-providing-service-id-in-scan-response Thanks
0
0
978
Nov ’21
How to capture Bluetooth notifications on Mac and iOS?
I want to capture Bluetooth "Classic" device notifications on both Mac and iOS platforms primarily when: Bluetooth is turned on/off When a device gets connected/disconnected to Bluetooth On Mac: I used the IOBluetooth framework in Mac for this by registering for two notifications: registerForConnectNotifications registerForDisconnectNotifications However, the issue with this is that notifications get triggered even when a connect request happens with the device. (For ex: I pressed connect for connecting with headphones and a notification is received even though it failed to connect to the device for whatever reason). I need the notification to be received only when the device is successfully connected with the system. On iOS: I am not sure which framework to go with - whether CoreBluetooth or External Accessory. I did read that CoreBluetooth supports classic devices but not every device. I would appreciate any insight or help on this topic.
1
0
1.3k
Nov ’21
Is absolute bluetooth mouse movements supported in iOS 13 ?
Is absolute mouse positioning supported over bluetooth in IOS ? I've successfully created a bluetooth mouse emulator (using a Bluefruit NRF52832) which is working with the Assistive Touch bluetooth device feature added in iOS 13. Currently I can only emulate relative mouse positions. Eg. I can only signal the mouse to (pseudo code here) 'movemouse up 10 units' 'movemouse right 10 units', etc.. What I'm hoping to do is'move the mouse in absolute coordinates. eg 'movemouse to X,Y' (where X.Y are absolute screen coordinates' Is it possible to use Absolute Mouse coordinates via bluetooth with IoS ? .. Any references, code fragments appreciatedjc Additional details.. What I tried was changing the HID report frame in the Bluefruit Arduino package from Adafruit (line 138 in BleHIDAdafruit.cpp ). from  SELECT ALL | TOGGLE FULL SIZE HIDINPUT    ( HIDDATA | HIDVARIABLE | HIDRELATIVE ), to SELECT ALL | TOGGLE FULL SIZE HIDINPUT    ( HIDDATA | HIDVARIABLE | HID_ABSOLUTE ), which I believe is the right thing to do.. the mouse no longer moves on my IPAD. Any thoughts ? Note I've tried asking this in the Adafruit forums with no response.
2
0
1.9k
Sep ’21
CoreBluetooth cannot discover Windows computers
I am working on a project that involves Bluetooth. I tried to use CoreBluetooth for that but it couldn't discover both of my Windows devices. Interestingly, using IOBluetooth to scan for devices, can discover the Windows computer. However, I want to use one consistent code base for my project and sending data over to another device using bluetooth without pairing(RFCOMM and L2CAP both require pairing).
1
0
720
Sep ’21
Need to communicate with classic Bluetooth device(Bluetooth v2.0 + EDR).
Need to communicate with classic Bluetooth device(Bluetooth v2.0 + EDR). We have a medical device which has classic Bluetooth. We need to communicate with that medical device using iPad using Classic Bluetooth communication. We are not able to scan and connect to the nearby classic Bluetooth devices from our application. So can you please let us know whether classic Bluetooth communication can be done in iOS or not.
0
0
538
Sep ’21
AVAudiosession with allowbluetooth option prevents to listen bluetooth button events
I have a VoIP call application. I m trying to add functionality that when the user connected bluetooth to device and hit the bluetooth button call might be answered. I added options that when incoming call received incoming ring should play in bluetooth also. let audioSession = AVAudioSession.sharedInstance() try audioSession.setCategory(AVAudioSession.Category.playAndRecord, mode: .spokenAudio, options:[.defaultToSpeaker,.allowBluetooth,.allowBluetoothA2DP]) try audioSession.setActive(true, options: .notifyOthersOnDeactivation) and I added MPCommandCenter to listen bluetooth events ; let rcCenter = MPRemoteCommandCenter.shared() rcCenter.nextTrackCommand.isEnabled = false rcCenter.nextTrackCommand.addTarget { _ in return .success } rcCenter.previousTrackCommand.isEnabled = false rcCenter.previousTrackCommand.addTarget { _ in return .success } rcCenter.togglePlayPauseCommand.isEnabled = true rcCenter.playCommand.isEnabled = true rcCenter.pauseCommand.isEnabled = true rcCenter.stopCommand.isEnabled = true rcCenter.togglePlayPauseCommand.addTarget{ [unowned self] event in print("togglePlayPauseCommand") return.commandFailed } rcCenter.playCommand.addTarget{ [unowned self] event in print("playCommand") return.commandFailed } rcCenter.pauseCommand.addTarget{ [unowned self] event in print("pause") return.commandFailed } rcCenter.stopCommand.addTarget{ [unowned self] event in print("stop") return.commandFailed } When I remove bluetooth related options from audioSession.setCategory I can listen to events. But when I put them again, events don't work. I also tried UIResponder but had no success; UIApplication.shared.becomeFirstResponder() UIApplication.shared.beginReceivingRemoteControlEvents() and override func remoteControlReceived(with event: UIEvent?) { if let rc = event?.subtype{ print("OVER HERE") } } any idea will be appreciated.
0
1
955
Aug ’21
iOS 14.7.1, 15.0 Beta, Bluetooth issues
Bluetooth Connection Issue: Sudden drop connection between the App and the external BLE device PLATFORM AND VERSION iOS 14.7.1 and above (15.0 beta) The iOS App will connect to an external BLE device with the help of the CoreBluetooth framework. DESCRIPTION OF PROBLEM In iOS 14.7.1 and above (iOS 15.0 beta), observe a sudden drop in the connection between the App and the external BLE device during the firmware upgrade process via Over the Air (file size 500 KB, file type ".bin"). The same App is working fine with iOS 14.6 and earlier versions of iOS. It observes that MTU size is also different in iOS 14.4 and iOS 14.7. When disconnection happened CoreBluetooth -> centralManager: didDisconnectPeripheral delegate method called. The total time required to update BLE firmware is 2 minutes, but approx after a 1-minute or 30 seconds connection is dropping between the App and the BLE device. Do I miss anything that causing a sudden drop of BLE connection, specifically in iOS version 14.7 and above? STEPS TO REPRODUCE Connect the iOS App with an external Bluetooth device and start writing/sending the data from the phone to the BLE device continuously in BLE specified UUID. After some time approx 30 seconds or 1-minute observe a sudden drop in the connection between the App and the BLE device.
0
0
1.2k
Aug ’21
Bluetooth Connection Issue:
Bluetooth Connection Issue: In iOS 14.7.1 and above (iOS 15.0 beta), observe a sudden drop in the connection between the App and the external BLE device during the firmware upgrade process via Over the Air (file size 500 KB, file type ".bin"). The same App is working fine with iOS 14.6 and earlier versions of iOS. It observes that MTU size is also different in iOS 14.4 and iOS 14.7. When disconnection happened CoreBluetooth -> centralManager: didDisconnectPeripheral delegate method called. The total time required to update BLE firmware is 2 minutes, but approx after a 1-minute or 30 seconds connection is dropping between the App and the BLE device. Do I miss anything that causing a sudden drop of BLE connection, specifically in iOS version 14.7 and above?
0
0
505
Aug ’21
In iOS 14.7.1 and above app disconnecting from BLE device when writing data in a particular characteristic
While writing data in BLE device connection loss happened in between BLE device and application (file size is 459 KB, the file type is .bin). It's happened particularly in iOS 14.7.1 and above. iOS 14.6 and before iOS, it will work fine. It observes that MTU size is also different in iOS 14.4 and iOS 14.7. When disconnection happened CoreBluetooth -> centralManager: didDisconnectPeripheral delegate method call. Divide bin file data into 1024 chunk sizes and write data into BLE device as per receive MTU size (MTU - 3) Is any string that needs to add for iOS 14.7 and above or what should I needs to check.
0
0
742
Aug ’21
Background ble
I want to send encrypted data from ble (as central) to another device (as peripheral). Now when app is open everything is all good, but what to do if app is in background? Do I have to buy smaller version of advertising id from BLE SIG? OR Is there any way I can send data in background? Or Is there any unique characteristics or services other than BLE ADDRESS that iPhone always advertises when iOS Bluetooth is turned on, so that I can check on that condition and allow entry to user (as application is for smart door lock.)
Replies
0
Boosts
0
Views
1k
Activity
Jan ’22
Can Customize Bluetooth HID usage page/usage be accessed by application on macOS?
We developed a bluetooth keyboard with classical bluetooth, and used usage page 0x01 and usage 0x03 for OTA firmware update, and I wrote an appliction on Windows 10 and everything works as expect. I am trying to wrote same application on macOS Big Sur 11.6.1 with XCode 13.2.1, but I found that DeviceMatchingCallback was triggered only once with usage page 0x01 and usage 0x06, which is keyboard usage page/usage pairs, any other usage page/usage pairs such as 0x01/0x03, 0x0C/0x01 didn't trigger DeviceMatchingCallback. So my question is: can customize usage page/usage of bluetooth hid be accessed by application?
Replies
0
Boosts
0
Views
709
Activity
Jan ’22
CoreBluetooth stopped working in my app
Hello, I am the developer of an app that is published on the App Store. This app connects to Bluetooth devices to read their battery levels. However, it seems that CoreBluetooth, which is used to discover and connect to devices, has completely stopped working on macOS Monterey. The delegate methods are no longer triggered. When I start my app I see the following messages in the output area: [CoreBluetooth] No name or address The Console app shows a lot of this messages: error 14:56:23.730415+0200 bluetoothd Server.Core sdp attributes is empty I don't know if this is related in any case. Are there any new entitlements or something like that? I did not change any single line and on Big Sur, everything works fine. A customer of mine, which also uses the beta version, already contacted me, so this seems to be a general issue - at least with my app? The app also works fine on Big Sur for the customer.
Replies
4
Boosts
0
Views
5.2k
Activity
Jan ’22
How to set the 2M PHY Mode while searching for a Bluetooth device?
How to set the 2M PHY Mode while searching for a Bluetooth device? https://punchthrough.com/crash-course-in-2m-bluetooth-low-energy-phy/ is there any interface method in CBCentralManager to set these flags?
Replies
2
Boosts
0
Views
2.4k
Activity
Jan ’22
Bluetooth Headphones Crackling and Popping
My Bluetooth headphones are cracking and popping. This topic is on a lot of forums but I haven't found any fixes. Some of them are quite old. There is a really long run on this forum in fact years however there's not a fix for me. I did have success with reset the Bluetooth module this morning and it cleared up the distracting noises. I/m back on my computer this ever working in Logic Pro X and it's back. ANY HELP would be greatly appreciated. Thank You in advance. I have a late 2105 iMac Big Sur 11.4 Graphics: ADM Radeon R9 M390 2 GB 32 GB RAM
Replies
1
Boosts
0
Views
1.1k
Activity
Dec ’21
Background scanning not working without having last peripheral in iOS?
I trying to connect peripheral using UUID in the background, It's working only when i interact with advertising beacon first time at foreground then my app went background its working background and lock mode also if First time my app is away from advertising beacon i put my app at background then will come near to advertising beacon it's not working. in console, they came last peripheral not found as that error will come, my question is: is this possible to scan or connect Bluetooth using UUID for the first time without the app opening? i already tried that solutions also : https://stackoverflow.com/questions/53299770/ios-ble-device-paired-while-app-is-in-background-or-killed-or-suspend https://stackoverflow.com/questions/32140863/ios-diddiscoverperipheral-not-called-in-background-mode https://stackoverflow.com/questions/58235920/diddiscoverperipheral-not-working-sometimes-on-background https://stackoverflow.com/questions/42090795/not-able-to-search-my-ble-device-which-is-providing-service-id-in-scan-response Thanks
Replies
0
Boosts
0
Views
978
Activity
Nov ’21
Random Spaces Inserted into Barcode Scan
Multiple barcode scanners will work properly when hard-plugged into Windows device but will insert random spaces into Notes when bluetooth-connected to iPad mini 4 (running 15.1), even if the settings are for a mac OS device. Thoughts?
Replies
0
Boosts
0
Views
422
Activity
Nov ’21
How to capture Bluetooth notifications on Mac and iOS?
I want to capture Bluetooth "Classic" device notifications on both Mac and iOS platforms primarily when: Bluetooth is turned on/off When a device gets connected/disconnected to Bluetooth On Mac: I used the IOBluetooth framework in Mac for this by registering for two notifications: registerForConnectNotifications registerForDisconnectNotifications However, the issue with this is that notifications get triggered even when a connect request happens with the device. (For ex: I pressed connect for connecting with headphones and a notification is received even though it failed to connect to the device for whatever reason). I need the notification to be received only when the device is successfully connected with the system. On iOS: I am not sure which framework to go with - whether CoreBluetooth or External Accessory. I did read that CoreBluetooth supports classic devices but not every device. I would appreciate any insight or help on this topic.
Replies
1
Boosts
0
Views
1.3k
Activity
Nov ’21
connecting issue with BLE
I am building a flutter project that using a Bluetooth Reactive BLE dependency but I am facing a error while connecting with BLE device. Errors are like: Command PhaseScriptExecution failed with a nonzero exit code Flutter/Flutter.h file not found
Replies
0
Boosts
0
Views
784
Activity
Oct ’21
Connect to Rasberry Pi
I can see my pi listed in iOS settings, and I can connect to it that way. I'm also trying to connect using CoreBluetooth but the pi never appears as a Peripheral I can connect to. Should I be taking another approach? Would it appear as an ExternalAccessory instead? I have a Python server on the device that I'd like to connect to. Thanks!
Replies
0
Boosts
0
Views
982
Activity
Oct ’21
Is absolute bluetooth mouse movements supported in iOS 13 ?
Is absolute mouse positioning supported over bluetooth in IOS ? I've successfully created a bluetooth mouse emulator (using a Bluefruit NRF52832) which is working with the Assistive Touch bluetooth device feature added in iOS 13. Currently I can only emulate relative mouse positions. Eg. I can only signal the mouse to (pseudo code here) 'movemouse up 10 units' 'movemouse right 10 units', etc.. What I'm hoping to do is'move the mouse in absolute coordinates. eg 'movemouse to X,Y' (where X.Y are absolute screen coordinates' Is it possible to use Absolute Mouse coordinates via bluetooth with IoS ? .. Any references, code fragments appreciatedjc Additional details.. What I tried was changing the HID report frame in the Bluefruit Arduino package from Adafruit (line 138 in BleHIDAdafruit.cpp ). from  SELECT ALL | TOGGLE FULL SIZE HIDINPUT    ( HIDDATA | HIDVARIABLE | HIDRELATIVE ), to SELECT ALL | TOGGLE FULL SIZE HIDINPUT    ( HIDDATA | HIDVARIABLE | HID_ABSOLUTE ), which I believe is the right thing to do.. the mouse no longer moves on my IPAD. Any thoughts ? Note I've tried asking this in the Adafruit forums with no response.
Replies
2
Boosts
0
Views
1.9k
Activity
Sep ’21
CoreBluetooth cannot discover Windows computers
I am working on a project that involves Bluetooth. I tried to use CoreBluetooth for that but it couldn't discover both of my Windows devices. Interestingly, using IOBluetooth to scan for devices, can discover the Windows computer. However, I want to use one consistent code base for my project and sending data over to another device using bluetooth without pairing(RFCOMM and L2CAP both require pairing).
Replies
1
Boosts
0
Views
720
Activity
Sep ’21
Need to communicate with classic Bluetooth device(Bluetooth v2.0 + EDR).
Need to communicate with classic Bluetooth device(Bluetooth v2.0 + EDR). We have a medical device which has classic Bluetooth. We need to communicate with that medical device using iPad using Classic Bluetooth communication. We are not able to scan and connect to the nearby classic Bluetooth devices from our application. So can you please let us know whether classic Bluetooth communication can be done in iOS or not.
Replies
0
Boosts
0
Views
538
Activity
Sep ’21
Bluetooth Device Name Listing
Assalam Alikum / Hi , Hope so everyone is fine and doing good. Am facing an issue retrieving the Bluetooth devices list surrounding me. I have Bluetooth Door which will be open through my iOS application. But I can't find that name in my list. Even I found some Bluetooth devices without names. Thanks in advance.
Replies
1
Boosts
0
Views
961
Activity
Aug ’21
AVAudiosession with allowbluetooth option prevents to listen bluetooth button events
I have a VoIP call application. I m trying to add functionality that when the user connected bluetooth to device and hit the bluetooth button call might be answered. I added options that when incoming call received incoming ring should play in bluetooth also. let audioSession = AVAudioSession.sharedInstance() try audioSession.setCategory(AVAudioSession.Category.playAndRecord, mode: .spokenAudio, options:[.defaultToSpeaker,.allowBluetooth,.allowBluetoothA2DP]) try audioSession.setActive(true, options: .notifyOthersOnDeactivation) and I added MPCommandCenter to listen bluetooth events ; let rcCenter = MPRemoteCommandCenter.shared() rcCenter.nextTrackCommand.isEnabled = false rcCenter.nextTrackCommand.addTarget { _ in return .success } rcCenter.previousTrackCommand.isEnabled = false rcCenter.previousTrackCommand.addTarget { _ in return .success } rcCenter.togglePlayPauseCommand.isEnabled = true rcCenter.playCommand.isEnabled = true rcCenter.pauseCommand.isEnabled = true rcCenter.stopCommand.isEnabled = true rcCenter.togglePlayPauseCommand.addTarget{ [unowned self] event in print("togglePlayPauseCommand") return.commandFailed } rcCenter.playCommand.addTarget{ [unowned self] event in print("playCommand") return.commandFailed } rcCenter.pauseCommand.addTarget{ [unowned self] event in print("pause") return.commandFailed } rcCenter.stopCommand.addTarget{ [unowned self] event in print("stop") return.commandFailed } When I remove bluetooth related options from audioSession.setCategory I can listen to events. But when I put them again, events don't work. I also tried UIResponder but had no success; UIApplication.shared.becomeFirstResponder() UIApplication.shared.beginReceivingRemoteControlEvents() and override func remoteControlReceived(with event: UIEvent?) { if let rc = event?.subtype{ print("OVER HERE") } } any idea will be appreciated.
Replies
0
Boosts
1
Views
955
Activity
Aug ’21
I’m new
how can I view my main Device on another device transfer data
Replies
1
Boosts
0
Views
660
Activity
Aug ’21
IOS 14 BLUETOOTH ISSUE WITH CAR.
Phone gets connected but the sound is not coming out of car speakers but phone speakers.
Replies
3
Boosts
0
Views
1.4k
Activity
Aug ’21
iOS 14.7.1, 15.0 Beta, Bluetooth issues
Bluetooth Connection Issue: Sudden drop connection between the App and the external BLE device PLATFORM AND VERSION iOS 14.7.1 and above (15.0 beta) The iOS App will connect to an external BLE device with the help of the CoreBluetooth framework. DESCRIPTION OF PROBLEM In iOS 14.7.1 and above (iOS 15.0 beta), observe a sudden drop in the connection between the App and the external BLE device during the firmware upgrade process via Over the Air (file size 500 KB, file type ".bin"). The same App is working fine with iOS 14.6 and earlier versions of iOS. It observes that MTU size is also different in iOS 14.4 and iOS 14.7. When disconnection happened CoreBluetooth -> centralManager: didDisconnectPeripheral delegate method called. The total time required to update BLE firmware is 2 minutes, but approx after a 1-minute or 30 seconds connection is dropping between the App and the BLE device. Do I miss anything that causing a sudden drop of BLE connection, specifically in iOS version 14.7 and above? STEPS TO REPRODUCE Connect the iOS App with an external Bluetooth device and start writing/sending the data from the phone to the BLE device continuously in BLE specified UUID. After some time approx 30 seconds or 1-minute observe a sudden drop in the connection between the App and the BLE device.
Replies
0
Boosts
0
Views
1.2k
Activity
Aug ’21
Bluetooth Connection Issue:
Bluetooth Connection Issue: In iOS 14.7.1 and above (iOS 15.0 beta), observe a sudden drop in the connection between the App and the external BLE device during the firmware upgrade process via Over the Air (file size 500 KB, file type ".bin"). The same App is working fine with iOS 14.6 and earlier versions of iOS. It observes that MTU size is also different in iOS 14.4 and iOS 14.7. When disconnection happened CoreBluetooth -> centralManager: didDisconnectPeripheral delegate method called. The total time required to update BLE firmware is 2 minutes, but approx after a 1-minute or 30 seconds connection is dropping between the App and the BLE device. Do I miss anything that causing a sudden drop of BLE connection, specifically in iOS version 14.7 and above?
Replies
0
Boosts
0
Views
505
Activity
Aug ’21
In iOS 14.7.1 and above app disconnecting from BLE device when writing data in a particular characteristic
While writing data in BLE device connection loss happened in between BLE device and application (file size is 459 KB, the file type is .bin). It's happened particularly in iOS 14.7.1 and above. iOS 14.6 and before iOS, it will work fine. It observes that MTU size is also different in iOS 14.4 and iOS 14.7. When disconnection happened CoreBluetooth -> centralManager: didDisconnectPeripheral delegate method call. Divide bin file data into 1024 chunk sizes and write data into BLE device as per receive MTU size (MTU - 3) Is any string that needs to add for iOS 14.7 and above or what should I needs to check.
Replies
0
Boosts
0
Views
742
Activity
Aug ’21