Re: Question about including services
Re: Question about including services
- Subject: Re: Question about including services
- From: Etan Kissling <email@hidden>
- Date: Tue, 12 Mar 2013 10:29:08 +0000
- Thread-topic: Question about including services
Rick,
on the iOS stack, you can only discover services within a service. Because an included service is
considered as a separate service in BLE, you will have to discover the included service first, then
read the characteristics you want within it.
Consider specifying UUID filters to reduce latency. Also, on your peripheral, make sure to group
your 16-bit UUIDs at the beginning and your 128-bit UUIDs of the handle range. This speeds up
discovery as multiple 16-bit UUIDs can be combined and returned in a single packet.
Device Name characteristic is discovered and read automatically by iOS. If you try to mess with
it manually, you will run into errors. Just use the peripheral.name property and the relevant
delegate callback in order to retrieve name updates.
Etan
On 12.03.2013, at 08:28, Rick Mann <email@hidden> wrote:
>
> On Mar 12, 2013, at 00:06 , Andras Kovi <email@hidden> wrote:
>
>> My first question is why would you want to replicate the Device Name characteristic? This is handled by iOS for you, you can set it at the
>
> That's true, you do. And in fact, I use that. But I'm asking more generally. If I include one service in another, can I do a single enumeration of the characteristics in that top-level service?
>
>> start of advertisement. Additionally, you'll get this error for service 0x1800:
>>
>> Service add failed: Error Domain=CBErrorDomain Code=8 "The specified UUID is not allowed for this operation." UserInfo=0x1d5b3b80 {NSLocalizedDescription=The specified UUID is not allowed for this operation.}
>
> Hmm. I do a discoverServices with CBUUIDGenericAccessProfileString as one of the UUIDs. I don't get that error.
>
>> You should either use the built in Device Name or your should create your own app specific definition for it. (Though that value will not be published in the advertisement packets.)
>>
>> Unfortunately, there is no shortcut to access the characteristics. You must do the discovery first.
>
> Okay, thanks! Can you tell me if those objects survive a disconnect-reconnect? Can I re-use them? I've already verified they don't work if I'm not connected, so my suspicion is that I'll have to re-discover them.
>
> If that's the case, it seems the only safe way to re-read a characteristic is to completely re-discover it, at least, if you find that the peripheral disconnected since the last time you did discovery.
>
>
> --
> Rick
>
>
>
>
> _______________________________________________
> 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