Re: Null UUID Returned for CBPeripheral
Re: Null UUID Returned for CBPeripheral
- Subject: Re: Null UUID Returned for CBPeripheral
- From: Ramin Firoozye <email@hidden>
- Date: Tue, 25 Sep 2012 12:14:49 -0700
Under iOS5 the UUID was loaded up in didDiscoverPeripheral. Under iOS6 it will not be loaded until after the connection is established. According to a post on the forums this is intended to allow for devices that have random resolvable addresses which don't get a UUID until needed (and even then might change at a later time).
If you're using the UUID as an index into a dictionary where you are holding the list of discovered peripherals, there's an easy workaround. Create a custom CFUUID as an NSString, use that as the index and attach it to the CBPeripheral instance using objc_setAssociatedObject. At any later time you can use objc_getAssociatedObject to retrieve it. That way you're guaranteed a well-known UUID for each peripheral and it works under both iOS5 and 6.
If you're using the UUID to remember the list of peripherals for later fast reconnection, then you probably don't really need it until connection has been made.
Cheers,
Ramin
On Sep 24, 2012, at 10:45 PM, R. Justin <email@hidden> wrote:
> Hello,
>
> We're trying to access the UUID on the CBPeripheral object returned by the didDiscoverPeripheral.
>
> The call peripheral.UUID will sometimes return a null value for a peripheral. We have verified that the uuid will sometimes be able to be pulled from the same device after the iPhone has been restarted or the Bluetooth has been reset. We are wondering:
>
> 1) Is this a known issue?
> 2) Who else has seen this issue on the list?
> 3) Are there any workarounds?
> 4) Has a bug report has been filed for this issue? We are filing one now just in case.
>
> Thank you and we appreciate everyone's advice and help in the matter.
> _______________________________________________
> 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