Re: Can I keep CBService and CBCharacteristics around?
Re: Can I keep CBService and CBCharacteristics around?
- Subject: Re: Can I keep CBService and CBCharacteristics around?
- From: András Kövi <email@hidden>
- Date: Mon, 03 Jun 2013 14:33:02 +0200
Hi Steve,
encryption requires paired devices. Pairing is done with the dialog you mention and your app has no way to dismiss it programmatically. Theoretically it has to be done only once.
I am, of course, not aware of all your requirements but I'd suggest you to try to avoid this kind of caching. Leave it up to the system to do it for you unless you have some performance issue that may be solved in this way.
Side note: I feel like this is similar to when you want to cache images but use [UIImage imageNamed:] to obtain them. It may seem to make sense but at the same time UIImage aready does it for you, so it practically just makes things more complex without much gain. I haven't done testing as to how much caching CoreBluetooth does but I feel like this is something that is necessarily an OS function. On the other hand, people on this list have been complaining that it does actually cache quite aggressively, which hinders testing in some cases. All in all, implementing additional caching will surely make your code more complex (think of handling BT reset, crashes, hidden XPC errors, etc.) without much practical gain (if any).
Regards,
Andras