Questions tagged [core-bluetooth]
CoreBluetooth is a framework for iOS and Mac OS X to interact with Bluetooth Low Energy ("BLE") accessories.
2,463
questions
1
vote
1
answer
22
views
BLE connect to multiple devices (Swift)
How to connect BLE multiple devices at the same time in Swift
I'm working on iOS application project using BLE to transfer some data between them. The concept is one device is the main device that ...
1
vote
1
answer
22
views
Programmatically remove paired bluetooth devices in iOS
Is there a way to programmatically remove paired Bluetooth devices from iOS device settings?
Right now we only know that there are some devices saved in Bluetooth device settings, and we ask the user ...
1
vote
0
answers
22
views
Is there any way to scan BLE devices in background without explicity specify the serverUUIDs?
My goal is to scan over time all the BLE devices. In foreground this is possibile, but as soon as I close the app it does not scan anymore. In the swift documentation it is written:
Your app can scan ...
0
votes
0
answers
25
views
How can I read data in Swift that I am writing to an HM-10 bluetooth module connected to an Arduino?
I am coding an iOS app to read data transmitted by an HM-10 module connected to an Arduino. When I write an int value to the HM-10 module, I receive data in the app, but it is formatted as data, as ...
0
votes
0
answers
16
views
CBMutableCharacteristic properties writeWithoutResponse value changes in central application
I'm making central and peripheral bluetooth application by CoreBluetooth but having trouble with the following.
Make characteristic and set properties .writeWithoutResponse in peripheral application ...
-1
votes
0
answers
30
views
OSX Bluetooth Classic SPP examples in C++
I have spent days now, trying to find any kind of example code of someone setting up a Bluetooth connection under Mac OSX in C++. I see one or two Objective-C lines of code, completely without ...
1
vote
2
answers
66
views
What does CBATTError Code insufficientResources really mean?
I'm trying to send data over BLE from my iPhone to an ESP32 board. I'm developing in flutter platform and I'm using flutter_reactive_ble library.
My iPhone can connect to the other device and it can ...
0
votes
0
answers
47
views
How to store Bluetooth Status in a variable in Swift?
I have implemented CBManagerDelegate and can print the status successfully, thanks to this answer . But I want to store this state in a variable and use in my post API. How to proceed?
Tried to store ...
0
votes
0
answers
34
views
Can't connect to CBPeripheral
I'm working on an app that connects to a peripheral via CoreBluetooth.
It uses state restoration to retrieve a previously connected peripheral and tries to connect to it with CBCentralManager's ...
0
votes
0
answers
44
views
Set an @EnvrionmentVariable from within an ObservableObject helper class
I am using CoreBluetooth in SwiftUI and want to set the CBPeripheral use it throughout the app. Using a wrapper class as an EnvironmentObject seems like the right way to go, however I am not sure how ...
0
votes
1
answer
36
views
Arduino ESP32 not showing up in Swift/iOS CoreBluetooth app when services are advertised
I am trying to list only bluetooth devices in iOS with a certain service, but it is not showing up. I am using a HiLetgo ESP-WROOM-32 ESP32 ESP-32S Development Board and Arduino. The Arduino code is ...
0
votes
1
answer
33
views
Is it possible to detect when the user answers the Bluetooth permission request on iOS?
Most of the permission requests on iOS these days have an API with a callback for when the user answers the request alert. Is it possible to get a similar effect for the Bluetooth permission request? ...
0
votes
1
answer
21
views
Core Bluetooth scanForPeripherals yields no results when given CBUUIDs
I have a speaker that supports the following profiles according to the manual: A2DP, AVRCP, HSP, and HFP.
I'm using Bluetooth's Assigned Numbers Document to create my CBUUIDs.
let a2dpSinkUUID = ...
0
votes
0
answers
21
views
BLE Peripheral created by CoreBluetooth running on my Mac cannot be discovered by iPhone. But it can be discovered by Android Phone
Here's the process of creating the Peripheral:
// Create a CBPeripheralManager object
let peripheralManager = CBPeripheralManager()
// Create a CBMutableService object to represent the ...
0
votes
1
answer
22
views
I make Beacon in my Swift app which is advertising data but its local name is not shown. Can we add custom data packet during advertisement?
My app act as a beacon but I want to add its local name like my appName. I want to know that can we advertise custom packet in which I can add local name while advertising major, minior, proximityuuid,...
1
vote
1
answer
43
views
How to set an advertisement payload and a scan response payload on an iOS Peripheral using CoreBluetooth
I've implemented similar functionality on Android using and it works cleanly and I'm able to grab the advertisement payload & scan response payload with this API defined in android.bluetooth.le....
0
votes
0
answers
26
views
Bluetooth Core v5.3 Set Extended Advertising Data Command
I'm trying to re-implement HCITool functions in my application. Currently trying to get the command "cmd" working so that I can set extended advertising data which will hold manufacturer ...
0
votes
0
answers
34
views
Detect how close the iPhone is to the Mac using BLE?
I'm trying to detect if the iPhone is placed close enough to the Mac using BLE signal strength. I am using the following code to detect if the iPhone is in range(and it works), but I don't know how to ...
0
votes
0
answers
30
views
How to add descriptor UUID while using CoreBluetooth framework
let descriptor_uuid_configure: CBUUID = CBUUID(string: CBUUIDCharacteristicUserDescriptionString)
let descriptor = CBMutableDescriptor(type: descriptor_uuid_configure, value: nil)
let ...
0
votes
0
answers
35
views
Flutter nearby connections on IOS
I want to make chat app using nearby connections/bluetooth. I was using flutter_nearby_connection pack, which should work on both platform (ios + android), but it works only on IOS emulator. Real ...
0
votes
0
answers
50
views
How to fix the problem for the bleak module?
Error running below code at __aexit__. Traceback posted below.
import asyncio
import time
from bleak import BleakScanner
from bleak.backends.bluezdbus.client import BleakClientBlueZDBus
ADDRESS = &...
0
votes
1
answer
48
views
Multiple CBCentralManagers in the same app not calling their update state functions
There are a few Stack Overflow questions about this however they are either outdated or have mixed answers on whether 2 central managers are supported. I am using IOS 16.2, the problem also occurs on ...
0
votes
1
answer
31
views
Data sent to peripheral not working using Corebluetooth
I am trying to sent data to a peripheral using CoreBluetooth , the frame that I sent to device is as follows after encryption :
[12, 25, 26, 178, 186, 127, 127, 133, 144, 93, 144, 188, 104, 52, 119, ...
0
votes
0
answers
39
views
How to discover new services when peripheral change services
Currently, I am facing a case like the following when working with the core bluetooth framework:
The phone will first connect to the bluetooth device and scan for the services the bluetooth device ...
0
votes
0
answers
29
views
App doesn't reconnect to a Bluetooth device when it is in the background
I have an app that uses Bluetooth (BLE). All BLE communication works fine. State restoration is also implemented and works well. The app has automatic re-connection implementation: whenever the ...
3
votes
2
answers
126
views
iOS BLE unstable connection
I'm currently developing a react native app in combination with a device. The device and the app communicate via BLE. So far everything works as expected but I'm having issues with the connection ...
0
votes
1
answer
70
views
Best approach for continually scanning bluetooth devices on iOS as well as storing the peripheral data in background?
I am currently using CoreBluetooth to scan for peripherals. Every 30 seconds it sends its packet of information to the cloud by using a Timer. This is working good in foreground. I would like this ...
0
votes
0
answers
50
views
CBL2CAPChannel not responsive while app is backgrounded
I'm facing an issue where L2CAP (or NSStream) stops notifying events to the app after app went to background (after 2-10 seconds). App is probably being suspended (as expected).
My expectation is that ...
0
votes
0
answers
40
views
CoreBluetooth centralManagerDidUpdateState() method not getting invoked in Objective-C
I've created a React Native project and I need to discover Bluetooth devices in the background. I'm trying to implement the entire background functionality on the native side using Objective-C.
As an ...
0
votes
0
answers
41
views
iOS Bluetooth Background process not working on time
I am trying to send data on my bluetooth device using app when it is on background mode. It is communicate to the device successfully but not on time. If I want the background process start after 2 ...
0
votes
1
answer
48
views
BLE device scanning in background using CoreBluetooth swift
I have an app demanding to scan BLE devices around in background mode when app is not active in foreground.
I have implemented such functionality using CoreBluetooth framework. This is code, I am ...
0
votes
0
answers
33
views
Allow only one iPhone connection for my Bluetooth device
We have a BLE device that works like a Fitness band. I want to pair to only one iPhone from the band. Until the user unpairs from the phone or the user resets from the band, no other iPhone is allowed ...
0
votes
0
answers
76
views
iOS BLE problem didUpdateValueForCharacteristic not called ios14
We have a peripheral device and I am trying to connect it with iOS device. It was working fine with Swift 3.0 But when I am trying to convert it in Swift 5.0 it did not work. It is working perfectly ...
5
votes
1
answer
46
views
Why does “Bluetooth Low Energy primer” document state that a BLE observer device needs a transmitter and may or may not have a receiver?
I was reading the Bluetooth LE primer document and stumbled across the table given below:
My doubt is how can receiver be optional if the observer's only job is to receive BLE data and not transmit ...
0
votes
0
answers
19
views
CoreBluetooth shows devices/peripherals with Bluetooth turned off
var peripherals = [CBPeripheral]()
func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
if let _ = ...
1
vote
1
answer
75
views
Bluetooth Low Energy(BLE): Swift Only Receiving the Last String Sent by Arduino
I found no matter what I sent in Arduino BLE. The swift end in iOS only receive the message. For example, in the sample code below. The swift always print out "Optional(“0703”)". Does ...
0
votes
0
answers
55
views
Is the NSBluetoothAlwaysUsageDescription error message on MacOS a bug?
I am developing an app on MacOS that uses the CoreBluetooth framework.
I have added the NSBluetoothAlwaysUsageDescription key and the description to the Info.plist file as required.
<key>...
1
vote
1
answer
61
views
The app can't connect with new BLE device (iOS)
Our iOS app uses a specific Bluetooth device from a hardware partner. The device sends BLE packets periodically and the phone receives these packets and sends the data to our DB. It also works in the ...
0
votes
0
answers
16
views
Determine if BLE peripheral is paired/has been seen before in iOS app
I'm developing an iOS app that works with a Bluetooth Low Energy (BLE) device.
The first time the app connects to a device it hasn't seen before, a dialog box appears asking the user if they want to ...
0
votes
0
answers
23
views
Runtime AXRuntimeCommon error when dismissing custom keyboard
I'm working on a bluetooth project, and getting a runtime error when dismissing our custom keyboard.
The development environment is based on M1 chip, Xcode version is 13.4.1, deployment target is iOS ...
1
vote
0
answers
57
views
Run small algorithm while iOS app is in background
I am developing an iOS app kind of similar to functionality of Apple's air tag tracker app.
My app doing dead reckoning using CMPedometer and Accelerometer. Dead reckoning should start after receive a ...
1
vote
1
answer
150
views
In iOS, how do I lower BLE connection interval?
How do I specify a lower BLE connection interval in iOS?
I believe in iOS the default is 30 ms but can be lowered to 15 ms (as mentioned in 2017 WWDC Whats New In Core Bluetooth).
Apple mentioned the ...
3
votes
0
answers
48
views
How to get Bluetooth device name on BT version below 4.2
I am trying to fetch car bluetooth device name with BT version below 4.2 in iOS, the car panel has android OS v10. I am able to fetch the bluetooth device name above BT v4.2 but when I try below this ...
0
votes
0
answers
163
views
how to connect a bluetooth device to android using android shell command line
I want to connect a device through Bluetooth to android phone using adb shell command line.
I know how to enable and disable Bluetooth using adb shell.
you can find the linked issue in the this ...
5
votes
1
answer
367
views
Core Bluetooth: Reduced BLE MTU size when upgrading from iOS 15 to iOS 16
I'm seeing an issue where the iPhone's/iOS's MTU size seems to decrease after upgrading from iOS 15 to iOS 16. Before upgrading to iOS 16, the MTU size from the phone's size was always 185 bytes, ...
0
votes
0
answers
89
views
Core Bluetooth CBPeripheralState doesn't update when connected
Okay so basically, I'm trying to write the status of my device. When pressing it, it connects, at first it says Not Connected as it should, but when connecting it just gets stuck on Connecting instead ...
0
votes
0
answers
30
views
iOS corebluetooth never reconnects
I can connect my bluetooth device and interact without any problem, but when I try reconnect the problem occurs: iOS will never reconnect.
When I go far from the device, iOS is disconnected firing ...
0
votes
0
answers
51
views
Establishing BLE pairing by passkey method
I'm able to connect to the Bluetooth device, but iOS doesn't ask for pairing with it
in result bluetooth icon keeps blinking on the connected device's screen. I found it required that passkey should ...
0
votes
1
answer
243
views
BLE Scanning in background State of iOS app
There is any API OR third party for BLE communication in iOS app background state ..?I tried “Uses Bluetooth LE accessories” ,”Background Processing”,”Background fetch” with these capabilities BL ...
0
votes
0
answers
47
views
How does CoreBluetooth collect the MAC address of Holyiot device?
I'm trying using the CoreBluetooth to collect the MAC address of Holyiot device.
There are many questions/answers about this problem, such as 1, 2, 3
I have installed the Holyiot-beacon application ...