I'm using AccessorySetupKit to discover and connect to a bluetooth device via BLE pairing.
I added Info.plist key to filter bluetoothServiceUUIDs like so and my descriptor is defined like :
ASDiscoveryDescriptor *descriptor1 = [[ASDiscoveryDescriptor alloc] init];
descriptor1.bluetoothServiceUUID = [CBUUID UUIDWithString:serviceUUID]; // Replace with actual UUID
ASPickerDisplayItem *item1 = [[ASPickerDisplayItem alloc] initWithName:@"Item 1"
productImage:[UIImage systemImageNamed:@"person"]
descriptor:descriptor1];
[self.session showPickerForDisplayItems:@[item1] completionHandler:^(NSError * _Nullable error) {
if (error) {
NSLog(@"Failed to show picker: %@", error.localizedDescription);
}
}];
The picker can't find the device unless it has been paired outside of the app (paired by another app like "BLE scanner" app).
My bluetooth device is NOT advertising its service UUID in the advertising section when scanning the device. I found the UUID in Services section and pick a custom service UUID available.
I tried on a device that advertise directly its serviceUUIDs in advertising section and it work perfectly fine without previous pairing outside the app.
I'm using AccessorySetupKit to discover and connect to a bluetooth device via BLE pairing.
I added Info.plist key to filter bluetoothServiceUUIDs like so and my descriptor is defined like :
ASDiscoveryDescriptor *descriptor1 = [[ASDiscoveryDescriptor alloc] init];
descriptor1.bluetoothServiceUUID = [CBUUID UUIDWithString:serviceUUID]; // Replace with actual UUID
ASPickerDisplayItem *item1 = [[ASPickerDisplayItem alloc] initWithName:@"Item 1"
productImage:[UIImage systemImageNamed:@"person"]
descriptor:descriptor1];
[self.session showPickerForDisplayItems:@[item1] completionHandler:^(NSError * _Nullable error) {
if (error) {
NSLog(@"Failed to show picker: %@", error.localizedDescription);
}
}];
The picker can't find the device unless it has been paired outside of the app (paired by another app like "BLE scanner" app).
My bluetooth device is NOT advertising its service UUID in the advertising section when scanning the device. I found the UUID in Services section and pick a custom service UUID available.
I tried on a device that advertise directly its serviceUUIDs in advertising section and it work perfectly fine without previous pairing outside the app.
My bluetooth device is NOT advertising its service UUID in the advertising section when scanning the devic
Your peripheral needs to advertise the service that you have provided to your ASDiscoveryDescriptor
in order for the accessory picker to show it. If the service isn't being advertised then a connection is required to interrogate the services data. That is why the accessory shows up after you have paired it using some other process