Bug 26091 - Event FailedToConnectPeripheral doesn't seem to be being raised after calling CBCentralManager.ConnectPeripheral
Summary: Event FailedToConnectPeripheral doesn't seem to be being raised after calling...
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.4.0
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-16 02:07 UTC by dj_technohead
Modified: 2015-01-16 13:33 UTC (History)
2 users (show)

Tags:
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:
Status:
RESOLVED ANSWERED

Description dj_technohead 2015-01-16 02:07:08 UTC
I'm trying to detect when an attempt to connect to a peripheral fails. I've hooked up the CBCentralManager.FailedToConnectPeripheral event, but have not seen this event raised when zero bluetooth devices are present.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-01-16 04:01:10 UTC
From Apple's documentation [1]:

"This method is invoked when a connection initiated via the connectPeripheral:options: [ConnectPeripheral] method fails to complete. Because connection attempts do not time out, a failed connection usually indicates a transient issue, in which case you may attempt to connect to the peripheral again."

This means that FailedToConnectPeripheral is not raised when there are zero bluetooth devices present, but when a connection attempt to a device failed.
Comment 3 dj_technohead 2015-01-16 11:07:55 UTC
Sorry Ralph, I wrote that bug description late last night. I have discovered a device using ScanForPeripheral and once discovered, I power the device off and then from the app call ConnectPeripheral. It is at this point I expect the event to be raised, but I don't seem to get it.
Comment 4 Rolf Bjarne Kvinge [MSFT] 2015-01-16 11:22:06 UTC
We're a direct binding of the ObjC API, so there's not much we can do if iOS doesn't raise the event.
Comment 5 dj_technohead 2015-01-16 13:33:59 UTC
Yeah I figured. Was hoping that maybe that delegate method wasn't hooked up or the event wasn't getting raised from the wrapper for some reason.

Thanks Ralph.