Re: Multiple callbacks to didConnectPeripheral for the same peripheral device
Re: Multiple callbacks to didConnectPeripheral for the same peripheral device
- Subject: Re: Multiple callbacks to didConnectPeripheral for the same peripheral device
- From: Dylan Wilson <email@hidden>
- Date: Mon, 16 Mar 2015 19:22:25 +0000
- Thread-topic: Multiple callbacks to didConnectPeripheral for the same peripheral device
Connect peripheral really only needs to be called once. It remembers what you have asked and will call you back. In your case the connection may be starting to come up while you are asking for another callback and so you get multiple or maybe CB is now
doing 1:1 callbacks.
I've given up expecting a predictable series of events and now are very defensive in handling callbacks.
Regards,
Dylan
Sent from my iPhone
On Mar 16, 2015, at 10:51 AM, Don Clark < email@hidden> wrote:
I call connectPeripheral and set a timer. When the didConnectPeripheral delegate callback is made, the first thing it does is invalidate the timer. If instead the timer fires, the app will re-attempt the connection up to three times. I expected that the
subsequent connectPeripheral calls to CB to connect to a given peripheral would override the previous request, and that's how it used to appear to work. Recently I've noticed that sometimes, after re-issuing the connect request, I'll get a second didConnectPeripheral
callback for the same peripheral. This leaves me with the task of filtering out and ignoring the extraneous callbacks. Or not knowing whether I now have two connections open and must formally disconnect all but one?
*******************************************************************
IMPORTANT MESSAGE FOR RECIPIENTS IN THE U.S.A.:
This message may constitute an advertisement of a BD group's products or services or a solicitation of interest in them. If this is such a message and you would like to opt out of receiving future advertisements or solicitations from this BD group, please forward this e-mail to email@hidden.
*******************************************************************
This message (which includes any attachments) is intended only for the designated recipient(s). It may contain confidential or proprietary information and may be subject to the attorney-client
privilege or other confidentiality protections. If you are not a designated recipient, you may not review, use, copy or distribute this message. If you received this in error, please notify the sender by reply e-mail and delete this message. Thank you.
*******************************************************************
Corporate Headquarters Mailing Address: BD (Becton, Dickinson and Company) 1 Becton Drive Franklin Lakes, NJ 07417 U.S.A.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden