Core Bluetooth

RSS for tag

Communicate with Bluetooth 4.0 low energy devices using Core Bluetooth.

Posts under Core Bluetooth tag

176 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Can an iOS Device Act as a Bluetooth Keyboard/Joystick Peripheral?
I am trying to turn an iOS device into a Bluetooth keyboard/joystick peripheral. I know iOS 16 supports the HID profile for communication with Bluetooth keyboards and game controllers (https://support.apple.com/en-us/HT204387). However, is it also possible for an iOS device to act as a HID device, advertising services like the HID? I've seen an app, BlueTouch seems to make the similar functionality, and sample code on Github (https://gist.github.com/conath/c606d95d58bbcb50e9715864eeeecf07) suggest this might be possible. Has there been any change in iOS that would allow an iOS device to act as a Bluetooth HID device? Could you point me to the relevant documentation or sample code? Thanks for any guidance you can provide.
0
0
542
Jul ’23
Bluetooth Connection Interval (iOS 16+)
My company has a Bluetooth 4.2 hardware product that requires a connection interval of 15ms to operate correctly. Starting with the release of iOS 16, we noticed these connection parameters are being rejected and we are provided a connection interval of 30ms which leads to severe packet loss. I'm aware of the note on page 193 of this document that specifies this may happen on some devices, but it had not been an issue up until the release of iOS 16. Does anyone know the precise circumstances that would lead to the scaling of this interval? Is there anything that can be done in software or firmware to get around the issue?
1
0
962
Jul ’23
hello, i am finding Swift Bluetooth Classic communication sample code.
i am coding swift Bluetooth classic Communication program. my app need to communicate with esp32 with Bluetooth classic. but i didn't know how i can do this. there are so many sample code that use Bluetooth Low Energy communication with Swift or SwiftUI but i can't find Bluetooth classic with swift or swiftui. i think apple doesn't support Bluetooth Classic Communication . for example, they doesn't explain well about "Using core bluetooth classic" guide at their document at apple web site.
0
0
434
Jul ’23
Arduino HM-10 Bluetooth with iOS : Connected, but it doesn't send values
I'm trying to make an iOS (SwiftUI based) app to connect the arduino and send the current latitude value of ios to arduino. I successfully made the view that allow user to select the bluetooth device, and the UUID/name of the device is successfully displayed. Also, the arduino device detects connection (I used LiquidCrystal to display serial and it says "OK+CONN" and "OK+LOST" if connection was lost.), but when I click "fetch location" button, nothing happens on arduino side. The code is in stackoverflow due to character limits: https://stackoverflow.com/questions/76752529/arduino-hm-10-bluetooth-with-ios-connected-but-it-doesnt-send-values
0
0
609
Jul ’23
how can i make a ios bluetooth classic program? is this Mission Impossible?
i must make a code that ios app communicate with esp32 module over bluetooth classic . i have been searching for several weeks... but i didn't find out sample code for bluetooth classic. i found one code that use External Accessory Framework. but this needs a registration for that device some one says that i can't this. because ESP32 Module can't be registered . and i found another one it is coded by reactive native. but finally, this one use a MFi(Made For Iphone) that use External Accessory Framework. i guess.. is it impossilbe that making a ios app that communicate with other device over bluetooth classic ? so, now i am finding some apps that can communicate esp32 module that is coded by arduino IDE over bluetooth classic, and this arduino app can communicate with android bluetooth classic terminal app. please help me
9
0
2.1k
Sep ’23
how can i use this "https://developer.apple.com/documentation/corebluetooth/using_core_bluetooth_classic" sample code ?
i want to make a bluetooth classic code i found sample code at apple web site just like below https://developer.apple.com/documentation/corebluetooth/using_core_bluetooth_classic but i can't use... i need some explanation for this, i watched video below https://developer.apple.com/videos/play/wwdc2019/901 but i need more easy and detailed explanation. this is all~~~ about ios bluetooth classic explanation in text. please help me is any other clips in youtube or sites that explain this easy and in detail ?
0
0
388
Jul ’23
How to connect to a peripheral already paired with iphone without scan again.
I working with an app have ability to connect to an peripheral device. When the device paired, it's stop broadcasting so I can not found it again by scanForPeripherals until I go to setting on iphone and forgot that devices. This is so inconvenient to user. When they kill app, the connect is break and when they open app again, they can not connect to my peripheral device. I already try use retrieveConnectedPeripherals and retrievePeripherals to get the peripheral back to connect but both thing seem to be notworking. Both method not return anything and Idk why. Does anyone have same use case and know how fix this ? Thanks so much!
1
0
493
Jul ’23
what is the market share of Bluetooth Classic iPhones in 2023 now ?
i have been making ios app that communicate with ESP32 using bluetooth classic. but this is very difficult to develop, because i can't find any Bluetooth scan app for test that can communicate with ESP32 until now, moreover, i can't find any sample code for Bluetooth Classic Communication . my client want me to make ios app using Bluetooth classic because of compatiblity, in other words, still, users using Bluetooth Classic iphone are used lots of users more than Bluetooth Low energy. so i doubt this assumption is right. if i make a bluetooth low energy app, can it be a trouble ?
1
0
545
Jul ’23
How to start a hands-free Nearby Interaction (UWB) session using Bluetooth?
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.
2
0
926
Mar ’24
centralManagerDidUpdateState is not called after user selection in Bluetooth permissions dialog
Hi, team. We are implementing a process to obtain Bluetooth usage permissions in order to use Bluetooth by iPhone, and we are having some unexpected behavior in the process, so we need someone's help. The problematic behavior is that the centralManagerDidUpdateState is not called after the user makes a selection in the Bluetooth authorization dialog. Expected behavior Instantiation of CBCentralManager Bluetooth authorization dialog appears on the screen Select "Allow" in the permission dialog After selection, centralManagerDidUpdateState is called CBManager.authorization becomes .allowedAlways Problem behavior Instantiation of CBCentralManager Bluetooth authorization dialog appears on screen centralManagerDidUpdateState is called before selection Select "Allow" in the authorization dialog After selection, centralManagerDidUpdateState is not called What could cause the centralManagerDidUpdateState to be called at such a time as the problematic behavior? Supplementary explanation CBCentralManager is held as a property and the instance is not released when the dialog is selected in the problem behavior. CBManagerState of CBCentralManager is .poweredOn and CBManager.authorization is .notDetermined in centralManagerDidUpdateState during problem behavior.
0
0
427
Aug ’23
Background mode for BLE app
Hi. I have medical app that communicates with bluetooth device all the time monitoring heart rate and oxygen. I set it as background: External accessory communication, Uses BLE, Background fetch, Remote notifications, Background processing. Unfortunately after about an hour max 2 hours it stops communicating with bluetooth device and stops sending data to the server. I know in Android for example if device in similar to iOS background mode but phone plugged into power then app will never be suspended. Is there some way for the app to be always running? We can tell users to keep it powered or always in foreground. Please help.
2
0
693
Aug ’23
Sometimes I cannot scan for Beacon or BLE in the background on iPhone
Hello. I am trying to create an app that detects the beacon and makes a BLE connection when the beacon is turned on while the iPhone is in sleep mode, without the app being on the app switcher. However, there are often times when beacons cannot be detected or BLE connections cannot be made. From what I've found, it's because iOS limits beacon/BLE scanning for security reasons. I know it's impossible, but is there any way to remove this restriction on scanning? If you can't, we would like to know when iOS places restrictions on scanning. If you can't, then we would like to know when iOS places restrictions on scanning and when those restrictions are lifted. Thank you very much. Development Environment: iPhone8 (iOS 13.7), iPhone13(iOS 16.0.3), macOS Monterey, MacBook Pro 2020(Intel Core i5), Xcode 14.2
1
0
473
Aug ’23
Unable to detect Bluetooth devices in the background on iOS 16.6.
Bluetooth devices could not be detected in the background on iOS 16.6. Up until iOS16.0.3, the same code was able to detect Bluetooth devices. Did the update between iOS 16.0.3 and iOS 16.6 put restrictions on Bluetooth scanning? It is initiating a Bluetooh scan upon beacon detection. The beacon is detectable. Below is the code. func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) { switch (state) { case .inside: print("StartBeaconNavigation: iBeacon inside") myLocationManager.requestAlwaysAuthorization() if(bleManager.linkState == .disconnected) { _=bleManager.startScan() } break; case .outside: print("StartBeaconNavigation: iBeacon outside") break; case .unknown: print("StartBeaconNavigation: iBeacon unknown") break; } } func startScan() -> Bool { print("BTMana:startScan") if( centralManager.state == .poweredOn ) { if centralManager.isScanning == false { let UUIDs: [CBUUID] = [systemServiceUUID] let scanOptions = [CBCentralManagerScanOptionAllowDuplicatesKey: true] centralManager.scanForPeripherals(withServices: UUIDs, options: scanOptions) return true } else { print("BTMana:startScan NG for scanning...") return false } } else { print("BTMana:startScan NG for state is not powerdOn ") return false } } As above, we are specifying the UUID of the service when scanning. Thank you in advance.
3
0
793
Sep ’23
BLE connexion: popup display rules
Hello, I'm new to CoreBluetooth framework and I want to understand the rules behind Bluetooth connexion popups displayed by iOS. I understood that while developing a BLE Central role application, I have no control over whitch security popup bill be displayed. During my tests with Apple BLE demo project CoreBluetoothLESample, I managed to activate the display of a pairing popup adding .indicateEncryptionRequired option to the characteristic options in the PeripheralViewController class: let transferCharacteristic = CBMutableCharacteristic( type: TransferService.characteristicUUID, properties: [.notify, .writeWithoutResponse, .indicateEncryptionRequired], value: nil, permissions: [.readable, .writeable] ) My question is: Can I find a documentation about pairing popups display rules on central iOS device (just a "Cancel/Pair" popup without PIN check, popup with PIN check, popup asking to enter a PIN, or no popup at all) regarding peripheral security level and/or capabilities (can display a PIN or not) ? Thank you for any help !
0
0
326
Aug ’23
NIErrorCodeInvalidConfiguration error code using the function NINearbyAccessoryConfiguration(Accessory:BluetoothPeerIdentifier)
Ranging is working great when I'm removing the BluetoothPeerIdentifier parameter but if I want to do some background ranging, I need to be able to use the removed parameter. Somehow when I'm both AccessoryData and BluetoothPeerIdentifier parameters, I got the NIErrorCodeInvalidConfiguration error code and i can't range anymore. Do you guys have a fix for that? The parameter BluetoothPeerIdentifier is not NULL so it should work properly... Thank you, Marc
0
0
607
Aug ’23
can iphone 5 communicate with other BLE device ?
can iphone 5 communicate with other BLE device ? i have made ios app communication with other device by bluetootch classic (BR/EDR) because my customer want my app to communicate old device using bluetooth classic, but, i found that the first iphone model using BLE is iphone 5 (2012 made) using BT4 last model of iphone using bluetooth classic is iphone 4s(2011 made) can iphone 5 communicate with other BLE device ?
0
0
449
Aug ’23
Pairing for MFi
Hi everyone, I'm currently working on a Bluetooth device that doesn't support pairing. While going through the MFi certification documents, I noticed that pairing seems to be a required feature. Has anyone had experience getting MFi certification for a device that doesn't support pairing? Is it even possible? Any insights or guidance would be greatly appreciated! Thanks in advance for your help!
0
0
513
Aug ’23