Post not yet marked as solved
I'm hitting an issue with a connected peripheral that was discovered with BLE when that peripheral also happens to be classic BT paired. If that peripheral is not classic BT paired, there is no issue.
When calling discoverServices([serviceCBUUID]) the peripheral delegate peripheral:didDiscoverServices: is called without error, but peripheral.services is empty whenever the peripheral happens to also be classic BT paired.
How can it be possible to get a callback that services where discovered, yet the peripheral has no services when queried in that callback?
Is this a known issue with a workaround? Thanks.
Post not yet marked as solved
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?
Post not yet marked as solved
In my app the shortcut intent handler is scanning for Bluetooth devices and based of a given selection it connects to them devices and perform some actions.
Now as soon the option 'Show When Run' is set to disabled, the Bluetooth centralManager does no longer connect to any peripheral, device scanning is still working though and running the shortcut by Siri is working as well.
As a result, automation doesn't work and apparently I cannot use the shortcut as widget on lockscreen.
What else does the 'Show When Run' option apart from raising a user notification after the shortcut completed?
Could this be a missing permission issue? I already added required keys on the info.plist for Bluetooth access and added Bluetooth background option on both app and shortcut targets.
Post not yet marked as solved
Hi,
We have connected with hardware device successfully without add password.
We would like to use the device with password authorization. When device is connect successfully then password is required and without password device should not work.
We have tired all authentication and authorization methods in core bluetooth documentation but not work.
We have also search on stack overflow we got this link
https://stackoverflow.com/questions/26483669/ios-core-bluetooth-pin-code
Please guide us how can achieve with password ?
https://developer.apple.com/documentation/corebluetooth/cbcharacteristicproperties/1518980-authenticatedsignedwrites
Thanks
Post not yet marked as solved
Hi,I am trying to figure out to see if there's a way that I don't need to prompt user to enter the password, but to send password programmatically.Example:1. Device has a pre-shared key of 12342. My app attempts to pair with the device with 1234Ideal Result:- User does not need to input password of 1234. The app handles the password entering and then it's pairedCurrent:- If I try to pair new device, I will always a pop-up that asks the user to enter the password 1234Thanks!
We have a custom accessory using iAP over Bluetooth classic (BR/EDR), and have recently noticed an unexpected wireless performance issue that wasn't there before. We haven't changed the firmware, and the nature of the bug strongly suggests it isn't anything on our end. The problem occurs in two different apps with very different codebases; one is our production app, which a large, complex Swift app for iPads. The second is a barebones test app that simply exercises the accessory to measure throughput. These apps have been in use for well over a year, and the test app has had no changes to speak of in that time. Neither app experienced this issue before (at the latest) iOS 15.
Basically, as soon as a toggle switch in the test app is enabled, the ExternalAccessory data stream is opened and a single command is sent to the accessory which instructs it to begin streaming data at roughly 7500 bytes/second. Normally, this throughput rate is easily achieved. However, when the problem occurs, the actual throughput varies wildly, averaging about 60-70% of the target rate. But the problem only occurs for 20 seconds after the app enters the foreground, and then the data stream stabilizes at full throughput. Nothing changes in the app or on the accessory during this time.
I have run dozens of tests, and the problem and timing are always the same:
The app exhibits poor Bluetooth throughput for 20 seconds after entering the foreground.
Freshly running the app or switching to the running app from a different app both trigger the problem.
Waiting to open the iAP connection for 20 seconds after foregrounding the app results in expected (good) throughput the whole time.
Disconnecting and reconnecting the accessory does not trigger the problem.
I'm not sure what else to test. I expect the same results could be seen with any Bluetooth iAP accessory pushing that much data right after its associated app enters the foreground.
Note, we have a different hardware variant in development which uses Bluetooth Low Energy and CoreBluetooth, and it has no such problem. It works perfectly all the time with the exact same testing app and data stream, just pushed over GATT instead of iAP.
Has anyone encountered similar symptoms with iOS 15.x or anything else?
Post not yet marked as solved
Hello,
We are a company working on Ultra Wideband solutions and, hence, using Apple's NearbyInteraction framework to establish UWB Ranging sessions with our UWB-enabled third-party accessory.
This week we were excited about the new background UWB Ranging session possibility, which opens new use cases. The wwdc2022 10008 video that provides the technical details for this feature indicates that the third-party accessory is responsible to expose the Nearby Interaction GATT Server. We don't manage to get full details about what needs to be implemented to by compliant with Apple's framework.
The URL below indicates that full BLE details should be explained in the "Nearby Interaction Accessory Protocol Specification" but we don't see any info there.
https://developer.apple.com/documentation/nearbyinteraction/ninearbyaccessoryconfiguration
https://developer.apple.com/nearby-interaction/specification/
Can someone indicate us where the find full details for this background Nearby Interaction feature?
Thanks in advance.
Regards.
Post not yet marked as solved
After updating a device to iOS 16 beta 1, I've noticed some changes to how Bluetooth profiles behave for certain functions. Specific examples include:
Message Access Profile -> The SetMessageStatus function returns "OBEX_BAD_REQUEST" where it didn't before
02-00-4E-01-00-23-00-42-00-36-00-42-00-38-00-42-00-37-00-30-00-37-00-42-00-39-00-41-00-38-00-34-00-33-00-45-00-00-42-00-16-78-2D-62-74-2F-6D-65-73-73-61-67-65-53-74-61-74-75-73-00-49-00-04-30-4C-00-09-17-01-00-18-01-01-CB-08-60-5E-20
Message Access Profile -> Getting Message Listings from the sent folder...previously I was able to retrieve messages here but am no longer able to.
It would be nice if the details of any changes were noted so appropriate updates can be made. Would also be nice if Apple finally moved off of version 1.2 or whatever so I can get Conversation Listings/Conversation ID from the device. We can dream, can't we?
Thanks,
-Drew
Post not yet marked as solved
Device Info:-
Bluetooth version: - 4.0
Communication Protocol: UART 3.3V TTL
Device is Weight Scale
We already tried using their mac address .but as per our knowledge we are unable to do that using core Bluetooth.
we are attaching Bluetooth device service and characteristics here.
Are we able to connect this Bluetooth Device using Core Bluetooth?
*
*
Post not yet marked as solved
My iOS app has BLE beacons detection in it. Which means If user has bluetooth and location on and if user enters the range of a beacon, system automatically awakes the app If it was not running (killed state).
This was working fine on iOS 14 and below. Yesterday I updated my device to iOS 15 and app no longer gets awoken while entering a BLE beacon region even If I have enabled "Always" location permission in the settings.
Any thoughts ?
Post not yet marked as solved
I know that with the release of watchOS 4, Apple Watch can now act as its own CBCentralManager for communicating with BLE peripherals. But why can't the Apple Watch be used as a CBPeripheralManager? If CoreBluetooth is now accessible, why allow access to receive BLE but not send? I have a project that currently uses WatchConnectivity to transfer motion data from the Watch to a paired iPhone, but I think that bypassing WatchConnectivity and making the Watch a BLE peripheral would improve data transfer rates significantly.Can anyone shed any light on why Apple Watch can't be a peripheral?
Post not yet marked as solved
We have a custom designed device that contains nRF51822 System on Chip from Nordic and we want to be able to exchange the data with it over Bluetooth Low Energy (BLE) link.
We are using Apple Notification Center Service (ANCS) so our custom device can wake up our app from sleep after receiving a notification, so we need to look for and subscribe to the ANCS primary service on our custom designed device to start this process.
nRF51822 SoC on our custom device can successfully discover ANCS Service on the iPhone (UUID = 0xF431) and explicitly enable Notification Source Notifications and Data Source Notifications on the custom device side.
What is not clear to us is whether our custom device can successfully become a Notification Consumer (NC) and get notified by the iPhone (Notification Provider) of incoming notifications without the Bluetooth Pairing Request popup.
As the documentation says, "All these characteristics require authorization for access.". Is this authorization shown through the Bluetooth Pairing Request system popup?
We asked Nordic about that (link) but they did not have a right answer and suggested to contact Apple.
Post not yet marked as solved
I am working on an app built in Swift and UIKit that uses audio playback over bluetooth. I am finding different amounts of latency for different devices, and it seems consistent across a given make/model. For instance, using an iPhone XR as the source, Bose On-Ear lags at 0.45 secs, Sony Pros lag at 0.3 secs and AirPods Pro lat at under 0.1 secs. I'd like to adjust latency based on collected data for "known" devices, but need a way (w/out asking the user for input) to detect the make and model of their bluetooth audio device
Is this possible to do, maybe using core Bluetooth, or not?
It looks like CoreBluetooth is completely broken in macOS 12 – at least for command line apps. I have a pretty simple scanning app and I no longer get any delegate calls for discovered devices. I DO get the "power up" state change delegate call though.
Any idea?
Post not yet marked as solved
I have a crash in an app made in SwiftUI and using Core Bluetooth. I didn't have any UI, just the WindowGroup with an EmptyView, in this crash log. I was just sending some data in the EmptyView's .onAppear modifier to the peripheral and when I got the response and disconnect I get the following crash. I don't know what is going on. Can anyone help me please?
Incident Identifier: 0A33C23B-6EB3-4137-92BE-A76DFB446558
CrashReporter Key: 47afebdb13773bf8c6112096dc5c4bf106cc22a1
Hardware Model: iPhone12,1
Process: App Clavier [331]
Path: /private/var/containers/Bundle/Application/F88A8F58-D219-4991-8356-337BD96CFAC8/App Clavier.app/App Clavier
Identifier: com.winerim.giltza
Version: 1.0 (2)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.winerim.giltza [519]
Date/Time: 2022-06-02 10:12:07.1258 +0200
Launch Time: 2022-06-02 10:11:49.3838 +0200
OS Version: iPhone OS 15.4.1 (19E258)
Release Type: User
Baseband Version: 3.02.01
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Subtype: KERN_PROTECTION_FAILURE at 0x00000027fffff9a0
Exception Codes: 0x0000000000000002, 0x00000027fffff9a0
VM Region Info: 0x27fffff9a0 is in 0x1000000000-0x7000000000; bytes after start: 103079213472 bytes before end: 309237646943
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
commpage (reserved) fc0000000-1000000000 [ 1.0G] ---/--- SM=NUL ...(unallocated)
---> GPU Carveout (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL ...(unallocated)
UNUSED SPACE AT END
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: SIGNAL 10 Bus error: 10
Terminating Process: exc handler [331]
Triggered by Thread: 0
Kernel Triage:
VM - pmap_enter failed with resource shortage
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libswiftCore.dylib 0x19f027cb8 swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::incrementSlow(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 60
1 libswiftCore.dylib 0x19efef0d0 swift_retain + 124
2 libswiftCore.dylib 0x19efef0d0 swift_retain + 124
3 SwiftUI 0x1a1db2f54 ViewGraph.timeDidChange() + 88
4 SwiftUI 0x1a1db3868 GraphHost.setTime(_:) + 168
5 SwiftUI 0x1a1dcb1dc ViewGraph.beginNextUpdate(at:) + 28
6 SwiftUI 0x1a1dc51c8 closure #1 in ViewRendererHost.render(interval:updateDisplayList:) + 2280
7 SwiftUI 0x1a1e8cd5c ViewRendererHost.render(interval:updateDisplayList:) + 388
8 SwiftUI 0x1a1dd816c _UIHostingView.layoutSubviews() + 256
9 SwiftUI 0x1a1ddbfcc @objc _UIHostingView.layoutSubviews() + 28
10 UIKitCore 0x19c794844 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2592
11 QuartzCore 0x19df0a1c0 CA::Layer::layout_if_needed(CA::Transaction*) + 532
12 QuartzCore 0x19defc5fc CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136
13 QuartzCore 0x19df10f70 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 452
14 QuartzCore 0x19df19e78 CA::Transaction::commit() + 704
15 QuartzCore 0x19defbd7c CA::Transaction::flush_as_runloop_observer(bool) + 88
16 CoreFoundation 0x19a1d9bb4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
17 CoreFoundation 0x19a1a8b70 __CFRunLoopDoObservers + 592
18 CoreFoundation 0x19a1a3c2c __CFRunLoopRun + 1052
19 CoreFoundation 0x19a1b76b8 CFRunLoopRunSpecific + 600
20 GraphicsServices 0x1b6251374 GSEventRunModal + 164
21 UIKitCore 0x19cb1ce88 -[UIApplication _run] + 1100
22 UIKitCore 0x19c89e5ec UIApplicationMain + 364
23 SwiftUI 0x1a1fee640 closure #1 in KitRendererCommon(_:) + 164
24 SwiftUI 0x1a1f1c524 runApp<A>(_:) + 252
25 SwiftUI 0x1a1efd810 static App.main() + 128
26 App Clavier 0x10507b5f8 static App_ClavierApp.$main() + 40
27 App Clavier 0x10507b774 main + 12
28 dyld 0x1058a5ce4 start + 520
Post not yet marked as solved
I'm developing a BLE app with the guideline below.
(https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf)
According to section 40.3 in the guideline, the use of ADV_DIRECT_IND is not a good idea.
I'm not sure the reason but it seems to be the rule for peripheral devices.
I think it's okay to connect my app(central device) to peripheral devices that transmit ADV_DIRECT_IND in an advertising packet.
Is my understanding correct?
Post not yet marked as solved
Am new to objective c I need to set a characteristic data which I get from a Bluetooth using CB read to Byte array then return a byte buffer.
the same is written in java how can I do the same in objective c
dataArray = characteristic.getValue();
tsLong = System.currentTimeMillis() - tsStart;
float timeSeconds = (float) ((float) tsLong / 1000.0);
String timerstring = String.format("%.2f", timeSeconds);
message = convertByteToChannelData(ByteBuffer.wrap(dataArray), timerstring, 0);
this is the convertByteToChannelData method
public String convertByteToChannelData(ByteBuffer wrap,String timerString, int stimulus){
wrap.order(ByteOrder.LITTLE_ENDIAN);
// Set 1 Channels
// Channels 1, 5, 6, 11, 16, 17
ch1R = (float) ((wrap.getShort(0) / 4095.) * 3.3);
ch1Rs = (float) ((wrap.getShort(4) / 4095.) * 3.3);
ch5R = (float) ((wrap.getShort(12) / 4095.) * 3.3);
ch5Rs = (float) ((wrap.getShort(4) / 4095.) * 3.3);
ch6R = (float) ((wrap.getShort(6) / 4095.) * 3.3);
}
Post not yet marked as solved
Hi Apple developer experts,
I am getting one critical issue related to Bluetooth on MacOS 12.0.1 and MacOS 12.1. Since we upgrade to MacOS 12.0.1 the bluetooth not working to the pair with device anymore with detail checking as below:
The issue was not happened from MacOS 10.7 to 11.3 Big Sur. Only happened from macOS Monterey 12.0.1 +
I got the console log with these message: [CoreBluetooth] No name or address and [CoreBluetooth] WARNING: Unknown error: 431. Sometime I also got this: [CoreBluetooth] WARNING: Unknown error: 10702
Checking with tool PacketLogger I saw the error message in HCI Event : Authentication Complete - PIN Or Key Missing and Command Complete [FD4E] - LE Update Extended Advertising Instance - Invalid HCI Command Parameters
The code get IOBluetooth Local Services in macOS Catalina response the channel id is 2 or 3 for the hardware device depending on. While in macOS Monterey is response with channel id 1. (The valid RFComm channel from 1 to 30 - IOBluetooth library)
The RFCOMMChannel in macOS Monterey is not opened and not response the notification. Everything works fine with older MacOS (I used PacketLogger to check). This maybe the main issue that the Pair device is not working anymore.
Note that the status BT connected just keep around 5 seconds then disconnected.
My code request RFCOMM include service name, L2Cap attribute, RFComm attributes, SDP attributes with uuid
I am very appreciate If anyone knows what should be changed or fix. Many thanks. I tried a lot of cases but it still not working, include reset the bluetooth from my Mac machine.
Our customer complaints a lot since they updated macOS Monterey and the bluetooth has been not working properly.
Any help would be greatly appreciated. Thank you!
If I understand correctly, ATT MTU size negotiation is managed by CoreBluetooth automatically and transparently. (Just in case - I'm not talking about Bluetooth 4.2 PDU size negotiation here - as far as I know, it is rarely supported).I'm not sure if / how to adjust my code to account for the actual MTU size to make communication as efficient as possible.Let's say, I want to implement duplex serial-like data exchange between two devices (at least iOS 8). As I have seen, common approach (and maybe the best one) is to have two characteristics on the peripheral : one characteristic is "notifiable", the other one - writable. The peripheral sends data to the central through notifications, the central sends data to the peripheral through the writable characteristic.The most technically useful answer that gave useful hints and highglighted possible caveats was http://stackoverflow.com/a/20321542/217823 by Justin Middleton. Is this even today, after 4 years, the most efficient way to implement BLE communication using CoreBluetooth?I have seen a suggestion to use central.maximumUpdateValueLength on the peripheral to avoid pushing more data than the central can accept. Is this value affected by the ATT MTU size? Is there any similar way for the central side also to determine actual current MTU size when writing the data to the peripheral's writable characteristic? Or I should write in safe chunks of 20 bytes and ATT subsystem will automatically collect MTU-sized messages?Also, I have heard that on some implementations you have to add a short sleep() after the first connection to give ATT subsystem some time to negotiate MTU sizes. Is this necessary for CoreBluetooth or does it happen automatically and I won't receive connection delegate calls sooner than MTU size negotiation was complete?
Post not yet marked as solved
I'm making an application that needs to discover Bluetooth 5.0, and my read extended advertising, jumping from 31 to 255 bytes. In the CB documentation I've only found the extendedScanAndConnect feature, but not how to implement this functionality. Also, I cant discover that coded PHY devices, even with the iPhone 12 who supports Bluetooth 5.0. thanks in advance.