Bug 8349 - CBPeripheral.DiscoverCharacteristics() error on null characteristicUUIDs
Summary: CBPeripheral.DiscoverCharacteristics() error on null characteristicUUIDs
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
Depends on:
Reported: 2012-11-12 15:41 UTC by Kirk Klobe
Modified: 2012-11-12 17:51 UTC (History)
2 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-11-12 15:41:23 UTC
CBPeripheral.DiscoverCharacteristics should accept null for the characteristicUUIDs argument. Native accepts the following:

[aPeripheral discoverCharacteristics:nil forService:aService];

Whereas MT 6.0.6 throws an exception:

device.DiscoverCharacteristics((CBUUID[])null, service);

System.ArgumentNullException: Argument cannot be null.
Parameter name: characteristicUUIDs
  at MonoTouch.CoreBluetooth.CBPeripheral.DiscoverCharacteristics (MonoTouch.Foundation.NSArray characteristicUUIDs, MonoTouch.CoreBluetooth.CBService forService) [0x0004a] in /Developer/MonoTouch/Source/monotouch/src/CoreBluetooth/CBPeripheral.g.cs:155
  at MonoTouch.CoreBluetooth.CBPeripheral.DiscoverCharacteristics (MonoTouch.CoreBluetooth.CBUUID[] charactersticUUIDs, MonoTouch.CoreBluetooth.CBService forService) [0x00006] in /Developer/MonoTouch/Source/monotouch/src/CoreBluetooth/GuidWrapper.cs:119
Comment 1 Sebastien Pouliot 2012-11-12 17:38:57 UTC
It's not recommanded but null (nil) is valid for discoverCharacteristics:forService: 
I'll fix this and review the other (similar) API. Thanks
Comment 2 Sebastien Pouliot 2012-11-12 17:51:59 UTC
Allow null characteristics on DiscoverIncludedServices and DiscoverCharacteristics - DiscoverServices already had it.

ios6: cb8eef73a426c997a36d9a180db43247df3c2aee