This is working as intended and known as "active scanning" in the Bluetooth Core Specification.
The problem's origin lies in the limited memory space that can be transmitted in the initial advertising packet. The spec describes a way that allows centrals to query for an additional part of Information by sending a SCAN_REQ packet. This additional
part is often used for the device name.
As the corresponding responding packet also only offers 31 bytes of data, it is possible to only put the leading characters of the device name in there. In this case, the full name becomes only visible after connecting to the peripheral and reading the
device name characterisic.
I hope that this clarifies why a peripheral may be "discovered" multiple times. There's just no other callback that corebluetooth can use to tell you that new advertisement data has been received and processed.
Fortunately, you can use "equals" methods to compare if a discovered device is already in a local list, enabling you to handle this case well.
Etan
On 05.11.2012, at 02:14, "András Kövi" < email@hidden> wrote:
Yeah, the sim can be even quirkier than the iPad :)
After seeing how CB works, I ended up writing a small mock peripheral and a minimalistic facade for the central and peripheral managers. This way I can still use the sim for testing
Andras
On Nov 5, 2012 2:03 AM, "Rick Mann" < email@hidden> wrote:
On Nov 4, 2012, at 16:51 , Andras Kovi <email@hidden> wrote:
> Did you try to install apps like BLExplorer on the simulator and those successfully connected?
I don't know about that app…
> Side note: the services property of the peripheral will contain values only if you do a discoverServices call first.
Yeah, didn't know if I had to connect first to do that.
> Please let me know what did the test with the iPad yield. I'm really curious.
Sure enough, iPad connects just fine!
Guess I'm back to not being able to do stuff in the sim.
--
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
|