Using iOS Gamekit's "Bluetooth Bonjour" with Other Platforms

Is it possible, in principle, for an Android device to interface with an iPhone over Bluetooth/GameKit?

Yes, it is possible. GameKit is a protocol using TCP and/or UDP over a BNEP Bluetooth connection. It also uses a trick to identify other iOS devices using the Extended Inquiry mechanism in Bluetooth 2.1+.

I was able to simulate the EIR responses, now, someone needs to reverse engineer the GameKit protocol. This doesn't need Bluetooth, as it is also used for GameKit connections over WLAN.

If anybody can re-implment GameKit for WLAN connections, I can finish the Bluetooth version.

Accessing Bluetooth via Bonjour/GameKit from the iPhone SDK simulator (circa 3.1.3)

I'm not sure I understand your question entirely.

I can state that in iOS (as of May 2011) the only access you have to bonjour is through the Gamekit functionality. That functionality is fairly robust, but (for instance) you will not be able to create a BT based bonjour service that other non-iOS BT enabled devices can find.

On the simulator, even if the underlying device HAS bluetooth capabilities, you will NOT be able to perform "real" bluetooth operations. Instead the simulator will simulate some capabilities, and ignore others. You really do need multiple devices to load your code onto and run, in order to test out BT code.

PAN with Linux, iOS, Bluetooth, Bonjour, GameKit -- Possible?

iOS 3.0 provides support for headsets (mono/stereo), networking via the PAN/BNEP protocol and support for "Made for iPhone" devices which require a proprietary Bluetooth protocol. Still, not even basic OBEX support is included (available with any low-price mobile phone), and no API is available to connect to arbitrary Bluetooth devices. It also extents the GameKit API to allow for iOS-to-iOS communication.

iPhone Bluetooth Information

Personally, I would instead use wifi + bonjour. Here's a tutorial about implementing it, some of the code can be pretty gross, but once you get the boilerplate out of the way, it "just works", which is always a feel good moment.

Bonjour not advertising over BT

I just finished solving this in my own app in the last 24 hours. I used the core classes from the OS X sample app DNSSDObjects. I only had to change three lines of code to add support for bluetooth. This works great in my iOS app.

In DNSSDBrowser.m, the call to DNSServiceBrowse needs to have kDNSServiceFlagsIncludeP2P passed in for the 2nd parameter.

In DNSSDRegister.m, the call to DNSServiceRegister needs the same change.

In DNSSDService.m, the call to DNSServiceResolve also needs the same change.

If you want to limit yourself to just bluetooth, and not WiFi, then the same three lines of code should be updated so the 3rd parameter is kDNSServiceInterfaceIndexP2P instead of kDNSServiceInterfaceIndexAny.

Does using bonjour on the iphone enable bluetooth automatically?

No. The user is responsible for selecting the network connectivity options in the Settings App. If they have not enabled Bluetooth, you cannot turn it on for them.

-t



Related Topics



Leave a reply



Submit