Chuckster
Chuckster

Reputation: 41

BluetoothManager: Don't get any "BluetoothDeviceDiscoveredNotification"

I want my iPhone App to display a list of ALL Bluetooth Devices nearby (e.g. other iPhones, Android,...basically everything with bluetooth enabled). I'm using the private framework "BluetoothManager" (I know, that this will cause rejection at AppStore).

So far, everything worked fine:

But BTM never seems to post a "BluetoothDeviceDiscoveredNotification". I have two other iPhones with enabled bluetooth lying next to the device, I'm testing my app on, but none of them is discovered (they are both discoverable, my MAC finds them!)

Any ideas what the problem might be?

I browsed stackoverflow and found another question, where someone is using basically the same code, and it works for him! See: other question I have no idea, why my app does NOT discover any devices although it is "working".

I would really appreciate some answers! As there is no documentation on BluetoothManager, I'm slowly running out of ressources to get help from ;o)

Thanks!

Upvotes: 3

Views: 901

Answers (3)

lucianoenrico
lucianoenrico

Reputation: 1494

I use:

[btManager  setDeviceScanningEnabled:YES];
[btManager scanForServices:0xFFFFFFFF];

Upvotes: 2

Guigeek
Guigeek

Reputation: 21

I had the same problem and I used scanForServices:~0x0 instead of setDeviceScanningEnabled:YES

Upvotes: 0

Chuckster
Chuckster

Reputation: 41

I think I may have found the answer to the question myself: It seems, iOS5 is filtering the results of DeviceScanning BEFORE any "BluetoothDeviceDiscoveredNotification" is posted. In the end, only Headsets and similar devices are "reported", while devices like e.g. other iPhones are "blocked".

Now a follow-up question: Does anyone have an idea, how to pass this filtering? I really don't need to do anything with the devices (communicate or anything), I JUST want to discover them! I can't believe that there should be no possible way to do that in iOS5! Any ideas?

Thanks!

Upvotes: 1

Related Questions