IOBluetooth

RSS for tag

Gain user-space access to Bluetooth devices using IOBluetooth.

Posts under IOBluetooth tag

190 Posts

Post

Replies

Boosts

Views

Activity

Is there any way to set the Bluetooth scan frequency dynamically so that I can get the device updates frequently through didDiscoverPeripheral callback.
I have a requirement to get the RSSI values of my BLE device for approximately 30 times in a minute. I didn't find a way to pass the scan frequency to Bluetooth API. Could any one check and let me know if there is any possibility to set this dynamically?
0
0
713
Oct ’22
CoreBluetooth: Reduced MTU when updating from iOS15 to iOS16
We are seeing a strange behaviour where the maximum MTU size sent from the phone to our peripheral has decreased from 185 (iOS 15) to 77 (iOS 16 and 16.0.2). We are seeing the exact same behaviour on iPhone 11, iPhone 13 Pro Max and iPhone 14. The source code for the iOS app has not changed at all, yet for some reason the MTU seems to significantally decrease after upgrading to iOS 16. Below is a sniffer log showing how on iOS 15.7 (19H12) running on an iPhone 7, the iPhone's requested MTU is 185 bytes:- And the sniffer log below shows how on iOS 16.0.2 running on iPhone 13 Pro Max, the iPhone's requested MTU is only 77 bytes:- The sudden decrease in the iOS's MTU size is forcing the app to resort to long writes instead of normal writes (when attempting to write to a characteristic larger than 77 bytes), which is causing the interaction to break. Any idea if this is a known bug on iOS 16? And is there a fix/workaround on the app side that can revert the behaviour so that the phone requests 185 bytes? Thanks
2
1
3.3k
Oct ’22
MacOS 12.6 Monterey - Bluetooth still broken
2015 Macbook pro intel Bluetooth - Connect then drop with iPhone 12 mini SV 14.3 Some non apple devices dont appear in connection list Create alternate admin user, same problem no luck with; Reset SMC Remove .plist So far apple advisors recommend reload OS12.6 ...but I dont have confidence this will work unless other users have found success.
2
1
1.2k
Sep ’22
Bluetooth from async thread
Hello, I am writing an app that communicates with a classic bluetooth device. I am attempting to integrate it into a swift ui front end.  I have created an async method that looks like : func doIndex() async -> String { obd.openConnection() } It this method is called from a task  .task{ indexOut = await appState.doIndex() } When I call this method, the bluetooth connection times out connecting every time.  ** Obd> Status changed - Connecting to OBD Device AddressString: 00-04-3e-5b-54-6f Paired?: true Connected?: false channel 1 identified 2022-09-02 17:14:42.751753-0400 odbpoc[12934:355248] [IOBluetooth] -[IOBluetoothRFCOMMChannel waitforChanneOpen] CID:1 - timed out waiting to open 2022-09-02 17:14:42.752114-0400 odbpoc[12934:355248] [IOBluetooth] -[IOBluetoothDevice openRFCOMMChannelSync:withChannelID:delegate:] CID:1 error -536870212 If I run this code in the main loop, the open happens fine.  ** Obd> Status changed - Connecting to OBD Device AddressString: 00-04-3e-5b-54-6f Paired?: true Connected?: false channel 1 identified channel open ! ** Obd> Status changed - Connected I did some digging and see recommendations to add a runloop to the async method. When I do that, Xcode tells me Runloop.current shouldn't be used in async code. Is there a recommended method for doing background IOBluetooth work ?  Thank You, David
0
0
862
Sep ’22
Bluetooth Permissions denied when trying to access while not logged in
As of Monterrey 12.3, I am getting this error from my authorization plugin. Any ideas for how to get the authorization plugin to get permissions? (I tried having it connection a daemon that has bluetooth permissions via XPC as well as an application, but that didn't work as well). The bluetooth does work when in logged mode on the application. func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) {     switch peripheral.state {     case .unknown:       Log.i("Bluetooth state is unknown")       reset()     case .resetting:       Log.i("Bluetooth is resetting")       reset()     case .unsupported:       Log.w("Bluetooth is not supported on this device")       reset()     case .unauthorized: // I keep getting this response       Log.w("Bluetooth permission was not granted")       reset()     case .poweredOff:       Log.i("Bluetooth is powered off")       reset()     case .poweredOn:       Log.i("Bluetooth is ready")       addServiceIfNeeded()     @unknown default:       Log.w("Unknown peripheral state", peripheral.state)     }   }
0
0
1.2k
Aug ’22
Is absolute bluetooth mouse movements supported in ios?
am trying to send Bluetooth HID Mouse Commands. However the HTML cursor coordinates relative to device screen have no accurate impact on how Screen Cursor (Accessibility Pointer) in IOS Device moves. For example. Mouse Command: M 0 <X-Axis> <Y-Axis> 00 Values we can send (0 - 127 +ve) and (255 = -1, 254 = -2, ... 128 = -127) because bluetooth accepts unsigned integers. If my HTML Cursor is at (X=20,Y=20), How can I determine what exact value should I send to Bluetooth Screen Cursor (Accessibility Pointer) to go to exact accurate position where HTML Cursor is at.
0
0
1.5k
Aug ’22
iOS 15.6 Apps asking to turn bluetooth on when it's already on
I'm not sure if this is the app's issue or iOS, but anytime an app requires bluetooth for setup, it'll say that BT needs to be enabled with a link to the Settings > Bluetooth. Once there, I can't do anything because it's already enabled — which leaves me right back where I started...unable to install the app. And actually, the screen that always opens (#2) doesn't even have BT-related settings on it. Since it's been happening more and more, I figured I'd reach out and ask. Thanks and I just realized I'm posting this in the dev area so I'll move it. 2.
0
0
651
Aug ’22
IPhone 12 Bluetooth Connectivity Issue
Model: iPhone12 Version: iOS 15.5 Bluetooth Device: Boat wireless Head phone, JBL Head Phone, Wagnor Car Music System. My avobe Bluetooth device always connected music is playing but whenever I am getting call that time bluetooth device got disconnect and call get transfer to mobile microphone. I purchased my new iPhone on 27 june 2022 from amazon India. Aneesh Mishra
0
0
588
Jul ’22
What if an Apple Watch could protect us from mosquito bites?
One of our latest innovation and patented technology can be used in mobile devices like the Apple Watch to protect the environment from being attacked and bit by mosquitos. By modelling sensor structures this technology influences behavior patterns of mosquitoes and other insects. This allows mosquitos to be kept away without being affected. Using existing IoT hardware already available on-board, in addition to software-based algorithms, the Apple Watch could be a best fit for this application. I would appreciate if we had the opportunity to set up a personal discussion with the Apple Watch engineers.
0
0
1.4k
Jul ’22
Access other app notifications
I’m planning on making on making a prototype of a phone case that brings back the android LED light that shines a specific color depending on notifications received by the user so you can just glance at phone. I’m wondering if there is a way to see what apps have sent notifications to the user? On a side note, would it be possible to see what apps a user has to allow LED customization? Specific apps = specific lights system.
1
0
1.8k
Jul ’22
[Bluetooth][MAP][BMessage] iOS returning incorrect message folder path
Calling the Bluetooth GetMessage function for a message that was sent via Bluetooth, the returned BMessage contains an incorrect folder path to the message. The Event Report returns the correct folder path when the message is successfully sent. Scenario: Connect to Bluetooth MAP services (MNS and MAS). Call Bluetooth "PushMessage" function. Get 'Name Header' for the Message Handle. MAP-Event-Report received with Type of SendingSuccess and Folder equal to "telecom/msg/sent". Use "SetFolder" to navigate to Sent folder. Call "GetMessage" with the Message Handle (the handle is the same for both the event report and PushMessage function). The BMessage response has a folder of "telecom/msg/inbox" BMessage: BEGIN:BMSG VERSION:1.0 STATUS:UNREAD TYPE:SMS_GSM FOLDER:telecom/msg/inbox NOTIFICATION:1 BEGIN:VCARD VERSION:2.1 FN;CHARSET=UTF-8:[Contact] N;CHARSET=UTF-8:[Contact] TEL:3: END:VCARD BEGIN:BENV BEGIN:VCARD VERSION:2.1 FN;CHARSET=UTF-8:[Contact] N;CHARSET=UTF-8:[Contact] TEL:[Phone Number] END:VCARD BEGIN:BBODY CHARSET:UTF-8 LANGUAGE:UNKNOWN LENGTH:[Some Length] BEGIN:MSG iOS is the worst. END:MSG END:BBODY END:BENV END:BMSG Set Folder to telecom: 85-00-20-02-00-01-00-13-00-74-00-65-00-6C-00-65-00-63-00-6F-00-6D-00-00-4C-00-03-CB-08-60-59-D0 Set Folder to msg: 85-00-18-02-00-01-00-0B-00-6D-00-73-00-67-00-00-4C-00-03-CB-08-60-59-D0 Setting Folder to sent: 85-00-1A-02-00-01-00-0D-00-73-00-65-00-6E-00-74-00-00-4C-00-03-CB-08-60-59-D0 Calling GetMessage function: 83-00-44-01-00-23-00-44-00-33-00-42-00-43-00-34-00-45-00-39-00-31-00-30-00-35-00-41-00-41-00-34-00-43-00-32-00-00-42-00-10-78-2D-62-74-2F-6D-65-73-73-61-67-65-00-4C-00-09-14-01-01-0A-01-00-CB-08-60-59-D0 Section 3.1.4 of the Bluetooth Specification states: "telecom/msg/sent: This folder shall contain messages that were successfully sent to the network by the MSE, at least during the period of the current MAP session. In particular these messages have been queued in the 'Outbox' folder before sending and are shifted by the MSE to this folder after transmission." Apple is also nice enough to not include any additional contacts when the text message is part of a group text. This has been made unnecessarily difficult for developers to use and what's worse, it seems intentional.
0
0
1.5k
Jul ’22
Issues with IOBluetoothDeviceInquiry Delegate
All, I have an issue where my IOBluetoothDeviceInquiry and IOBluetoothDevicePair objects do not seem to be triggering all of their lifecycle states. Here is some sample code below. What am I missing here. In this example, the deviceInquiryStarted trigger never fires, even though it clearly starts and finds devices. Also devices are not added to the @Published object as they are found. Also the sender.stop() does not seem to work when coming from the delegate to stop the search. I feel like I am just missing something here as it relates to delegates. I am just looking to scan for HID devices like mice, keyboards and headsets. Then allow the user to pair the device, and list paired devices. I am pretty new to IOBluetooth so any help is appreciated. import IOBluetooth import IOBluetoothUI import SwiftUI class BluetoothSearchDelegate : NSObject, ObservableObject, IOBluetoothDeviceInquiryDelegate {          @Published var devices: [IOBluetoothDevice] = []          func deviceInquiryDeviceFound(_ sender: IOBluetoothDeviceInquiry, device: IOBluetoothDevice) {         debugPrint("********** DEVICE FOUND ************")         self.devices.append(device)     }          func deviceInquiryStarted(_ sender: IOBluetoothDeviceInquiry) {         debugPrint("inquiryStarted")     }          func deviceInquiryComplete(_ sender: IOBluetoothDeviceInquiry, error: IOReturn, aborted: Bool) {         sender.stop()         print("completed")     } } class BluetoothController: ObservableObject {          //     // DEVICE LISTS     //     @Published var devices: [IOBluetoothDevice] = []          //     // SEARCH TYPE     //     let searchType: IOBluetoothDeviceSearchTypes = kIOBluetoothDeviceSearchClassic.rawValue          //     // BLUETOOTH DEVICE     //     let btDevice: IOBluetoothDevice = IOBluetoothDevice()          //     // DELEGATES     //     let searchDelegate = BluetoothSearchDelegate()          //     // AGENTS     //     let searchAgent: IOBluetoothDeviceInquiry     let pairingAgent = IOBluetoothDevicePair()          init() {         self.searchAgent = IOBluetoothDeviceInquiry(delegate: self.searchDelegate)         self.searchAgent.searchType = self.searchType     }          func scan() {         self.searchAgent.inquiryLength = 1         self.searchAgent.start()         self.devices = self.searchDelegate.devices     }          func getPairedDevices() -> [IOBluetoothDevice] {         let devices = IOBluetoothDevice.pairedDevices() as? [IOBluetoothDevice]         debugPrint(devices ?? [])         return devices ?? []     }          func stop() {         self.searchAgent.stop()         self.devices = self.searchAgent.foundDevices() as? [IOBluetoothDevice] ?? []         self.searchAgent.clearFoundDevices()                  debugPrint("Device Count: \(self.devices.count)")     }          func pair(device: IOBluetoothDevice) -> IOBluetoothDevicePair {         self.pairingAgent.setDevice(device)         pairingAgent.start()         return pairingAgent     }          func stopPairing(pairingAgent: IOBluetoothDevicePair) {         pairingAgent.stop()     }                } struct ContentView: View {     @State var isScanning: Bool = false     @State var isPairing: Bool = false     @ObservedObject var bt = BluetoothController()          var body: some View {         VStack {             Text("Scan for bt devices").padding()             Button(action: {                 if !self.isScanning {                     self.bt.scan()                     self.isScanning.toggle()                     return                 } else {                     self.bt.stop()                     self.isScanning.toggle()                     return                 }                              }, label: {                 Text(self.isScanning ? "Stop" : "Scan")             }).padding()                          List(self.bt.searchDelegate.devices, id: \.self) { device in                 HStack {                     Text("\(device.name)")                     Spacer()                     Button(action: {                         var pairingAgent: IOBluetoothDevicePair = IOBluetoothDevicePair()                         if !self.isPairing {                             pairingAgent = bt.pair(device: device)                         } else {                             bt.stopPairing(pairingAgent: pairingAgent)                         }                     }, label: {                                                  if !self.isPairing {                             Text("Pair")                         } else {                             Text("Stop")                         }                     })                 }             }         }     } }
0
0
1.2k
Jun ’22
Have an iOS/iPadOS app be a bluetooth audio receiver
I was wondering if it is possible to use the bluetooth API on iPadOS to let an app become an emulated "bluetooth speaker/car". I want to make an app where an iPhone or Android phone can connect to it via bluetooth so the app can play the audio from the phone, and receive and handle calls just like a car can play audio and handle calls and display call information via bluetooth. I would also like to know if the app could also get contact information from the phone over bluetooth. If it is possible to do so, how? I would love a friendly nudge in the right direction :)
0
0
1.1k
Jun ’22
Cross Transport Key Derivation
Any developer has experience in CTKD? I saw it was mentioned in WWDC 2019 (https://developer.apple.com/videos/play/wwdc2019/901), and it stated that there would be a sample project from documentation (https://developer.apple.com/documentation/corebluetooth/using_core_bluetooth_classic). But I could not find further information on it.
1
0
1.3k
Jun ’22
Repeating BLE pairing requests
I am currently working on an IOS application that pairs with a raspberry pi advertising a UART BLE service. The application successfully discovers the peripheral and attempts to connect to it. However, I keep getting a pop up window from IOS with a request to pair with the device. If I press "cancel", the app disconnects from the peripheral. If I press "pair", the peripheral connects. However, the app continues sending me pairing requests. Is this a known bug with IOS? Is there any way to get around this issue?
3
0
3.7k
Jun ’22
Is there any way to set the Bluetooth scan frequency dynamically so that I can get the device updates frequently through didDiscoverPeripheral callback.
I have a requirement to get the RSSI values of my BLE device for approximately 30 times in a minute. I didn't find a way to pass the scan frequency to Bluetooth API. Could any one check and let me know if there is any possibility to set this dynamically?
Replies
0
Boosts
0
Views
713
Activity
Oct ’22
CoreBluetooth: Reduced MTU when updating from iOS15 to iOS16
We are seeing a strange behaviour where the maximum MTU size sent from the phone to our peripheral has decreased from 185 (iOS 15) to 77 (iOS 16 and 16.0.2). We are seeing the exact same behaviour on iPhone 11, iPhone 13 Pro Max and iPhone 14. The source code for the iOS app has not changed at all, yet for some reason the MTU seems to significantally decrease after upgrading to iOS 16. Below is a sniffer log showing how on iOS 15.7 (19H12) running on an iPhone 7, the iPhone's requested MTU is 185 bytes:- And the sniffer log below shows how on iOS 16.0.2 running on iPhone 13 Pro Max, the iPhone's requested MTU is only 77 bytes:- The sudden decrease in the iOS's MTU size is forcing the app to resort to long writes instead of normal writes (when attempting to write to a characteristic larger than 77 bytes), which is causing the interaction to break. Any idea if this is a known bug on iOS 16? And is there a fix/workaround on the app side that can revert the behaviour so that the phone requests 185 bytes? Thanks
Replies
2
Boosts
1
Views
3.3k
Activity
Oct ’22
MacOS 12.6 Monterey - Bluetooth still broken
2015 Macbook pro intel Bluetooth - Connect then drop with iPhone 12 mini SV 14.3 Some non apple devices dont appear in connection list Create alternate admin user, same problem no luck with; Reset SMC Remove .plist So far apple advisors recommend reload OS12.6 ...but I dont have confidence this will work unless other users have found success.
Replies
2
Boosts
1
Views
1.2k
Activity
Sep ’22
iOS 16 ble send message error
When my device upgraded to iOS16, the Bluetooth sent data incorrectly which "Error Domain=CBATTErrorDomain Code=13 "The value's length is invalid.""
Replies
0
Boosts
2
Views
988
Activity
Sep ’22
CoreLocation position on MacBook Air from iPhone
Does anyone know if it is possible to get Core Location data on a MacBook from an iPhone ? So either by using a Bluetooth connection between the MacBook and iPhone or using a USB/Lightning cable or a Wifi hotspot. Note that the phone will only have a GPS signal - no wifi or mobile network.
Replies
1
Boosts
0
Views
1.2k
Activity
Sep ’22
Bluetooth from async thread
Hello, I am writing an app that communicates with a classic bluetooth device. I am attempting to integrate it into a swift ui front end.  I have created an async method that looks like : func doIndex() async -> String { obd.openConnection() } It this method is called from a task  .task{ indexOut = await appState.doIndex() } When I call this method, the bluetooth connection times out connecting every time.  ** Obd> Status changed - Connecting to OBD Device AddressString: 00-04-3e-5b-54-6f Paired?: true Connected?: false channel 1 identified 2022-09-02 17:14:42.751753-0400 odbpoc[12934:355248] [IOBluetooth] -[IOBluetoothRFCOMMChannel waitforChanneOpen] CID:1 - timed out waiting to open 2022-09-02 17:14:42.752114-0400 odbpoc[12934:355248] [IOBluetooth] -[IOBluetoothDevice openRFCOMMChannelSync:withChannelID:delegate:] CID:1 error -536870212 If I run this code in the main loop, the open happens fine.  ** Obd> Status changed - Connecting to OBD Device AddressString: 00-04-3e-5b-54-6f Paired?: true Connected?: false channel 1 identified channel open ! ** Obd> Status changed - Connected I did some digging and see recommendations to add a runloop to the async method. When I do that, Xcode tells me Runloop.current shouldn't be used in async code. Is there a recommended method for doing background IOBluetooth work ?  Thank You, David
Replies
0
Boosts
0
Views
862
Activity
Sep ’22
Bluetooth Permissions denied when trying to access while not logged in
As of Monterrey 12.3, I am getting this error from my authorization plugin. Any ideas for how to get the authorization plugin to get permissions? (I tried having it connection a daemon that has bluetooth permissions via XPC as well as an application, but that didn't work as well). The bluetooth does work when in logged mode on the application. func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) {     switch peripheral.state {     case .unknown:       Log.i("Bluetooth state is unknown")       reset()     case .resetting:       Log.i("Bluetooth is resetting")       reset()     case .unsupported:       Log.w("Bluetooth is not supported on this device")       reset()     case .unauthorized: // I keep getting this response       Log.w("Bluetooth permission was not granted")       reset()     case .poweredOff:       Log.i("Bluetooth is powered off")       reset()     case .poweredOn:       Log.i("Bluetooth is ready")       addServiceIfNeeded()     @unknown default:       Log.w("Unknown peripheral state", peripheral.state)     }   }
Replies
0
Boosts
0
Views
1.2k
Activity
Aug ’22
How can I find Bluetooth RSSI Sweeper in MacOS Ventura
I have a MX Master 3 and a WH-1000XM4, when I play music, the two of them had a lot of interference. It seems can be solved by RSSI Sweeper, but I can't find it in Ventura.
Replies
0
Boosts
0
Views
1.4k
Activity
Aug ’22
Is absolute bluetooth mouse movements supported in ios?
am trying to send Bluetooth HID Mouse Commands. However the HTML cursor coordinates relative to device screen have no accurate impact on how Screen Cursor (Accessibility Pointer) in IOS Device moves. For example. Mouse Command: M 0 <X-Axis> <Y-Axis> 00 Values we can send (0 - 127 +ve) and (255 = -1, 254 = -2, ... 128 = -127) because bluetooth accepts unsigned integers. If my HTML Cursor is at (X=20,Y=20), How can I determine what exact value should I send to Bluetooth Screen Cursor (Accessibility Pointer) to go to exact accurate position where HTML Cursor is at.
Replies
0
Boosts
0
Views
1.5k
Activity
Aug ’22
How to connect Bluetooth Classic device to iOS with Flutter
I want to connect to the OBDII device (Bluetooth classic) I have. I am writing my application with Flutter, but I cannot connect to this device on the iOS side, I cannot see or scan. Is there any way I can do this?
Replies
0
Boosts
0
Views
1.5k
Activity
Aug ’22
iOS 15.6 Apps asking to turn bluetooth on when it's already on
I'm not sure if this is the app's issue or iOS, but anytime an app requires bluetooth for setup, it'll say that BT needs to be enabled with a link to the Settings > Bluetooth. Once there, I can't do anything because it's already enabled — which leaves me right back where I started...unable to install the app. And actually, the screen that always opens (#2) doesn't even have BT-related settings on it. Since it's been happening more and more, I figured I'd reach out and ask. Thanks and I just realized I'm posting this in the dev area so I'll move it. 2.
Replies
0
Boosts
0
Views
651
Activity
Aug ’22
Grant bluetooth permission for process run from daemon service on Monterey 12.3
How can I get the daemon running in the background to be granted permission to access bluetooth?
Replies
0
Boosts
0
Views
1.7k
Activity
Aug ’22
IPhone 12 Bluetooth Connectivity Issue
Model: iPhone12 Version: iOS 15.5 Bluetooth Device: Boat wireless Head phone, JBL Head Phone, Wagnor Car Music System. My avobe Bluetooth device always connected music is playing but whenever I am getting call that time bluetooth device got disconnect and call get transfer to mobile microphone. I purchased my new iPhone on 27 june 2022 from amazon India. Aneesh Mishra
Replies
0
Boosts
0
Views
588
Activity
Jul ’22
What if an Apple Watch could protect us from mosquito bites?
One of our latest innovation and patented technology can be used in mobile devices like the Apple Watch to protect the environment from being attacked and bit by mosquitos. By modelling sensor structures this technology influences behavior patterns of mosquitoes and other insects. This allows mosquitos to be kept away without being affected. Using existing IoT hardware already available on-board, in addition to software-based algorithms, the Apple Watch could be a best fit for this application. I would appreciate if we had the opportunity to set up a personal discussion with the Apple Watch engineers.
Replies
0
Boosts
0
Views
1.4k
Activity
Jul ’22
Access other app notifications
I’m planning on making on making a prototype of a phone case that brings back the android LED light that shines a specific color depending on notifications received by the user so you can just glance at phone. I’m wondering if there is a way to see what apps have sent notifications to the user? On a side note, would it be possible to see what apps a user has to allow LED customization? Specific apps = specific lights system.
Replies
1
Boosts
0
Views
1.8k
Activity
Jul ’22
[Bluetooth][MAP][BMessage] iOS returning incorrect message folder path
Calling the Bluetooth GetMessage function for a message that was sent via Bluetooth, the returned BMessage contains an incorrect folder path to the message. The Event Report returns the correct folder path when the message is successfully sent. Scenario: Connect to Bluetooth MAP services (MNS and MAS). Call Bluetooth "PushMessage" function. Get 'Name Header' for the Message Handle. MAP-Event-Report received with Type of SendingSuccess and Folder equal to "telecom/msg/sent". Use "SetFolder" to navigate to Sent folder. Call "GetMessage" with the Message Handle (the handle is the same for both the event report and PushMessage function). The BMessage response has a folder of "telecom/msg/inbox" BMessage: BEGIN:BMSG VERSION:1.0 STATUS:UNREAD TYPE:SMS_GSM FOLDER:telecom/msg/inbox NOTIFICATION:1 BEGIN:VCARD VERSION:2.1 FN;CHARSET=UTF-8:[Contact] N;CHARSET=UTF-8:[Contact] TEL:3: END:VCARD BEGIN:BENV BEGIN:VCARD VERSION:2.1 FN;CHARSET=UTF-8:[Contact] N;CHARSET=UTF-8:[Contact] TEL:[Phone Number] END:VCARD BEGIN:BBODY CHARSET:UTF-8 LANGUAGE:UNKNOWN LENGTH:[Some Length] BEGIN:MSG iOS is the worst. END:MSG END:BBODY END:BENV END:BMSG Set Folder to telecom: 85-00-20-02-00-01-00-13-00-74-00-65-00-6C-00-65-00-63-00-6F-00-6D-00-00-4C-00-03-CB-08-60-59-D0 Set Folder to msg: 85-00-18-02-00-01-00-0B-00-6D-00-73-00-67-00-00-4C-00-03-CB-08-60-59-D0 Setting Folder to sent: 85-00-1A-02-00-01-00-0D-00-73-00-65-00-6E-00-74-00-00-4C-00-03-CB-08-60-59-D0 Calling GetMessage function: 83-00-44-01-00-23-00-44-00-33-00-42-00-43-00-34-00-45-00-39-00-31-00-30-00-35-00-41-00-41-00-34-00-43-00-32-00-00-42-00-10-78-2D-62-74-2F-6D-65-73-73-61-67-65-00-4C-00-09-14-01-01-0A-01-00-CB-08-60-59-D0 Section 3.1.4 of the Bluetooth Specification states: "telecom/msg/sent: This folder shall contain messages that were successfully sent to the network by the MSE, at least during the period of the current MAP session. In particular these messages have been queued in the 'Outbox' folder before sending and are shifted by the MSE to this folder after transmission." Apple is also nice enough to not include any additional contacts when the text message is part of a group text. This has been made unnecessarily difficult for developers to use and what's worse, it seems intentional.
Replies
0
Boosts
0
Views
1.5k
Activity
Jul ’22
Issues with IOBluetoothDeviceInquiry Delegate
All, I have an issue where my IOBluetoothDeviceInquiry and IOBluetoothDevicePair objects do not seem to be triggering all of their lifecycle states. Here is some sample code below. What am I missing here. In this example, the deviceInquiryStarted trigger never fires, even though it clearly starts and finds devices. Also devices are not added to the @Published object as they are found. Also the sender.stop() does not seem to work when coming from the delegate to stop the search. I feel like I am just missing something here as it relates to delegates. I am just looking to scan for HID devices like mice, keyboards and headsets. Then allow the user to pair the device, and list paired devices. I am pretty new to IOBluetooth so any help is appreciated. import IOBluetooth import IOBluetoothUI import SwiftUI class BluetoothSearchDelegate : NSObject, ObservableObject, IOBluetoothDeviceInquiryDelegate {          @Published var devices: [IOBluetoothDevice] = []          func deviceInquiryDeviceFound(_ sender: IOBluetoothDeviceInquiry, device: IOBluetoothDevice) {         debugPrint("********** DEVICE FOUND ************")         self.devices.append(device)     }          func deviceInquiryStarted(_ sender: IOBluetoothDeviceInquiry) {         debugPrint("inquiryStarted")     }          func deviceInquiryComplete(_ sender: IOBluetoothDeviceInquiry, error: IOReturn, aborted: Bool) {         sender.stop()         print("completed")     } } class BluetoothController: ObservableObject {          //     // DEVICE LISTS     //     @Published var devices: [IOBluetoothDevice] = []          //     // SEARCH TYPE     //     let searchType: IOBluetoothDeviceSearchTypes = kIOBluetoothDeviceSearchClassic.rawValue          //     // BLUETOOTH DEVICE     //     let btDevice: IOBluetoothDevice = IOBluetoothDevice()          //     // DELEGATES     //     let searchDelegate = BluetoothSearchDelegate()          //     // AGENTS     //     let searchAgent: IOBluetoothDeviceInquiry     let pairingAgent = IOBluetoothDevicePair()          init() {         self.searchAgent = IOBluetoothDeviceInquiry(delegate: self.searchDelegate)         self.searchAgent.searchType = self.searchType     }          func scan() {         self.searchAgent.inquiryLength = 1         self.searchAgent.start()         self.devices = self.searchDelegate.devices     }          func getPairedDevices() -> [IOBluetoothDevice] {         let devices = IOBluetoothDevice.pairedDevices() as? [IOBluetoothDevice]         debugPrint(devices ?? [])         return devices ?? []     }          func stop() {         self.searchAgent.stop()         self.devices = self.searchAgent.foundDevices() as? [IOBluetoothDevice] ?? []         self.searchAgent.clearFoundDevices()                  debugPrint("Device Count: \(self.devices.count)")     }          func pair(device: IOBluetoothDevice) -> IOBluetoothDevicePair {         self.pairingAgent.setDevice(device)         pairingAgent.start()         return pairingAgent     }          func stopPairing(pairingAgent: IOBluetoothDevicePair) {         pairingAgent.stop()     }                } struct ContentView: View {     @State var isScanning: Bool = false     @State var isPairing: Bool = false     @ObservedObject var bt = BluetoothController()          var body: some View {         VStack {             Text("Scan for bt devices").padding()             Button(action: {                 if !self.isScanning {                     self.bt.scan()                     self.isScanning.toggle()                     return                 } else {                     self.bt.stop()                     self.isScanning.toggle()                     return                 }                              }, label: {                 Text(self.isScanning ? "Stop" : "Scan")             }).padding()                          List(self.bt.searchDelegate.devices, id: \.self) { device in                 HStack {                     Text("\(device.name)")                     Spacer()                     Button(action: {                         var pairingAgent: IOBluetoothDevicePair = IOBluetoothDevicePair()                         if !self.isPairing {                             pairingAgent = bt.pair(device: device)                         } else {                             bt.stopPairing(pairingAgent: pairingAgent)                         }                     }, label: {                                                  if !self.isPairing {                             Text("Pair")                         } else {                             Text("Stop")                         }                     })                 }             }         }     } }
Replies
0
Boosts
0
Views
1.2k
Activity
Jun ’22
Have an iOS/iPadOS app be a bluetooth audio receiver
I was wondering if it is possible to use the bluetooth API on iPadOS to let an app become an emulated "bluetooth speaker/car". I want to make an app where an iPhone or Android phone can connect to it via bluetooth so the app can play the audio from the phone, and receive and handle calls just like a car can play audio and handle calls and display call information via bluetooth. I would also like to know if the app could also get contact information from the phone over bluetooth. If it is possible to do so, how? I would love a friendly nudge in the right direction :)
Replies
0
Boosts
0
Views
1.1k
Activity
Jun ’22
Cross Transport Key Derivation
Any developer has experience in CTKD? I saw it was mentioned in WWDC 2019 (https://developer.apple.com/videos/play/wwdc2019/901), and it stated that there would be a sample project from documentation (https://developer.apple.com/documentation/corebluetooth/using_core_bluetooth_classic). But I could not find further information on it.
Replies
1
Boosts
0
Views
1.3k
Activity
Jun ’22
Repeating BLE pairing requests
I am currently working on an IOS application that pairs with a raspberry pi advertising a UART BLE service. The application successfully discovers the peripheral and attempts to connect to it. However, I keep getting a pop up window from IOS with a request to pair with the device. If I press "cancel", the app disconnects from the peripheral. If I press "pair", the peripheral connects. However, the app continues sending me pairing requests. Is this a known bug with IOS? Is there any way to get around this issue?
Replies
3
Boosts
0
Views
3.7k
Activity
Jun ’22