Re: Bluetooth-dev Digest, Vol 12, Issue 21
Re: Bluetooth-dev Digest, Vol 12, Issue 21
- Subject: Re: Bluetooth-dev Digest, Vol 12, Issue 21
- From: Diego Alfarache <email@hidden>
- Date: Mon, 16 Mar 2015 10:23:54 -0500
- Thread-topic: Bluetooth-dev Digest, Vol 12, Issue 21
I see this exact same scenario, discover device, connect, discover
services, etc, but I am connecting 2 iDevices, one as a peripheral and one
as a central. Same error code 10. I also have added code to retry the
connection after a short random amount of time.
Diego
On 3/16/15, 9:47 AM, "Don Clark" <email@hidden> wrote:
>
>Yes, I see this fairly frequently. I¹m also using a Nordic chip, but it¹s
>an nRF51822. I¹ve added code that sees this disconnect and retries, but
>its¹a real pain, and I assume that it¹s caused by some timing issue
>between Core Bluetooth and the device.
>
>
>Don
>
>
>
>On 2/7/15, 3:00 PM, "email@hidden"
><email@hidden> wrote:
>
>>Date: Fri, 06 Feb 2015 16:35:16 -0600
>>From: Justin Cooper <email@hidden>
>>To: "email@hidden" <email@hidden>
>>Subject: peripheral disconnects when discovering services
>>Message-ID:
>> <CAOkf_k-D5hsGYY1t1VdLb7ADZNwU0=6LvBJyATcM-EqOodj=email@hidden>
>>Content-Type: text/plain; charset="utf-8"
>>
>>Hello!
>>
>>
>>I am having an intermittent issue, where I get an unexpected disconnect
>>from our hardware peripheral (which uses the Nordic nrf8001 chip) about 1
>>out of 20 times.
>>
>>The disconnect always happens at exactly the same place. Here is my
>>connection sequence:
>>
>> -
>>
>> central.scanForPeripheralsWithServices([serviceUUIDUART], options:
>>nil)
>> -
>>
>> didDiscoverPeripheral -> look for matching name in advertisementData,
>>if
>> found continue with:
>> -
>>
>> store a reference to peripheral as myPeripheral
>> -
>>
>> central.connectPeripheral(peripheral, options: nil)
>> -
>>
>> central.stopScan()
>> -
>>
>> wait for didConnectPeripheral then call
>>myPeripheral?.discoverServices([
>> serviceUUIDUART])
>>
>>
>>Right here is where it fails, again about 1 out of 20 times.
>>
>>I've posted my debug output log and the error code I receive in
>>didDisconnectPeripheral.
>>
>>
>>This test is running in a loop, by the way, where we connect, discover
>>services, send and receive data, then disconnect. Then we wait for, say,
>>6
>>second and start the loop over.
>>
>>
>>Has anyone else seen errors like this when connecting?
>>
>>
>>
>>*Found Peripheral 50000 <__NSConcreteUUID 0x1742250a0>
>>36DC3DDA-9384-D02F-BF95-12527501BB86*
>>
>>*connected to peripheral <CBPeripheral: 0x1700f0d00, identifier =
>>36DC3DDA-9384-D02F-BF95-12527501BB86, name = 50000, state = connected>*
>>
>>*my peripheral is <CBPeripheral: 0x1700f0d00, identifier =
>>36DC3DDA-9384-D02F-BF95-12527501BB86, name = 50000, state = connected>*
>>
>>*going to discover services for Snail and VIU*
>>
>>*disconnected from peripheral <CBPeripheral: 0x1700f0d00, identifier =
>>36DC3DDA-9384-D02F-BF95-12527501BB86, name = 50000, state = disconnected>
>>for reasons Error Domain=CBErrorDomain Code=10 "The connection has failed
>>unexpectedly." UserInfo=0x17426f980 {NSLocalizedDescription=The
>>connection
>>has failed unexpectedly.}*
>>
>>
>>
>>Thanks!
>>
>>
>>*Justin*
>
>
> _______________________________________________
>Do not post admin requests to the list. They will be ignored.
>Bluetooth-dev mailing list (email@hidden)
>Help/Unsubscribe/Update your Subscription:
>om
>
>This email sent to email@hidden
_______________________________________________
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