Re: Connecting to a known BT address with BLE
Re: Connecting to a known BT address with BLE
- Subject: Re: Connecting to a known BT address with BLE
- From: Etan Kissling <email@hidden>
- Date: Wed, 05 Sep 2012 13:35:38 +0000
- Thread-topic: Connecting to a known BT address with BLE
CoreBluetooth does not expose the BdAddr at any point,
although it would be technically possible.
Your idea could therefore only be achieved if you would add a
characteristic to read the device address to your GATT database.
Etan
On 05.09.2012, at 15:11, Jimmy Adler <email@hidden> wrote:
> Hi Etan,
>
> thanks for the reply, even if it wasn't the reply I was hoping for!
>
> Is it possible to retrieve the address in some way after connecting
> to a peripheral? In that case I could connect to the device with the
> best signal strengt, retrieve the address and then compare it to
> the scanned address (that I get from the camera), if they don't match
> I could then connect to the next device in the list until I get a match.
>
> Br,
>
> Jimmy
>
> On Sep 5, 2012, at 1:54 PM, Etan Kissling wrote:
>
>> Jimmy,
>>
>> the UUID is not dependent of the BdAddr and is generated only when
>> you connect to the device for the first time. It is also different when you
>> connect from a different iPhone.
>>
>> The reason for this seems to be that when you have a bond, and the
>> device address changes, that then the UUID should stay the same,
>> allowing you to connect to the known device again.
>>
>> Connecting to a device by BdAddr is not currently supported by the
>> CoreBluetooth framework API. One solution would be to broadcast
>> your BdAddr in your Advertising packets, and then use the scanning
>> facilities to detect your device. However, it is rather a hacky solution.
>> Please note that only a limited amount of data can be stored in
>> advertising data (should be around 31 bytes with AD_TYPE headers).
>>
>> Etan
>>
>> On 05.09.2012, at 00:49, Jimmy Adler <email@hidden> wrote:
>>
>>> Hi,
>>>
>>> I was wondering how to go about connecting (or attempt to
>>> connect) to a BLE device that I know the address to.
>>>
>>> It seems I should do
>>> [centralManager connectPeripheral:peripheral options:nil]
>>> with a peripheral that I construct myself, but that is not legal
>>> since all the properties in the object are readonly.
>>>
>>> Is there any way of doing this?
>>>
>>> I have tried scanning for my device and printing the resulting
>>> UUID for the peripheral, but that does not match with the given
>>> address of the device. (the address is printed on the device
>>> and scanned using barcode scanner to initiate pairing).
>>>
>>> Should I not receive the correct address when printing the UUID
>>> of the peripheral received in "didDiscoverPeripheral"?
>>>
>>> Br,
>>>
>>> Jimmy
>>> _______________________________________________
>>> 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
>>
>
_______________________________________________
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