Bug 5820 - Can't pass 16-bit UUIDs to CBCentralManager.ScanForPeripherals()
Summary: Can't pass 16-bit UUIDs to CBCentralManager.ScanForPeripherals()
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-06-22 10:04 UTC by Kirk Klobe
Modified: 2012-07-25 11:28 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Kirk Klobe 2012-06-22 10:04:05 UTC
In Objective-C, I can use 16-bit UUIDs with the following syntax:

[CBUUID UUIDWithString:@"1803"]

I cannot see a way to pass these 16-bit UUIDs to CBCentralManager.ScanForPeripherals(), since it accepts Guid[], nor can I convert from a 16-bit CBUUID to Guid[].

Perhaps an overload could be added to accept CBUUID[]?
Comment 1 Sebastien Pouliot 2012-07-16 16:59:26 UTC
It looks like we overgeneralized the case.

> nor can I convert from a 16-bit CBUUID to Guid[].

A quick workaround is to "promote" the short UUID to a full, 128 bits, UUID.

e.g. "1803" would become "00001803-0000-1000-8000-00805F9B34FB"
Comment 2 Miguel de Icaza [MSFT] 2012-07-25 11:27:13 UTC
Fixed for the upcoming MonoTouch 5.3.next

WE introduced new overloads in the CoreBluetooth classes that take the CBUUID in addition to GUIDs.