Core Bluetooth

RSS for tag

Communicate with Bluetooth 4.0 low energy devices using Core Bluetooth.

Core Bluetooth Documentation

Posts under Core Bluetooth tag

176 Posts
Sort by:
Post not yet marked as solved
1 Replies
278 Views
If I'm talking to a Bluetooth (BLE) device using the Core Bluetooth functions, and I need to send or receive multiple packets (such as if I need to communicate a large message) is it guaranteed that the packets will arrive in the same order they were sent?
Posted
by flarosa.
Last updated
.
Post not yet marked as solved
1 Replies
832 Views
Hello, Our team is working on a mobile app that uses Nearby Interaction framework (UWB technology) to get real-time high-accuracy ranging information with our third-party UWB-enabled device. So far everything works fine, background sessions included as explained in wwdc2022/10008 video. We are using Bluetooth LE to exchange the UWB parameters as recommended by Apple. Our next goal is to go for a full hands-free configuration of the UWB session. Let's think of an access control use case where UWB is used to measure the distance between the user and the door (credentials exchanged via Bluetooth). What we want to achieve is to start the UWB session without requiring the user to take the phone out of his wallet and open the access control app. What it works for us today is if the user starts the app, then switches off the screen and puts the phone into his pocket. The app is still running in background, so the Bluetooth Scan keeps working, the Bluetooth session starts, the UWB parameters exchanged and the UWB session started in the background, all good. But what if the user killed the app or never started it after reboot? How can we force the app to start from killed state when the BLE / UWB third-party accessory comes into proximity? iBeacon seems like a promising approach, but according to the forums, in iOS 16 the app will not be restarted from killed state. Is this correct? Any idea / suggestion about how to let the OS start our app when the user approaches the BLE / UWB accessory and the app is in killed state? Thanks in advance for your time. Regards.
Posted
by gorka-mk.
Last updated
.
Post not yet marked as solved
1 Replies
451 Views
Hello, We are working with Nearby Interaction (UWB) technology to provide high-accurate location use cases to our customers. According to Apple's documentation, in order to enable background sessions starting iOS16, the two devices need to be paired. The accessory needs to implement Nearby service and mandated encrypted characteristic. https://developer.apple.com/documentation/nearbyinteraction/ninearbyaccessoryconfiguration So far we tested this with "PIN-based" secure pairing and everything works fine. Can you confirm if "Just works" PIN-less pairing is expected to work as well here? The documentation is not clear on this respect. We would basically indicate IoNone local capabitilities for the accessory gap parameters if this is expected to work. Thanks in advance! Regards.
Posted
by gorka-mk.
Last updated
.
Post not yet marked as solved
0 Replies
300 Views
Dear Developer Community, I recently implemented privacy manifest changes in accordance with Apple guidelines. However, have encountered unexpected issues with BLE communication while our app was running in the background when there are multiple reader. During local testing in both debug and release modes within Xcode, have not experienced any problems with BLE communication, even with multiple readers. However, upon uploading the build to TestFlight for testing, i found that communication was being blocked when multiple readers are there. This behavior was quite perplexing. Upon further investigation, I decided to revert the privacy manifest changes and retested via TestFlight. Surprisingly, we did not encounter any issues with BLE communication. I am reaching out to this forum to inquire whether anyone else has encountered similar issues with BLE communication. Additionally, I have submitted a report via Feedback Assistant to seek assistance from Apple. I am particularly interested in understanding if any core logic related to BLE is affected by the privacy manifest changes. As Apple has mandated the inclusion of the privacy manifest for App Store submissions starting from Spring 2024, any insights or assistance on this matter would be greatly appreciated.
Posted
by MahaSVS.
Last updated
.
Post not yet marked as solved
4 Replies
425 Views
Using CoreBluetooth I am getting these values from CBCentralManagerDelegate's didDiscover peripheral delegate method: kCBAdvDataTxPowerLevel: 12 (could be other number like 7, 0 or a small negative number) This one is taken from advertisementData parameter. This key might be absent. rssi: -68 (or -60, -100, etc) this is taken from the "rssi" parameter (always present). I am looking for a formula to calculate approximate distance based on these two numbers. Is that possible? I know that ideally I need to know rssi0 (rssi at 1 meter), but I don't see how I can get that via CoreBluetooth API or other means (without actually measuring rssi at one meter distance which is not good for me). How could I approximate rssi0 value with "kCBAdvDataTxPowerLevel"?
Posted Last updated
.
Post not yet marked as solved
1 Replies
294 Views
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?
Posted
by ateszra.
Last updated
.
Post not yet marked as solved
0 Replies
303 Views
I managed to get the entry/exit for beacon region on >iOS 17.0 to <=iOS 17.1.2, but it doesn't work at all on latest iOS version 17.3.1. I have tried the new addition in iOS 17.2, assuming unmonitored as well but still no result. I'm using the sample code provided by apple, https://developer.apple.com/documentation/corelocation/monitoring_location_changes_with_core_location. Please guide.
Posted Last updated
.
Post not yet marked as solved
0 Replies
184 Views
Hi, we're having trouble with a device that changes its services to do firmware updates and does not implement the Service Changed characteristic. I understand that the iPhone caches the services, is it possible to clear this cache, or is it known how long does it last? We unfortunately cannot reset the iPhone as I've seen suggested, as this is the users' phone I'm talking about. Thanks
Posted
by disoteo.
Last updated
.
Post not yet marked as solved
0 Replies
225 Views
Hi, My app allows to connect to a bluetooth device. If the user has multiple devices he can connect all of them simultaneously, the app UI is presenting a list of all paired device. If the user open the phone bluetooth settings and forget one of the paired device, I would like to also remove it from the list of paired devices in displayed in my application. I was expecting CBCentralManager.retrievePeripherals(withIdentifiers:) to return nil if the device has been removed in the bluetooth setting but this function still return a device. Is there another solution to do that ? Thanks
Posted Last updated
.
Post marked as solved
3 Replies
339 Views
Where's CBAdvDataManufacturerData format documented? It looks like there's the company code stored in little endian order in the first two bytes (referencing the companies found in company_identifiers.yaml on bluetooth site). And the rest is arbitrary? I'd like to see the official documentation about this. Thank you.
Posted Last updated
.
Post not yet marked as solved
0 Replies
203 Views
We plan to use “AVFoundation” framework, and fetch current route of .bluetoothA2DP by using AVAudioSession.sharedInstance().currentRoute.outputs to get uid of our audio headset. Then, compare audio port, uid with the one advertised in BLE manufacturer data by using CoreBluetooth framework to ensure connected audio device. Does anyone have experience of using this method in your app that works with Bluetooth audio devices?
Posted
by nay81.
Last updated
.
Post not yet marked as solved
0 Replies
328 Views
I am trying to write to a characteristic and I know that it needs to be paired via a pin/passcode in order to initiate transfer of data. But it only pairs with 'just works' method and does not allow for transfer for data. Is connecting possible with pin/passcode via BLE on TVOS? Seems like it's not.
Posted
by JSyquia.
Last updated
.
Post not yet marked as solved
1 Replies
379 Views
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?
Posted Last updated
.
Post not yet marked as solved
0 Replies
333 Views
hi everyone. im new to xcode and wondering if anyone has any idea for what to do when your initial view controller keeps showing a black screen. ive done the following ensured Main storyboard file base name in info.pl is set to my storyboard. also under application scene manifest --&gt; scene configurations --&gt; application session role --&gt; item 0 i have storyboard name as my storyboard and delegate class name as my SceneDelegate but I keep receiving this error 2024-02-13 22:42:47.452242-0500 PROJECT-NAME[11302:838011] [SceneConfiguration] Info.plist configuration "(no name)" for UIWindowSceneSessionRoleApplication contained UISceneDelegateClassName key, but could not load class with name "SceneDelegate". 2024-02-13 22:42:47.452641-0500 PROJECT-NAME[11302:838011] [SceneConfiguration] Info.plist configuration "(no name)" for UIWindowSceneSessionRoleApplication contained UISceneDelegateClassName key, but could not load class with name "SceneDelegate". 2024-02-13 22:42:47.456532-0500 PROJECT-NAME[11302:838011] [WindowScene] There is no scene delegate set. A scene delegate class must be specified to use a main storyboard file. the initial view controller box is checked for the correct controller (HomePageController) ive added print statements to my viewDidLoad() in my HomePageController (i guess one weird thing is that i cant set 'main interface' to my main storyboard in the deployment info section) im really not sure what else to do, and any help would be really appreciated. im a beginner so all of this is a bit difficult. this is my info.pl file: https://drive.google.com/file/d/1W-KOH3BjqgfJf10n9LM5bRTYHXQYM9ER/view?usp=sharing
Posted
by chiadika.
Last updated
.
Post not yet marked as solved
2 Replies
265 Views
We do have an app where we try to connect via BLE to our own hardware. To trigger the pairing process we attempt a read operation on an encrypted characteristic. If the devices are note paired/bonded yet we do receive the expected CBATTErrorInsufficientEncryption Error and the native alert opens to enter the PIN. If the native pairing alert is now canceled 2-3 times the native alert will not be shown for any attempt afterwards unless I wait around 3 minutes. Is there a certain timeout for BLE devices when the system shows the pairing alert again in case it failed multiple times? I didn't find anything in that regard in the documentation.
Posted
by KroegD.
Last updated
.
Post not yet marked as solved
2 Replies
570 Views
Currently working on an emergency app paired with a BLE device, and the desired use case is: When the device is triggered, it sends your location to your emergency contacts an API we've built. This flow works while the app is open, but we need things to obviously work while in background (while the phone is sleeping as well, of course, for emergency contexts) From what I've researched and understood, background fetches don't really work, because the intervals are a maximum of about 15 minutes, and iOS will make them less frequent based on app usage, and that window in an emergency situation isn't good enough. Having read around, I've bumped into a couple resources that suggest background bluetooth processing is possible, if I listen for a particular service being advertised, but I haven't been able to make things work so far. I wanted some help on this.
Posted
by JoaoNM.
Last updated
.
Post not yet marked as solved
1 Replies
439 Views
I have an app to communicate with a peripheral via L2CAP channel. Even I already enabled "Uses Bluetooth LE accessories" in "Background Mode", it still stop working when I lock the screen. Did some search and found these two posts: CBL2CAPChannel not responsive while app is backgrounded iOS Swift CoreBluetooth CBL2CAPChannel L2CAP Channel Oriented Connection Cannot Reconnect After Close From Central I am wondering if there are any solutions or work around about this. Based on the use case, I prefer to use L2CAP to transfer large data between two devices, so won't consider GATT.
Posted
by stonezhl.
Last updated
.
Post not yet marked as solved
2 Replies
360 Views
Hi Team, 

I am developing a sample authPluggin which should connect to a mobile app via bluetooth connection, 
So here are the scenario

 Authplugin with Bluetooth connection shoould work on lockscreen+login 

I have created mechanism- prepared:privillaged, main, clean:Privilaged Calling corebluetoothmanager initiation at the time of prepared:privilaged mechanism I have to add my auth plugin’s mechanism before loginwindow:success mechanism

 But I always gets unauthorized = 3, from power state of bluetooth

 Note: With App, bluetooth connection is working fine, Its giving error with authPlugin How to achieve my ultimate goal, is this the right way?
Posted Last updated
.