AccessorySetupKit

RSS for tag

Enable privacy-preserving discovery and configuration of accessories.

Posts under AccessorySetupKit tag

4 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Example for AccessorySetupKit bluetoothTransportBriding
Hi there! I'm developing a dual-mode bluetooth accessory and would like to pair it through AccessorySetupKit. I'm using an ESP32 with Bluekitchen btstack. This supports CTKD, which seems to be a requirement for the Bluetooth transport bridging according the WWDC19 session 901. I've been in contact with the btstack developer and verified that I can get the device to generate an LTK for the classic transport when reading an encrypted attribute. I'm not able to get this to work with the bluetoothTransportBriding option with AccessorySetupKit though. What I've found so far is that if I omit the .bluetoothTransportBriding option during pairing I will get a pairing request when I read an encrypted attribute after connecting with the CBConnectPeripheralOptionEnableTransportBridgingKey option. If I accept this request it seems like the system automatically brings up the A2DP profile. However if I include .bluetoothTransportBriding and/or .bluetoothPairingLE this option does not pop up, but the system does not bring up the A2DP profile. In this case things seem to end up in a weird situation where the device doesn't show up for pairing in Bluetooth Settings either, making it impossible to manually connect for A2DP. Based on the AccessorySetupKit example from WWDC24 I've created a dice accessory firmware for ESP32 using btstack. The code for this is available here: https://github.com/ljodal/esp32-btstack-ctkd-test I've also tweaked the AccessorySetupKit example app for iOS to add the ASAccessory.SupportOptions. The code for that is available here: https://github.com/ljodal/accessorysetupkit-ctkd-test Is there any documentation available anywhere on what is expected of the device for Bluetooth Transport Bridging to work with AccessorySetupKit?
0
0
109
2w
Unable to use Bluetooth in watchOS companion app if iOS uses AccessorySetupKit
FB18383742 Setup 🛠️ Xcode 16.4 (16F6) 📱 iPhone 13 mini (iOS 18.0.1) ⌚️ Apple Watch Series 10 (watchOS 11.3.1) Observations As AccessorySetupKit does not request "Core Bluetooth permissions", when a watchOS companion app is installed after having installed the iOS app, the toggle in the watch settings for Privacy & Security > Bluetooth is turned off and disabled After removing the iPhone associated with the Apple Watch, Bluetooth works as expected in the watchOS app Upon reinstalling the iOS app, there's a toggle for Bluetooth in the iOS ASK app's settings and the ASK picker cannot be presented 🤨 From ASK Documentation: AccessorySetupKit is available for iOS and iPadOS. The accessory’s Bluetooth permission doesn’t sync to a companion watchOS app. But this doesn't address not being able to use Core Bluetooth in a watch companion app at all 🥲 Reproducing the bug Install the iOS + watchOS apps Launch iOS app, tap "start scan", observe devices can be discovered (project is set up to find heart rate monitors) Launch watchOS, tap allow on Bluetooth permission pop-up watchOS app crashes 💥 Meanwhile, in the iOS app, there should be a log entry for 💗 CBCentralManager state: poweredOff and the ASK picker is no longer able to discover any devices The state of the device permissions: iOS app has no paired accessories or Bluetooth permission watchOS app's Bluetooth permission shown as turned off & disabled Remove the iOS app Relaunch the watchOS app Notice the CBCentralManager state is unauthorized Remove and reinstall the watchOS app Tap allow on Bluetooth permission pop-up watchOS app does not crash and CBCentralManager state is poweredOn The state of the watch permissions: Bluetooth is turned on & the toggle is not disabled Note that at this time the iOS app is not installed, there is no way to remove Bluetooth permission for the watch app. Reinstall + launch the iOS app Notice a warning in the log: [##### WARNING #####] App has companion watch app that maybe affected if using CoreBluetooth framework. Please read developer documentation for AccessorySetupKit. Notice a log entry for 💗 CBCentralManager state: poweredOn before tapping start scan Tap start scan and observe another log entry: Failed to show picker due to: The operation couldn’t be completed. (ASErrorDomain error 550.) ASErrorDomain 550: The picker can't be used because the app is in the background. Is this the expected error? 🤔 The state of the iOS permissions: The app's settings show a Bluetooth toggle normally associated with Core Bluetooth, but the app never showed a Core Bluetooth pop-up The iOS ASK app now has Core Bluetooth permission 😵‍💫 Following up with Apple This is a known bug that should be fixed in watchOS 26 when Bluetooth permissions for watch apps can be set independently of the iOS app. I've yet to test it with watchOS 26. See repo for the same post with screenshots of the settings and demo code reproducing the bug: https://github.com/superturboryan/AccessorySetupKit-CoreBluetooth-watchOS-Demo
1
0
268
2w
Evolution of HealthKit workout API on iOS 26 and iPadOS 26 - HKLiveWorkoutDataSource and built-in Sensor Support
I am very happy to see that HealthKit with OS26 is bringing HKLiveWorkoutDataSource to iOS and iPadOS. I have been replicating a similar type for the last several years for users that only have an iPhone. I did notice that the data types that the different platform data sources collect automatically is different. That makes sense if you think exclusively about what the device can actually capture. Bluetooth HRM is the only Bluetooth SIG profile that is out-of-the-box supported for Apple Health on iOS and iPadOS (right?). Whereas watchOS 10 got all of the cycling sensors (woohoo!). It would be great if the types to collect were the same across platforms even if the device couldn't collect the data now, because then in the future when / if new sensor support is added, it will be transparent to developers. Fantastic. Easier life as an indie / third party developer. At least that is the idea. And yes, I know I can also write Core Bluetooth code and roll my own SIG implementation for the cycling profiles, but Apple already has this code in one os, 'just copy it, it will be easy'. I know that isn't the reality especially against the new ASK framework, but one can hope and dream right? Imagine how many more apps would contribute that data if it was supported out of the box. An alternative, GitHub is a great place for Apple to share their Core Bluetooth implementation of the SIG profiles :). Just another thought. Here are some feedbacks related to this: FB17931751 - HealthKit: Add built-in support for cycling sensors on iOS and iPadOS - copy paste the code from watchOS. It will be easy they said (June 2025) FB12323089 - CoreBluetooth / Health / Bluetooth Settings: Add support for cycling sensors announced in watchOS 10 to iOS and iPadOS 17 (June 2023) FB14311218 - HealthKit: Expected outdoor cycling to include .cyclingSpeed quantity type as a default HKLiveWorkoutDataSource type to collect (July 2024) FB14978701 - Bluetooth / HealthKit / Fitness: Expose information about the user specified for Apple Watch paired Cycing Speed Sensor like isConnected and wheelCircumference values (August 2024) FB18402258 - HealthKit: HKLiveWorkoutDataSource should collect same types on iOS and watchOS even if device cannot produce data today (June 2025) FB14236080 - Developer Documentation / HealthKit: Update documentation for HKLiveWorkoutDataSource typesToCollect for which sample types are automatically collected by watchOS 10 and 11 (July 2024) Tangentially related: FB10281304 - HealthKit: Add HKActivityTypes canoeBikeRun and kayakBikeRun (June 2022) FB10281349 - HealthKit: Add HKActivityType walkCanoeWalk and walkKayakWalk (June 2022) FB7807993 - Add HKQuantityTypeIdentifier.paddleDistance for canoeing, kayaking, etc type workouts (June 2020) FB12508654 - HealthKit / Settings / Bluetooth / Workouts: Cycling sensor support doesn't allow for 'bike selection' in use case of multiple bikes and multiple sensors (borrow a bike to ride together) - production usability issue (July 2023)
0
1
87
3w
AccesorySetupKit - device not found when ManufacturerData is present
Hello, I am working on a application that connects to a peripheral using AccessorySetupKit. Peripheral is currently advertising it's custom service UUID. With this setup I am able to discover and connect to the device without issues. Firmware team wants to introduce a change and add a "manufacturer data" to the advertisment for better recognition. Upon testing with iOS app, it turns out that current code breaks and does not discover the device anymore. I am unable to configure AccessorySetupKit to be able to discover the device when it has both service uuid and manufacturer data in advertisment. Removing the newly added manufacturer data "fixes" the issue and app is able to discover peripherals again. Looking at the documentation of ASDiscoveryDescriptor it does not specify that those are mutually excluding fields nor does it provide any insight how the configured fields are evaluated against each other. Is this a bug in AccessorySetupKit? Is there a way to update the descriptor in a way that application will still be able to discover the peripheral if only service UUID is provided? Thanks in advance
4
0
80
2w